Fix FSF address in license headers
[lttngtop.git] / src / lttngtop.c
index 6bb03ac760c20c1a3f9daa121475af0c7fd72b70..c4dc4ced60fc0098f307bf5d490c13ff24dec61d 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #define _GNU_SOURCE
@@ -248,7 +247,6 @@ enum bt_cb_ret fix_process_table(struct bt_ctf_event *call_data,
        int pid, tid, ppid;
        char *comm;
        struct processtop *parent, *child;
-       struct definition *scope;
        unsigned long timestamp;
 
        /* FIXME : display nice error when missing context pid, tid, ppid and comm */
@@ -257,25 +255,23 @@ enum bt_cb_ret fix_process_table(struct bt_ctf_event *call_data,
        if (timestamp == -1ULL)
                goto error;
 
-       scope = bt_ctf_get_top_level_scope(call_data, BT_STREAM_EVENT_CONTEXT);
-
-       pid = bt_ctf_get_int64(bt_ctf_get_field(call_data, scope, "_pid"));
-       if (bt_ctf_field_get_error()) {
+       pid = get_context_pid(call_data);
+       if (pid == -1ULL) {
 //             fprintf(stderr, "Missing pid context info\n");
                goto error;
        }
-       tid = bt_ctf_get_int64(bt_ctf_get_field(call_data, scope, "_tid"));
-       if (bt_ctf_field_get_error()) {
+       tid = get_context_tid(call_data);
+       if (tid == -1ULL) {
 //             fprintf(stderr, "Missing tid context info\n");
                goto error;
        }
-       ppid = bt_ctf_get_int64(bt_ctf_get_field(call_data, scope, "_ppid"));
-       if (bt_ctf_field_get_error()) {
+       ppid = get_context_ppid(call_data);
+       if (ppid == -1ULL) {
 //             fprintf(stderr, "Missing ppid context info\n");
                goto error;
        }
-       comm = bt_ctf_get_char_array(bt_ctf_get_field(call_data, scope, "_procname"));
-       if (bt_ctf_field_get_error()) {
+       comm = get_context_comm(call_data);
+       if (!comm) {
 //             fprintf(stderr, "Missing procname context info\n");
                goto error;
        }
This page took 0.022947 seconds and 4 git commands to generate.