X-Git-Url: https://git.lttng.org/?p=lttngtop.git;a=blobdiff_plain;f=src%2Fcommon.c;fp=src%2Fcommon.c;h=a6c2e4c3cfa17a24d833dce601947e14761969a1;hp=c752c74a29b6f28e25c7f99fb4db7ec117f91046;hb=18e85696d986196569d5c67ce5352708948f88df;hpb=26d63ddf68515dd749de4b22465b28ef6bce2ed2 diff --git a/src/common.c b/src/common.c index c752c74..a6c2e4c 100644 --- a/src/common.c +++ b/src/common.c @@ -298,7 +298,7 @@ struct processtop *get_proc_pid(struct lttngtop *ctx, int tid, int pid, tmp = find_process_tid(ctx, tid, NULL); if (tmp && tmp->pid == pid) return tmp; - return add_proc(ctx, tid, "Unknown", timestamp, hostname); + return add_proc(ctx, tid, NULL, timestamp, hostname); } void add_thread(struct processtop *parent, struct processtop *thread) @@ -502,7 +502,10 @@ struct lttngtop* get_copy_lttngtop(unsigned long start, unsigned long end) if (tmpfile != NULL) { memcpy(newfile, tmpfile, sizeof(struct files)); - newfile->name = strdup(tmpfile->name); + if (tmpfile->name) + newfile->name = strdup(tmpfile->name); + else + newfile->name = NULL; newfile->ref = new; g_ptr_array_add(new->process_files_table, newfile); @@ -590,7 +593,7 @@ enum bt_cb_ret handle_statedump_process_state(struct bt_ctf_event *call_data, struct processtop *proc; unsigned long timestamp; int64_t pid, tid, ppid, vtid, vpid, vppid; - char *procname, *hostname = NULL; + char *procname = NULL, *hostname = NULL; timestamp = bt_ctf_get_timestamp(call_data); if (timestamp == -1ULL)