fix control flow with filter by cpu
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 26 Oct 2006 22:00:38 +0000 (22:00 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 26 Oct 2006 22:00:38 +0000 (22:00 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2213 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/configure.in
ltt/branches/poly/lttv/lttv/filter.c
ltt/branches/poly/lttv/lttv/filter.h
ltt/branches/poly/lttv/lttv/tracecontext.c
ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c
ltt/branches/poly/lttv/modules/gui/detailedevents/events.c
ltt/branches/poly/lttv/modules/gui/histogram/histoeventhooks.c
ltt/branches/poly/lttv/modules/text/textDump.c

index ab528342621d94e2ffaa6a4b1e3f99b3858d1343..c83871ec11a09657df87614c85d3dedcd372c773 100644 (file)
@@ -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
 
index 8ebeb1d62a55b6b3777653eaa1c38767d6c1db1a..b8eb2ad63684ac25f6e4ba45b8c3c4eb75957b6e 100644 (file)
@@ -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);
index b809f5a0f705601aeebe65e6984a83affa0a515e..5d2f91c48ac0f0f2a834766ba4415a9b4c372935 100644 (file)
@@ -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,
index ca7f4ea414c9370b4d7e4a33cb541b1ea72c380c..1886d39f07bd7b35d71f7a95c95ade0b7fe46515 100644 (file)
@@ -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;
   }
 
index b7150cfc899812c16cf74ad0d46ee8a904bc4e83..c30ed2ae3c82a1555fc2056de1d651f1d4fc631e 100644 (file)
@@ -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;
 }
-
-
index 5350ab45115c6b3f25a8c8d486fc2092b1dda75c..9a6bca0fc135712938f7d35951b595ed7f26d1c6 100644 (file)
@@ -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, 
index b315a3a413d43e4cc27a9784f223fa17aec5665b..28d83583f0b651b3add57bfa363e4db853555694 100644 (file)
@@ -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);
index 160c938babfbf7c73d3e1596044f2219131efcc3..421ff6f3a2ab9be72a277048041775a9f5b974f5 100644 (file)
@@ -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);
This page took 0.031409 seconds and 4 git commands to generate.