X-Git-Url: http://git.liburcu.org/?p=lttngtop.git;a=blobdiff_plain;f=src%2Fcommon.c;h=bc3fff3d55b3e0d5023e3ff910658637fa82c435;hp=3d8fc4040880c9a4f4dfc95031eae7dc7bd28c74;hb=467097ac13d432cc25af5c93fec285ac23d25304;hpb=114cae592abf524003c3575623dbdb2191a827cc diff --git a/src/common.c b/src/common.c index 3d8fc40..bc3fff3 100644 --- a/src/common.c +++ b/src/common.c @@ -215,6 +215,7 @@ struct processtop* add_proc(struct lttngtop *ctx, int tid, char *comm, if (is_hostname_filtered(hostname)) { add_filter_tid_list(tid, newproc); } + add_hostname_list(hostname, 0); } return newproc; @@ -239,6 +240,7 @@ struct processtop* update_proc(struct processtop* proc, int pid, int tid, if (is_hostname_filtered(hostname)) { add_filter_tid_list(tid, proc); } + add_hostname_list(hostname, 0); } } return proc; @@ -713,3 +715,18 @@ void remove_filter_tid_list(int tid) g_hash_table_remove(global_filter_list, (gpointer) (unsigned long) &tid); } + +void add_hostname_list(char *hostname, int filter) +{ + struct host *host; + + if (lookup_hostname_list(hostname)) + return; + + host = g_new0(struct host, 1); + host->hostname = strdup(hostname); + host->filter = filter; + g_hash_table_insert(global_host_list, + (gpointer) host->hostname, + (gpointer) host); +}