X-Git-Url: https://git.lttng.org/?p=lttngtop.git;a=blobdiff_plain;f=src%2Flttngtop.c;h=326bae832c34745517a4d680325ea496161c9853;hp=46493482de9890238685ed5bbc54ee2639f93f0f;hb=8fe4d0cfce4c1b1ace5aed2b2b1521caca113bd5;hpb=de847ed22a50f8fb3a4d9732b49562f6f0f73895 diff --git a/src/lttngtop.c b/src/lttngtop.c index 4649348..326bae8 100644 --- a/src/lttngtop.c +++ b/src/lttngtop.c @@ -66,6 +66,8 @@ int opt_begin; int opt_all; int quit = 0; +/* We need at least one valid trace to start processing. */ +int valid_trace = 0; struct lttngtop *copy; pthread_t display_thread; @@ -331,7 +333,7 @@ enum bt_cb_ret textdump(struct bt_ctf_event *call_data, void *private_data) syscall_ret = bt_ctf_get_int64(bt_ctf_get_field(call_data, scope, "_ret")); - printf("= %" PRId64 " (+%" PRIu64 ".%09" PRIu64 ")\n", + printf("= %" PRId64 " (%" PRIu64 ".%09" PRIu64 "s)\n", syscall_ret, delta / NSEC_PER_SEC, delta % NSEC_PER_SEC); last_syscall = NULL; @@ -569,7 +571,7 @@ enum bt_cb_ret fix_process_table(struct bt_ctf_event *call_data, } ppid = get_context_ppid(call_data); if (ppid == -1ULL) { - goto error; + goto end; } vpid = get_context_vpid(call_data); if (pid == -1ULL) { @@ -1163,6 +1165,9 @@ int check_requirements(struct bt_context *ctx) ret = -1; fprintf(stderr, "[error] missing procname context information\n"); } + if (ret == 0) { + valid_trace = 1; + } end: return ret; @@ -1239,10 +1244,10 @@ int main(int argc, char **argv, char **envp) } ret = check_requirements(bt_ctx); - if (ret < 0) { + if (ret < 0 && !valid_trace) { fprintf(stderr, "[error] some mandatory contexts " "were missing, exiting.\n"); - goto end; + //goto end; } if (!opt_textdump) {