tid = bt_ctf_get_int64(bt_ctf_get_field(event,
scope, "_tid"));
if (bt_ctf_field_get_error()) {
- fprintf(stderr, "Missing tid context info\n");
- return -1ULL;
+ tid = bt_ctf_get_int64(bt_ctf_get_field(event,
+ scope, "_vtid"));
+ if (bt_ctf_field_get_error()) {
+ fprintf(stderr, "Missing tid context info\n");
+ return -1ULL;
+ }
}
return tid;
pid = bt_ctf_get_int64(bt_ctf_get_field(event,
scope, "_pid"));
if (bt_ctf_field_get_error()) {
- fprintf(stderr, "Missing pid context info\n");
- return -1ULL;
+ /* Try UST pid */
+ pid = bt_ctf_get_int64(bt_ctf_get_field(event,
+ scope, "_vpid"));
+ if (bt_ctf_field_get_error()) {
+ fprintf(stderr, "Missing pid context info\n");
+ return -1ULL;
+ }
}
return pid;
ppid = bt_ctf_get_int64(bt_ctf_get_field(event,
scope, "_ppid"));
if (bt_ctf_field_get_error()) {
- fprintf(stderr, "Missing ppid context info\n");
return -1ULL;
}
ppid = bt_ctf_get_int64(bt_ctf_get_field(call_data,
scope, "_ppid"));
if (bt_ctf_field_get_error()) {
- fprintf(stderr, "Missing ppid context info\n");
- goto error;
+ goto end;
}
tid = bt_ctf_get_int64(bt_ctf_get_field(call_data,
scope, "_tid"));
proc->pid = pid;
}
+end:
return BT_CB_OK;
error:
ret = 0;
goto end;
}
- printf_verbose("Waiting for %" PRIu64 " streams:\n",
- ctx->session->stream_count);
+ printf_verbose("Waiting for %u streams:\n",
+ be32toh(rp.streams_count));
ctx->session->streams = g_new0(struct lttng_live_viewer_stream,
ctx->session->stream_count);
for (i = 0; i < be32toh(rp.streams_count); i++) {
goto end;
}
if (rp.flags & LTTNG_VIEWER_FLAG_NEW_STREAM) {
+ printf_verbose("get_data_packet: new streams needed\n");
ret = ask_new_streams(ctx);
if (ret < 0)
goto error;
g_hash_table_foreach(ctx->session->ctf_traces, add_traces,
ctx->bt_ctx);
+ ret = 0;
+ goto end;
}
fprintf(stderr, "[error] get_data_packet: error\n");
ret = -1;
bt_ctf_iter_destroy(iter);
#endif
ret = check_requirements(ctx->bt_ctx);
- if (ret < 0) {
+ if (ret < 0 && !valid_trace) {
fprintf(stderr, "[error] some mandatory contexts "
"were missing, exiting.\n");
goto end;
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;
}
ppid = get_context_ppid(call_data);
if (ppid == -1ULL) {
- goto error;
+ goto end;
}
vpid = get_context_vpid(call_data);
if (pid == -1ULL) {
ret = -1;
fprintf(stderr, "[error] missing procname context information\n");
}
+ if (ret == 0) {
+ valid_trace = 1;
+ }
end:
return ret;
}
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) {
extern int opt_textdump;
extern int opt_child;
extern int opt_begin;
+extern int valid_trace;
extern pthread_t display_thread;
extern pthread_t timer_thread;