X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fcontrolflow%2Feventhooks.c;h=db1604c447f76d02d94cbace3e06c81322eff30b;hb=ec7a5af61127aa50a1839eee5be99ce53494c57b;hp=34beb3d7bbaf19235f7569caad6bc3b67a010794;hpb=bcac2596f1d858b450b860762f3abde978e765e4;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 34beb3d7..db1604c4 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c @@ -78,7 +78,7 @@ #define MAX_PATH_LEN 256 -#define STATE_LINE_WIDTH 4 +#define STATE_LINE_WIDTH 6 #define COLLISION_POSITION(height) (((height - STATE_LINE_WIDTH)/2) -3) extern GSList *g_legend_list; @@ -266,6 +266,8 @@ static inline PropertiesLine prepare_s_e_line(LttvProcessState *process) prop_line.color = drawing_colors[COL_EXIT]; } else if(process->state->s == LTTV_STATE_UNNAMED) { prop_line.color = drawing_colors[COL_UNNAMED]; + } else if(process->state->s == LTTV_STATE_DEAD) { + prop_line.color = drawing_colors[COL_DEAD]; } else { g_critical("unknown state : %s", g_quark_to_string(process->state->s)); g_assert(FALSE); /* UNKNOWN STATE */ @@ -319,9 +321,11 @@ int before_schedchange_hook(void *hook_data, void *call_data) guint pid_out; guint pid_in; + guint state_out; { pid_out = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0)); pid_in = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1)); + state_out = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 2)); } tfc->target_pid = pid_out; @@ -397,7 +401,7 @@ int before_schedchange_hook(void *hook_data, void *call_data) #ifdef EXTRA_CHECK if(ltt_time_compare(evtime, time_window.start_time) == -1 || ltt_time_compare(evtime, time_window.end_time) == 1) - return; + return FALSE; #endif //EXTRA_CHECK Drawing_t *drawing = control_flow_data->drawing; guint width = drawing->width; @@ -422,7 +426,7 @@ int before_schedchange_hook(void *hook_data, void *call_data) #ifdef EXTRA_CHECK if(ltt_time_compare(evtime, time_window.start_time) == -1 || ltt_time_compare(evtime, time_window.end_time) == 1) - return; + return FALSE; #endif //EXTRA_CHECK Drawing_t *drawing = control_flow_data->drawing; guint width = drawing->width; @@ -561,7 +565,7 @@ int before_schedchange_hook(void *hook_data, void *call_data) #ifdef EXTRA_CHECK if(ltt_time_compare(evtime, time_window.start_time) == -1 || ltt_time_compare(evtime, time_window.end_time) == 1) - return; + return FALSE; #endif //EXTRA_CHECK Drawing_t *drawing = control_flow_data->drawing; guint width = drawing->width; @@ -586,7 +590,7 @@ int before_schedchange_hook(void *hook_data, void *call_data) #ifdef EXTRA_CHECK if(ltt_time_compare(evtime, time_window.start_time) == -1 || ltt_time_compare(evtime, time_window.end_time) == 1) - return; + return FALSE; #endif //EXTRA_CHECK Drawing_t *drawing = control_flow_data->drawing; guint width = drawing->width; @@ -709,11 +713,6 @@ int after_schedchange_hook(void *hook_data, void *call_data) e = ltt_tracefile_get_event(tfc->tf); LttvFilter *filter = control_flow_data->filter; - if(filter != NULL && filter->head != NULL) - if(!lttv_filter_tree_parse(filter->head,e,tfc->tf, - tfc->t_context->t,tfc,NULL,NULL)) - return FALSE; - LttTime evtime = ltt_event_time(e); /* Add process to process list (if not present) */ @@ -731,79 +730,84 @@ int after_schedchange_hook(void *hook_data, void *call_data) pid_in = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1)); } - - /* Find process pid_in in the list... */ - //process_in = lttv_state_find_process(ts, ANY_CPU, pid_in); - //process_in = tfs->process; - guint cpu = tfs->cpu; - guint trace_num = ts->parent.index; - process_in = ts->running_process[cpu]; - /* It should exist, because we are after the state update. */ + tfc->target_pid = pid_in; + if(!filter || !filter->head || + lttv_filter_tree_parse(filter->head,e,tfc->tf, + tfc->t_context->t,tfc,NULL,NULL)) { + /* Find process pid_in in the list... */ + //process_in = lttv_state_find_process(ts, ANY_CPU, pid_in); + //process_in = tfs->process; + guint cpu = tfs->cpu; + guint trace_num = ts->parent.index; + process_in = ts->running_process[cpu]; + /* It should exist, because we are after the state update. */ #ifdef EXTRA_CHECK - g_assert(process_in != NULL); + g_assert(process_in != NULL); #endif //EXTRA_CHECK - birth = process_in->creation_time; - - hashed_process_data_in = processlist_get_process_data(process_list, + birth = process_in->creation_time; + + hashed_process_data_in = processlist_get_process_data(process_list, + pid_in, + process_in->cpu, + &birth, + trace_num); + if(hashed_process_data_in == NULL) + { + g_assert(pid_in == 0 || pid_in != process_in->ppid); + ProcessInfo *process_info; + Drawing_t *drawing = control_flow_data->drawing; + /* Process not present */ + processlist_add(process_list, + drawing, pid_in, + process_in->tgid, process_in->cpu, + process_in->ppid, &birth, - trace_num); - if(hashed_process_data_in == NULL) - { - g_assert(pid_in == 0 || pid_in != process_in->ppid); - ProcessInfo *process_info; - Drawing_t *drawing = control_flow_data->drawing; - /* Process not present */ - processlist_add(process_list, - drawing, - pid_in, - process_in->tgid, - process_in->cpu, - process_in->ppid, - &birth, - trace_num, - process_in->name, - process_in->brand, - &pl_height, - &process_info, - &hashed_process_data_in); - gtk_widget_set_size_request(drawing->drawing_area, - -1, - pl_height); - gtk_widget_queue_draw(drawing->drawing_area); - } - /* Set the current process */ - process_list->current_hash_data[trace_num][process_in->cpu] = - hashed_process_data_in; - - if(ltt_time_compare(hashed_process_data_in->next_good_time, - evtime) <= 0) - { - TimeWindow time_window = - lttvwindow_get_time_window(control_flow_data->tab); - + trace_num, + process_in->name, + process_in->brand, + &pl_height, + &process_info, + &hashed_process_data_in); + gtk_widget_set_size_request(drawing->drawing_area, + -1, + pl_height); + gtk_widget_queue_draw(drawing->drawing_area); + } + /* Set the current process */ + process_list->current_hash_data[trace_num][process_in->cpu] = + hashed_process_data_in; + + if(ltt_time_compare(hashed_process_data_in->next_good_time, + evtime) <= 0) + { + TimeWindow time_window = + lttvwindow_get_time_window(control_flow_data->tab); + #ifdef EXTRA_CHECK - if(ltt_time_compare(evtime, time_window.start_time) == -1 - || ltt_time_compare(evtime, time_window.end_time) == 1) - return; + if(ltt_time_compare(evtime, time_window.start_time) == -1 + || ltt_time_compare(evtime, time_window.end_time) == 1) + return FALSE; #endif //EXTRA_CHECK - Drawing_t *drawing = control_flow_data->drawing; - guint width = drawing->width; - guint new_x; - - convert_time_to_pixels( - time_window, - evtime, - width, - &new_x); - - if(hashed_process_data_in->x.middle != new_x) { - hashed_process_data_in->x.middle = new_x; - hashed_process_data_in->x.middle_used = FALSE; - hashed_process_data_in->x.middle_marked = FALSE; + Drawing_t *drawing = control_flow_data->drawing; + guint width = drawing->width; + guint new_x; + + convert_time_to_pixels( + time_window, + evtime, + width, + &new_x); + + if(hashed_process_data_in->x.middle != new_x) { + hashed_process_data_in->x.middle = new_x; + hashed_process_data_in->x.middle_used = FALSE; + hashed_process_data_in->x.middle_marked = FALSE; + } } } + return 0; } @@ -924,7 +928,7 @@ int before_execmode_hook(void *hook_data, void *call_data) #ifdef EXTRA_CHECK if(ltt_time_compare(evtime, time_window.start_time) == -1 || ltt_time_compare(evtime, time_window.end_time) == 1) - return; + return FALSE; #endif //EXTRA_CHECK Drawing_t *drawing = control_flow_data->drawing; guint width = drawing->width; @@ -950,7 +954,7 @@ int before_execmode_hook(void *hook_data, void *call_data) #ifdef EXTRA_CHECK if(ltt_time_compare(evtime, time_window.start_time) == -1 || ltt_time_compare(evtime, time_window.end_time) == 1) - return; + return FALSE; #endif //EXTRA_CHECK Drawing_t *drawing = control_flow_data->drawing; guint width = drawing->width; @@ -1119,7 +1123,7 @@ int before_process_exit_hook(void *hook_data, void *call_data) #ifdef EXTRA_CHECK if(ltt_time_compare(evtime, time_window.start_time) == -1 || ltt_time_compare(evtime, time_window.end_time) == 1) - return; + return FALSE; #endif //EXTRA_CHECK Drawing_t *drawing = control_flow_data->drawing; guint width = drawing->width; @@ -1145,7 +1149,7 @@ int before_process_exit_hook(void *hook_data, void *call_data) #ifdef EXTRA_CHECK if(ltt_time_compare(evtime, time_window.start_time) == -1 || ltt_time_compare(evtime, time_window.end_time) == 1) - return; + return FALSE; #endif //EXTRA_CHECK Drawing_t *drawing = control_flow_data->drawing; guint width = drawing->width; @@ -1283,29 +1287,11 @@ int before_process_release_hook(void *hook_data, void *call_data) &birth, trace_num); if(unlikely(hashed_process_data == NULL)) - { - g_assert(pid == 0 || pid != process->ppid); - /* Process not present */ - Drawing_t *drawing = control_flow_data->drawing; - ProcessInfo *process_info; - processlist_add(process_list, - drawing, - pid, - process->tgid, - process->cpu, - process->ppid, - &birth, - trace_num, - process->name, - process->brand, - &pl_height, - &process_info, - &hashed_process_data); - gtk_widget_set_size_request(drawing->drawing_area, - -1, - pl_height); - gtk_widget_queue_draw(drawing->drawing_area); - } + /* + * Process already been scheduled out EXIT_DEAD, not in the process list + * anymore. Just return. + */ + return FALSE; /* Now, the process is in the state hash and our own process hash. * We definitely can draw the items related to the ending state. @@ -1321,7 +1307,7 @@ int before_process_release_hook(void *hook_data, void *call_data) #ifdef EXTRA_CHECK if(ltt_time_compare(evtime, time_window.start_time) == -1 || ltt_time_compare(evtime, time_window.end_time) == 1) - return; + return FALSE; #endif //EXTRA_CHECK Drawing_t *drawing = control_flow_data->drawing; guint width = drawing->width; @@ -1347,7 +1333,7 @@ int before_process_release_hook(void *hook_data, void *call_data) #ifdef EXTRA_CHECK if(ltt_time_compare(evtime, time_window.start_time) == -1 || ltt_time_compare(evtime, time_window.end_time) == 1) - return; + return FALSE; #endif //EXTRA_CHECK Drawing_t *drawing = control_flow_data->drawing; guint width = drawing->width; @@ -1523,7 +1509,7 @@ int after_process_fork_hook(void *hook_data, void *call_data) #ifdef EXTRA_CHECK if(ltt_time_compare(evtime, time_window.start_time) == -1 || ltt_time_compare(evtime, time_window.end_time) == 1) - return; + return FALSE; #endif //EXTRA_CHECK Drawing_t *drawing = control_flow_data->drawing; guint width = drawing->width; @@ -1550,7 +1536,7 @@ int after_process_fork_hook(void *hook_data, void *call_data) hashed_process_data_child->x.under_marked = FALSE; } } - return 0; + return FALSE; } @@ -1654,7 +1640,7 @@ int after_process_exit_hook(void *hook_data, void *call_data) #ifdef EXTRA_CHECK if(ltt_time_compare(evtime, time_window.start_time) == -1 || ltt_time_compare(evtime, time_window.end_time) == 1) - return; + return FALSE; #endif //EXTRA_CHECK Drawing_t *drawing = control_flow_data->drawing; guint width = drawing->width; @@ -1671,7 +1657,7 @@ int after_process_exit_hook(void *hook_data, void *call_data) } } - return 0; + return FALSE; }