From: compudj Date: Thu, 26 Oct 2006 22:00:38 +0000 (+0000) Subject: fix control flow with filter by cpu X-Git-Tag: v0.12.20~1276 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b6ef18af7254dcb81d4385db8f107721f769f7e5;p=lttv.git fix control flow with filter by cpu git-svn-id: http://ltt.polymtl.ca/svn@2213 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/configure.in b/ltt/branches/poly/configure.in index ab528342..c83871ec 100644 --- a/ltt/branches/poly/configure.in +++ b/ltt/branches/poly/configure.in @@ -23,7 +23,7 @@ AC_PREREQ(2.57) AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) #AC_WITH_LTDL # not needed ? -AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.66-12102006) +AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.67-26102006) AM_CONFIG_HEADER(config.h) AM_PROG_LIBTOOL diff --git a/ltt/branches/poly/lttv/lttv/filter.c b/ltt/branches/poly/lttv/lttv/filter.c index 8ebeb1d6..b8eb2ad6 100644 --- a/ltt/branches/poly/lttv/lttv/filter.c +++ b/ltt/branches/poly/lttv/lttv/filter.c @@ -1833,7 +1833,9 @@ lttv_filter_tree_parse( const LttEvent* event, const LttTracefile* tracefile, const LttTrace* trace, - const LttvTracefileContext* context + const LttvTracefileContext* context, + const LttvProcessState* state, + const LttvTraceContext* tc /*,...*/) { @@ -1874,18 +1876,24 @@ lttv_filter_tree_parse( gboolean lresult = FALSE, rresult = FALSE; - LttvProcessState* state; - - LttvTraceState *ts = (LttvTraceState*)context->t_context; + LttvTraceState *ts; LttvTracefileState *tfs = (LttvTracefileState*)context; - guint cpu = tfs->cpu; - state = ts->running_process[cpu]; + if(tc) + ts = (LttvTraceState*)tc; + else if(context) + ts = (LttvTraceState*)context->t_context; + + if(tfs) { + guint cpu = tfs->cpu; + if(ts) + state = ts->running_process[cpu]; + } /* * Parse left branch */ if(t->left == LTTV_TREE_NODE) { - lresult = lttv_filter_tree_parse(t->l_child.t,event,tracefile,trace,context); + lresult = lttv_filter_tree_parse(t->l_child.t,event,tracefile,trace,context,NULL,NULL); } else if(t->left == LTTV_TREE_LEAF) { lresult = lttv_filter_tree_parse_branch(t->l_child.leaf,event,tracefile,trace,state,context); @@ -1902,7 +1910,7 @@ lttv_filter_tree_parse( * Parse right branch */ if(t->right == LTTV_TREE_NODE) { - rresult = lttv_filter_tree_parse(t->r_child.t,event,tracefile,trace,context); + rresult = lttv_filter_tree_parse(t->r_child.t,event,tracefile,trace,context,NULL,NULL); } else if(t->right == LTTV_TREE_LEAF) { rresult = lttv_filter_tree_parse_branch(t->r_child.leaf,event,tracefile,trace,state,context); diff --git a/ltt/branches/poly/lttv/lttv/filter.h b/ltt/branches/poly/lttv/lttv/filter.h index b809f5a0..5d2f91c4 100644 --- a/ltt/branches/poly/lttv/lttv/filter.h +++ b/ltt/branches/poly/lttv/lttv/filter.h @@ -341,7 +341,9 @@ gboolean lttv_filter_tree_parse( const LttEvent* event, const LttTracefile* tracefile, const LttTrace* trace, - const LttvTracefileContext* context); + const LttvTracefileContext* context, + const LttvProcessState* pstate, + const LttvTraceContext* tc); gboolean lttv_filter_tree_parse_branch( const LttvSimpleExpression* se, diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index ca7f4ea4..1886d39f 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -1362,7 +1362,7 @@ static gint seek_back_event_hook(void *hook_data, void* call_data) ltt_tracefile_get_event(tfc->tf), tfc->tf, tfc->t_context->t, - tfc)) { + tfc,NULL,NULL)) { return FALSE; } if(sd->filter2 != NULL && sd->filter2->head != NULL && @@ -1370,7 +1370,7 @@ static gint seek_back_event_hook(void *hook_data, void* call_data) ltt_tracefile_get_event(tfc->tf), tfc->tf, tfc->t_context->t, - tfc)) { + tfc,NULL,NULL)) { return FALSE; } if(sd->filter3 != NULL && sd->filter3->head != NULL && @@ -1378,7 +1378,7 @@ static gint seek_back_event_hook(void *hook_data, void* call_data) ltt_tracefile_get_event(tfc->tf), tfc->tf, tfc->t_context->t, - tfc)) { + tfc,NULL,NULL)) { return FALSE; } @@ -1586,7 +1586,7 @@ static gint seek_forward_event_hook(void *hook_data, void* call_data) ltt_tracefile_get_event(tfc->tf), tfc->tf, tfc->t_context->t, - tfc)) { + tfc,NULL,NULL)) { return FALSE; } if(sd->filter2 != NULL && sd->filter2->head != NULL && @@ -1594,7 +1594,7 @@ static gint seek_forward_event_hook(void *hook_data, void* call_data) ltt_tracefile_get_event(tfc->tf), tfc->tf, tfc->t_context->t, - tfc)) { + tfc,NULL,NULL)) { return FALSE; } if(sd->filter3 != NULL && sd->filter3->head != NULL && @@ -1602,7 +1602,7 @@ static gint seek_forward_event_hook(void *hook_data, void* call_data) ltt_tracefile_get_event(tfc->tf), tfc->tf, tfc->t_context->t, - tfc)) { + tfc,NULL,NULL)) { return FALSE; } diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c index b7150cfc..c30ed2ae 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c @@ -370,7 +370,7 @@ int before_schedchange_hook(void *hook_data, void *call_data) tfc->target_pid = pid_out; if(!filter || !filter->head || lttv_filter_tree_parse(filter->head,e,tfc->tf, - tfc->t_context->t,tfc)) { + tfc->t_context->t,tfc,NULL,NULL)) { /* For the pid_out */ /* First, check if the current process is in the state computation * process list. If it is there, that means we must add it right now and @@ -535,7 +535,7 @@ int before_schedchange_hook(void *hook_data, void *call_data) tfc->target_pid = pid_in; if(!filter || !filter->head || lttv_filter_tree_parse(filter->head,e,tfc->tf, - tfc->t_context->t,tfc)) { + tfc->t_context->t,tfc,NULL,NULL)) { /* For the pid_in */ /* First, check if the current process is in the state computation * process list. If it is there, that means we must add it right now and @@ -754,7 +754,7 @@ int after_schedchange_hook(void *hook_data, void *call_data) 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)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; LttTime evtime = ltt_event_time(e); @@ -889,7 +889,7 @@ int before_execmode_hook(void *hook_data, void *call_data) 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)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; LttTime evtime = ltt_event_time(e); @@ -1093,7 +1093,7 @@ int before_process_exit_hook(void *hook_data, void *call_data) 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)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; LttTime evtime = ltt_event_time(e); @@ -1291,7 +1291,7 @@ int before_process_release_hook(void *hook_data, void *call_data) 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)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; LttTime evtime = ltt_event_time(e); @@ -1493,7 +1493,7 @@ int after_process_fork_hook(void *hook_data, void *call_data) 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)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; LttTime evtime = ltt_event_time(e); @@ -1627,7 +1627,7 @@ int after_process_exit_hook(void *hook_data, void *call_data) 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)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; LttTime evtime = ltt_event_time(e); @@ -1737,7 +1737,7 @@ int after_fs_exec_hook(void *hook_data, void *call_data) 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)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; guint cpu = tfs->cpu; @@ -1818,7 +1818,7 @@ int after_user_generic_thread_brand_hook(void *hook_data, void *call_data) 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)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; guint cpu = tfs->cpu; @@ -1910,7 +1910,7 @@ int after_event_enum_process_hook(void *hook_data, void *call_data) 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)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; LttTime evtime = ltt_event_time(e); @@ -2434,6 +2434,12 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data) if(unlikely(process != NULL)) { + LttvFilter *filter = control_flow_data->filter; + if(filter != NULL && filter->head != NULL) + if(!lttv_filter_tree_parse(filter->head,NULL,NULL, + tc->t,NULL,process,tc)) + return FALSE; + /* Only draw for processes that are currently in the trace states */ ProcessList *process_list = control_flow_data->process_list; @@ -2702,7 +2708,7 @@ int before_statedump_end(void *hook_data, void *call_data) 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)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; LttTime evtime = ltt_event_time(e); @@ -2740,5 +2746,3 @@ int before_statedump_end(void *hook_data, void *call_data) return 0; } - - diff --git a/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c b/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c index 5350ab45..9a6bca0f 100644 --- a/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c +++ b/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c @@ -1566,13 +1566,13 @@ int event_hook(void *hook_data, void *call_data) LttvFilter *filter = event_viewer_data->main_win_filter; if(filter != NULL && filter->head != NULL) if(!lttv_filter_tree_parse(filter->head,e,tfc->tf, - tfc->t_context->t,tfc)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; filter = event_viewer_data->filter; if(filter != NULL && filter->head != NULL) if(!lttv_filter_tree_parse(filter->head,e,tfc->tf, - tfc->t_context->t,tfc)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; @@ -1666,13 +1666,13 @@ static int current_time_get_first_event_hook(void *hook_data, void *call_data) LttvFilter *filter = event_viewer_data->main_win_filter; if(filter != NULL && filter->head != NULL) if(!lttv_filter_tree_parse(filter->head,e,tfc->tf, - tfc->t_context->t,tfc)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; filter = event_viewer_data->filter; if(filter != NULL && filter->head != NULL) if(!lttv_filter_tree_parse(filter->head,e,tfc->tf, - tfc->t_context->t,tfc)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; lttv_traceset_context_position_save(tfc->t_context->ts_context, diff --git a/ltt/branches/poly/lttv/modules/gui/histogram/histoeventhooks.c b/ltt/branches/poly/lttv/modules/gui/histogram/histoeventhooks.c index b315a3a4..28d83583 100644 --- a/ltt/branches/poly/lttv/modules/gui/histogram/histoeventhooks.c +++ b/ltt/branches/poly/lttv/modules/gui/histogram/histoeventhooks.c @@ -341,7 +341,7 @@ int histo_count_event(void *hook_data, void *call_data){ LttvFilter *histo_filter = histocontrol_flow_data->histo_main_win_filter; if(histo_filter != NULL && histo_filter->head != NULL) if(!lttv_filter_tree_parse(histo_filter->head,e,tfc->tf, - tfc->t_context->t,tfc)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; TimeWindow time_window = lttvwindow_get_time_window(histocontrol_flow_data->tab); diff --git a/ltt/branches/poly/lttv/modules/text/textDump.c b/ltt/branches/poly/lttv/modules/text/textDump.c index 160c938b..421ff6f3 100644 --- a/ltt/branches/poly/lttv/modules/text/textDump.c +++ b/ltt/branches/poly/lttv/modules/text/textDump.c @@ -332,7 +332,7 @@ static int write_event_content(void *hook_data, void *call_data) */ if(filter->head != NULL) if(!lttv_filter_tree_parse(filter->head,e,tfc->tf, - tfc->t_context->t,tfc)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; lttv_event_to_string(e, a_string, TRUE, a_field_names, tfs);