pretty-printing cleanup
authorJulien Desfossez <jdesfossez@efficios.com>
Fri, 7 Feb 2014 22:03:53 +0000 (17:03 -0500)
committerJulien Desfossez <jdesfossez@efficios.com>
Fri, 7 Feb 2014 22:03:53 +0000 (17:03 -0500)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
src/lttngtop.c

index 33f098a977c360b4f9d21efdcd85c33d2efcf59a..f85d11e1d73653954665458ae0b9b28e6e80c80c 100644 (file)
@@ -270,22 +270,13 @@ enum bt_cb_ret print_timestamp(struct bt_ctf_event *call_data, void *private_dat
        delta = timestamp - prev_ts;
        prev_ts = timestamp;
 
-       if (hostname) {
-               printf("%02d:%02d:%02d.%09" PRIu64 " (+%" PRIu64 ".%09" PRIu64 ") (%s) "
-                               "(cpu %d) [%s (%d/%d)] %s (",
-                               start.tm_hour, start.tm_min, start.tm_sec,
-                               ts_nsec_start, delta / NSEC_PER_SEC,
-                               delta % NSEC_PER_SEC, hostname, cpu_id,
-                               procname, pid, tid,
-                               bt_ctf_event_name(call_data));
-       } else {
-               printf("%02d:%02d:%02d.%09" PRIu64 " (+%" PRIu64 ".%09" PRIu64 ") "
-                               "(cpu %d) [%s (%d/%d)] %s (",
-                               start.tm_hour, start.tm_min, start.tm_sec,
-                               ts_nsec_start, delta  / NSEC_PER_SEC,
-                               delta % NSEC_PER_SEC, cpu_id, procname, pid,
-                               tid, bt_ctf_event_name(call_data));
-       }
+       printf("%02d:%02d:%02d.%09" PRIu64 " (+%" PRIu64 ".%09" PRIu64 ") %s%s"
+                       "(cpu %d) [%s (%d/%d)] %s (",
+                       start.tm_hour, start.tm_min, start.tm_sec,
+                       ts_nsec_start, delta / NSEC_PER_SEC,
+                       delta % NSEC_PER_SEC, (hostname) ? hostname : "",
+                       (hostname) ? " ": "", cpu_id, procname, pid, tid,
+                       bt_ctf_event_name(call_data));
        print_fields(call_data);
        printf(")\n");
 
This page took 0.030965 seconds and 4 git commands to generate.