filtering by pid in cfv
[lttv.git] / ltt / branches / poly / lttv / modules / gui / controlflow / eventhooks.c
index 7e2cc1d062479abb7bfd94b07a5cbf3bbd884e88..767cc2137b81a39ad1bcd46c56427f0c3bb72e7e 100644 (file)
@@ -345,8 +345,10 @@ int before_schedchange_hook(void *hook_data, void *call_data)
 
   LttEvent *e;
   e = ltt_tracefile_get_event(tfc->tf);
+  gint target_pid_saved = tfc->target_pid;
 
   LttTime evtime = ltt_event_time(e);
+  LttvFilter *filter = control_flow_data->filter;
 
   /* we are in a schedchange, before the state update. We must draw the
    * items corresponding to the state before it changes : now is the right
@@ -360,7 +362,10 @@ int before_schedchange_hook(void *hook_data, void *call_data)
     pid_in = ltt_event_get_long_unsigned(e, thf->f2);
   }
   
-  { 
+  tfc->target_pid = pid_out;
+  if(!filter || !filter->head ||
+    lttv_filter_tree_parse(filter->head,e,tfc->tf,
+          tfc->t_context->t,tfc)) { 
     /* 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
@@ -521,7 +526,10 @@ 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)) { 
     /* 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
@@ -683,6 +691,7 @@ int before_schedchange_hook(void *hook_data, void *call_data)
     } else
       g_warning("Cannot find pin_in in schedchange %u", pid_in);
   }
+  tfc->target_pid = target_pid_saved;
   return 0;
 
 
@@ -735,6 +744,12 @@ int after_schedchange_hook(void *hook_data, void *call_data)
   LttEvent *e;
   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))
+      return FALSE;
+
   LttTime evtime = ltt_event_time(e);
 
   /* Add process to process list (if not present) */
@@ -863,6 +878,12 @@ int before_execmode_hook(void *hook_data, void *call_data)
   LttEvent *e;
   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))
+      return FALSE;
+
   LttTime evtime = ltt_event_time(e);
 
   /* we are in a execmode, before the state update. We must draw the
@@ -1060,6 +1081,12 @@ int before_process_exit_hook(void *hook_data, void *call_data)
   LttEvent *e;
   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))
+      return FALSE;
+
   LttTime evtime = ltt_event_time(e);
 
   /* Add process to process list (if not present) */
@@ -1251,6 +1278,12 @@ int before_process_release_hook(void *hook_data, void *call_data)
   LttEvent *e;
   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))
+      return FALSE;
+
   LttTime evtime = ltt_event_time(e);
 
 
@@ -1446,6 +1479,12 @@ int after_process_fork_hook(void *hook_data, void *call_data)
   LttEvent *e;
   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))
+      return FALSE;
+
   LttTime evtime = ltt_event_time(e);
 
   guint child_pid;
@@ -1573,6 +1612,12 @@ int after_process_exit_hook(void *hook_data, void *call_data)
   LttEvent *e;
   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))
+      return FALSE;
+
   LttTime evtime = ltt_event_time(e);
 
   /* Add process to process list (if not present) */
@@ -1673,6 +1718,15 @@ int after_fs_exec_hook(void *hook_data, void *call_data)
 
   LttvTraceState *ts = (LttvTraceState *)tfc->t_context;
 
+  LttEvent *e;
+  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))
+      return FALSE;
+
   guint cpu = tfs->cpu;
   LttvProcessState *process = ts->running_process[cpu];
   g_assert(process != NULL);
@@ -1744,6 +1798,15 @@ int after_user_generic_thread_brand_hook(void *hook_data, void *call_data)
 
   LttvTraceState *ts = (LttvTraceState *)tfc->t_context;
 
+  LttEvent *e;
+  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))
+      return FALSE;
+
   guint cpu = tfs->cpu;
   LttvProcessState *process = ts->running_process[cpu];
   g_assert(process != NULL);
@@ -1829,6 +1892,12 @@ int after_event_enum_process_hook(void *hook_data, void *call_data)
   LttEvent *e;
   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))
+      return FALSE;
+
   LttTime evtime = ltt_event_time(e);
 
   /* Add process to process list (if not present) */
This page took 0.024045 seconds and 4 git commands to generate.