X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fcontrolflow%2Feventhooks.c;h=b72200a7d4ee76c83ec0cd0c27e647e36c183dc8;hb=0828099d440cd8d5a4833760ee8b1e43cf090ce2;hp=2b7efbc927c9797cb945c9740f0bab855b49dc6c;hpb=d9267eec3ce20e65ce581ba46f3b2115f55cb297;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c index 2b7efbc9..b72200a7 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c @@ -224,9 +224,9 @@ void request_background_data(ControlFlowData *control_flow_data) * @return The widget created. */ GtkWidget * -h_guicontrolflow(Tab *tab, LttvTracesetSelector * s, char * key) +h_guicontrolflow(Tab *tab) { - g_info("h_guicontrolflow, %p, %p, %s", tab, s, key); + g_info("h_guicontrolflow, %p", tab); ControlFlowData *control_flow_data = guicontrolflow() ; control_flow_data->tab = tab; @@ -283,8 +283,8 @@ static __inline PropertiesLine prepare_line(LttvProcessState *process) prop_line.color = drawing_colors[COL_WAIT_FORK]; else if(process->state->s == LTTV_STATE_WAIT_CPU) prop_line.color = drawing_colors[COL_WAIT_CPU]; - else if(process->state->s == LTTV_STATE_EXIT) - prop_line.color = drawing_colors[COL_EXIT]; + else if(process->state->s == LTTV_STATE_ZOMBIE) + prop_line.color = drawing_colors[COL_ZOMBIE]; else if(process->state->s == LTTV_STATE_WAIT) prop_line.color = drawing_colors[COL_WAIT]; else if(process->state->s == LTTV_STATE_RUN) @@ -397,6 +397,12 @@ int draw_before_hook(void *hook_data, void *call_data) &height, &hashed_process_data) == 1) { + g_assert(!(process->pid == 432 && + ltt_time_compare(process->creation_time, + ltt_time_zero)==0)); + + g_assert(!(process->pid == 432 && + process->creation_time.tv_nsec == 47797905)); /* Process not present */ processlist_add(process_list, pid_out, @@ -835,7 +841,7 @@ int draw_before_hook(void *hook_data, void *call_data) prop_text_out.foreground->green = 0xffff; prop_text_out.foreground->blue = 0x0000; } - else if(process_out->state->s == LTTV_STATE_EXIT) + else if(process_out->state->s == LTTV_STATE_ZOMBIE) { prop_text_out.foreground->red = 0xffff; prop_text_out.foreground->green = 0x0000; @@ -868,7 +874,7 @@ int draw_before_hook(void *hook_data, void *call_data) prop_text_out.text = "WF->"; else if(process_out->state->s == LTTV_STATE_WAIT_CPU) prop_text_out.text = "WC->"; - else if(process_out->state->s == LTTV_STATE_EXIT) + else if(process_out->state->s == LTTV_STATE_ZOMBIE) prop_text_out.text = "E->"; else if(process_out->state->s == LTTV_STATE_WAIT) prop_text_out.text = "W->"; @@ -911,7 +917,7 @@ int draw_before_hook(void *hook_data, void *call_data) prop_line_out.color->green = 0xffff; prop_line_out.color->blue = 0x0000; } - else if(process_out->state->s == LTTV_STATE_EXIT) + else if(process_out->state->s == LTTV_STATE_ZOMBIE) { prop_line_out.color->red = 0xffff; prop_line_out.color->green = 0x0000; @@ -1059,7 +1065,7 @@ int draw_before_hook(void *hook_data, void *call_data) prop_text_in.foreground->green = 0xffff; prop_text_in.foreground->blue = 0x0000; } - else if(process_in->state->s == LTTV_STATE_EXIT) + else if(process_in->state->s == LTTV_STATE_ZOMBIE) { prop_text_in.foreground->red = 0xffff; prop_text_in.foreground->green = 0x0000; @@ -1093,7 +1099,7 @@ int draw_before_hook(void *hook_data, void *call_data) prop_text_in.text = "WF->"; else if(process_in->state->s == LTTV_STATE_WAIT_CPU) prop_text_in.text = "WC->"; - else if(process_in->state->s == LTTV_STATE_EXIT) + else if(process_in->state->s == LTTV_STATE_ZOMBIE) prop_text_in.text = "E->"; else if(process_in->state->s == LTTV_STATE_WAIT) prop_text_in.text = "W->"; @@ -1134,7 +1140,7 @@ int draw_before_hook(void *hook_data, void *call_data) prop_line_in.color->green = 0xffff; prop_line_in.color->blue = 0x0000; } - else if(process_in->state->s == LTTV_STATE_EXIT) + else if(process_in->state->s == LTTV_STATE_ZOMBIE) { prop_line_in.color->red = 0xffff; prop_line_in.color->green = 0x0000; @@ -1270,6 +1276,13 @@ int draw_after_hook(void *hook_data, void *call_data) &height, &hashed_process_data_in) == 1) { + g_assert(!(process_in->pid == 432 && + ltt_time_compare(process_in->creation_time, + ltt_time_zero)==0)); + + g_assert(!(process_in->pid == 432 && + process_in->creation_time.tv_nsec == 47797905)); + /* Process not present */ processlist_add(process_list, pid_in, @@ -1509,7 +1522,7 @@ int draw_after_hook(void *hook_data, void *call_data) prop_text_out.foreground->green = 0xffff; prop_text_out.foreground->blue = 0x0000; } - else if(process_out->state->s == LTTV_STATE_EXIT) + else if(process_out->state->s == LTTV_STATE_ZOMBIE) { prop_text_out.foreground->red = 0xffff; prop_text_out.foreground->green = 0x0000; @@ -1541,7 +1554,7 @@ int draw_after_hook(void *hook_data, void *call_data) prop_text_out.text = "WF"; else if(process_out->state->s == LTTV_STATE_WAIT_CPU) prop_text_out.text = "WC"; - else if(process_out->state->s == LTTV_STATE_EXIT) + else if(process_out->state->s == LTTV_STATE_ZOMBIE) prop_text_out.text = "E"; else if(process_out->state->s == LTTV_STATE_WAIT) prop_text_out.text = "W"; @@ -1650,7 +1663,7 @@ int draw_after_hook(void *hook_data, void *call_data) prop_text_in.foreground->green = 0xffff; prop_text_in.foreground->blue = 0x0000; } - else if(process_in->state->s == LTTV_STATE_EXIT) + else if(process_in->state->s == LTTV_STATE_ZOMBIE) { prop_text_in.foreground->red = 0xffff; prop_text_in.foreground->green = 0x0000; @@ -1683,7 +1696,7 @@ int draw_after_hook(void *hook_data, void *call_data) prop_text_in.text = "WF"; else if(process_in->state->s == LTTV_STATE_WAIT_CPU) prop_text_in.text = "WC"; - else if(process_in->state->s == LTTV_STATE_EXIT) + else if(process_in->state->s == LTTV_STATE_ZOMBIE) prop_text_in.text = "E"; else if(process_in->state->s == LTTV_STATE_WAIT) prop_text_in.text = "W"; @@ -2158,44 +2171,6 @@ typedef struct _ClosureData { } ClosureData; -/* find_process - * Input : A trace and a PID. - * - * - For each CPU of the trace - * - Search in trace states by PID and CPU key - * - For each ProcessState found - * - If state is not LTTV_STATE_WAIT - * - Then this process state is the current one for this PID. - * - Stop search. - * - If no ProcessState found, return NULL. - * - If all ProcessState were in LTTV_STATE_WAIT state, return one of - * them arbitrarily. - * Than means state is LTTV_STATE_WAIT, CPU unknown. - */ -static LttvProcessState *find_process(LttvTraceState *tstate, guint pid) -{ - guint cpu_num = ltt_trace_per_cpu_tracefile_number(tstate->parent.t); - GQuark cpu_name; - guint i; - - LttvProcessState *real_state = NULL; - - for(i=0;iparent.tracefiles[i])->cpu_name; - LttvProcessState *state = lttv_state_find_process_from_trace(tstate, - cpu_name, - pid); - - if(state != NULL) { - real_state = state; - if(state->state->s != LTTV_STATE_WAIT) - break; - } - } - return real_state; -} - - void draw_closure(gpointer key, gpointer value, gpointer user_data) { ProcessInfo *process_info = (ProcessInfo*)key; @@ -2231,11 +2206,14 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data) * be added after the state update. */ g_assert(lttv_traceset_number(tsc->ts) > 0); - LttvTraceState *trace_state = - (LttvTraceState*)tsc->traces[process_info->trace_num]; + /* tracefiles[0] is ok here, because we draw for every PID, and + * assume CPU 0 for PID 0 //FIXME */ + LttvTracefileState *tfs = + (LttvTracefileState*)tsc->traces[process_info->trace_num]->tracefiles[0]; LttvProcessState *process; - process = find_process(trace_state, process_info->pid); + process = lttv_state_find_process(tfs, + process_info->pid); if(process != NULL) {