X-Git-Url: http://git.liburcu.org/?p=lttngtop.git;a=blobdiff_plain;f=src%2Flttngtop.c;h=e9beb0d0aab082dec131fec1422359d6495f769f;hp=374f3e90c8d578ec71d6502f53438fd2d194c5c6;hb=6e11e0d0eebdfe842bc7153ad9e28947b3cb3365;hpb=12a91e9dd6c9cc18989351762d19ed1e69fe627c diff --git a/src/lttngtop.c b/src/lttngtop.c index 374f3e9..e9beb0d 100644 --- a/src/lttngtop.c +++ b/src/lttngtop.c @@ -258,10 +258,17 @@ enum bt_cb_ret print_timestamp(struct bt_ctf_event *call_data, void *private_dat * print the newline in this case */ if (last_textdump_print_newline == 0) printf("\n"); - printf("%02d:%02d:%02d.%09" PRIu64 " (%s) (cpu %d) [%s (%d)] %s (", - start.tm_hour, start.tm_min, start.tm_sec, - ts_nsec_start, hostname, cpu_id, procname, pid, - bt_ctf_event_name(call_data)); + if (hostname) { + printf("%02d:%02d:%02d.%09" PRIu64 " (%s) (cpu %d) [%s (%d)] %s (", + start.tm_hour, start.tm_min, start.tm_sec, + ts_nsec_start, hostname, cpu_id, procname, pid, + bt_ctf_event_name(call_data)); + } else { + printf("%02d:%02d:%02d.%09" PRIu64 " (cpu %d) [%s (%d)] %s (", + start.tm_hour, start.tm_min, start.tm_sec, + ts_nsec_start, cpu_id, procname, pid, + bt_ctf_event_name(call_data)); + } print_fields(call_data); printf(") "); if (strncmp(bt_ctf_event_name(call_data), "sys_", 4) != 0) { @@ -655,7 +662,6 @@ static int parse_options(int argc, char **argv) opt_textdump = 1; break; case OPT_CHILD: - opt_textdump = 1; opt_child = 1; break; case OPT_PID: @@ -735,6 +741,10 @@ void iter_trace(struct bt_context *bt_ctx) bt_ctf_iter_add_callback(iter, 0, NULL, 0, fix_process_table, NULL, NULL, NULL); + /* to handle the follow child option */ + bt_ctf_iter_add_callback(iter, + g_quark_from_static_string("sched_process_fork"), + NULL, 0, handle_sched_process_fork, NULL, NULL, NULL); if (opt_textdump) { bt_ctf_iter_add_callback(iter, 0, NULL, 0, print_timestamp,