guint process_hash(gconstpointer key)
{
- return ((const LttvProcessState *)key)->pid;
+ guint pid = ((const LttvProcessState *)key)->pid;
+ return (pid>>8 ^ pid>>4 ^ pid>>2 ^ pid) ;
}
{ 0, 0xFFFF, 0xFFFF, 0xFFFF } /* COL_MODE_UNKNOWN : white */
};
+/*
+RUN+USER MODE green
+RUN+SYSCALL
+RUN+TRAP
+RUN+IRQ
+WAIT+foncé
+WAIT CPU + WAIT FORK vert foncé ou jaune
+IRQ rouge
+TRAP: orange
+SYSCALL: bleu pâle
+ZOMBIE + WAIT EXIT
+*/
/*****************************************************************************
/* Add these hooks to each event_by_id hooks list */
-
/* add before */
for(k = 0 ; k < hooks->len/2 ; k++) {
hook = g_array_index(hooks, LttvTraceHook, k);
}
-static guint hash_fct(gconstpointer key)
+static guint process_list_hash_fct(gconstpointer key)
{
- return ((ProcessInfo*)key)->pid ^ ((ProcessInfo*)key)->cpu;
+ 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;
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
);