hostname list
[lttngtop.git] / src / common.c
index 3d8fc4040880c9a4f4dfc95031eae7dc7bd28c74..bc3fff3d55b3e0d5023e3ff910658637fa82c435 100644 (file)
@@ -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);
+}
This page took 0.023005 seconds and 4 git commands to generate.