- printf("%02d:%02d:%02d.%09" PRIu64 " %s\n", start.tm_hour,
- start.tm_min, start.tm_sec, ts_nsec_start,
- bt_ctf_event_name(call_data));
+ pid = get_context_pid(call_data);
+ if (pid == -1ULL && opt_pid) {
+ goto error;
+ }
+
+ if (opt_pid && opt_pid != pid)
+ goto end;
+
+ if (strcmp(bt_ctf_event_name(call_data), "exit_syscall") == 0) {
+ scope = bt_ctf_get_top_level_scope(call_data,
+ BT_EVENT_FIELDS);
+ syscall_ret = bt_ctf_get_int64(bt_ctf_get_field(call_data,
+ scope, "_ret"));
+ printf("= %ld\n", syscall_ret);
+ } else {
+ printf("%02d:%02d:%02d.%09" PRIu64 " %d : %s ", start.tm_hour,
+ start.tm_min, start.tm_sec, ts_nsec_start,
+ pid, bt_ctf_event_name(call_data));
+ }