X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fcontrolflow%2Fprocesslist.c;h=9bedbc99f4c5cbe815d34edc73e917e49731b467;hb=6f26fc3843fad79c22e8dd745eff3d659b8eb550;hp=0a29dfe1e9fa2109590d29ccfb96192d9a26996d;hpb=54d8f654b0f1e1301f4e8a2bdc600bc370fff6f9;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c index 0a29dfe1..9bedbc99 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c @@ -233,16 +233,17 @@ gint process_sort_func ( GtkTreeModel *model, } -static guint hash_fct(gconstpointer key) +static guint process_list_hash_fct(gconstpointer key) { - return ((ProcessInfo*)key)->pid; + guint pid = ((ProcessInfo*)key)->pid; + return ((pid>>8 ^ pid>>4 ^ pid>>2 ^ pid) ^ ((ProcessInfo*)key)->cpu); } -static gboolean equ_fct(gconstpointer a, gconstpointer b) +static gboolean process_list_equ_fct(gconstpointer a, gconstpointer b) { const ProcessInfo *pa = (const ProcessInfo*)a; const ProcessInfo *pb = (const ProcessInfo*)b; - + if(pa->pid != pb->pid) return 0; @@ -307,7 +308,7 @@ ProcessList *processlist_construct(void) GTK_SORT_ASCENDING); process_list->process_hash = g_hash_table_new_full( - hash_fct, equ_fct, + process_list_hash_fct, process_list_equ_fct, destroy_hash_key, destroy_hash_data ); @@ -489,8 +490,11 @@ int processlist_add( ProcessList *process_list, * overriden by the new state before anything is drawn. */ hashed_process_data->x.over = 0; + hashed_process_data->x.over_used = FALSE; hashed_process_data->x.middle = 0; + hashed_process_data->x.middle_used = FALSE; hashed_process_data->x.under = 0; + hashed_process_data->x.under_used = FALSE; /* Add a new row to the model */ gtk_list_store_append ( process_list->list_store, @@ -541,7 +545,10 @@ int processlist_remove( ProcessList *process_list, GtkTreeIter iter; Process_Info.pid = pid; - Process_Info.cpu = cpu; + if(pid == 0) + Process_Info.cpu = cpu; + else + Process_Info.cpu = 0; Process_Info.birth = *birth; Process_Info.trace_num = trace_num; @@ -587,7 +594,10 @@ __inline gint processlist_get_process_pixels( ProcessList *process_list, HashedProcessData *hashed_process_data = NULL; Process_Info.pid = pid; - Process_Info.cpu = cpu; + if(pid == 0) + Process_Info.cpu = cpu; + else + Process_Info.cpu = 0; Process_Info.birth = *birth; Process_Info.trace_num = trace_num;