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)
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);
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)
return;
if (fd >= proc->process_files_table->len) {
tmp = g_new0(struct files, 1);
- tmp->name = "Unknown";
+ tmp->name = NULL;
tmp->read = 0;
tmp->write = 0;
tmp->fd = fd;
tmp = g_ptr_array_index(proc->process_files_table, fd);
if (tmp == NULL) {
tmp = g_new0(struct files, 1);
- tmp->name = "Unknown";
+ tmp->name = NULL;
tmp->read = 0;
tmp->write = 0;
tmp->fd = fd;
if (parent) {
tmp_parent = g_ptr_array_index(
parent->process_files_table, fd);
- if (tmp_parent &&
+ if (tmp_parent && tmp->name &&
(strcmp(tmp->name, tmp_parent->name)) != 0)
tmp->name = strdup(tmp_parent->name);
}