X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon.c;fp=src%2Fcommon.c;h=10eb44e92c2f9acdf207cc7358787bc97c5dac21;hb=7121c2890c0e4fb9eca589c0dbb2dc02bf115a79;hp=f52497c0a6972f3ebe4ecfe01236460fe25fbd5b;hpb=3a8dcb1b8028fca2a581198c8b0e4a58c1a22897;p=lttngtop.git diff --git a/src/common.c b/src/common.c index f52497c..10eb44e 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); +}