comment fork error
[lttv.git] / ltt / branches / poly / lttv / lttv / state.c
index 17c5906e508f74d086de1d125b1de1bbd489e188..9034cc0cd8614cf55dd6ccdb2db9e07e358229c5 100644 (file)
@@ -2314,6 +2314,7 @@ static gboolean syscall_exit(void *hook_data, void *call_data)
 static gboolean trap_entry(void *hook_data, void *call_data)
 {
   LttvTracefileState *s = (LttvTracefileState *)call_data;
+  LttvTraceState *ts = (LttvTraceState *)s->parent.t_context;
   LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
   LttvTraceHook *th = (LttvTraceHook *)hook_data;
   struct marker_field *f = lttv_trace_get_hook_field(th, 0);
@@ -2338,18 +2339,28 @@ static gboolean trap_entry(void *hook_data, void *call_data)
   /* update cpu status */
   cpu_push_mode(s->cpu_state, LTTV_CPU_TRAP);
 
+  /* update trap status */
+  s->cpu_state->last_trap = trap;
+  ts->trap_states[trap].running++;
+
   return FALSE;
 }
 
 static gboolean trap_exit(void *hook_data, void *call_data)
 {
   LttvTracefileState *s = (LttvTracefileState *)call_data;
+  LttvTraceState *ts = (LttvTraceState *)s->parent.t_context;
+  guint trap = s->cpu_state->last_trap;
 
   pop_state(s, LTTV_STATE_TRAP);
 
   /* update cpu status */
   cpu_pop_mode(s->cpu_state);
 
+  /* update trap status */
+  if(ts->trap_states[trap].running)
+    ts->trap_states[trap].running--;
+
   return FALSE;
 }
 
@@ -2758,8 +2769,9 @@ static gboolean process_fork(void *hook_data, void *call_data)
      *
      * Simply put a correct parent.
      */
-    g_assert(0); /* This is a problematic case : the process has been created
-                    before the fork event */
+    g_error("Process %u has been created before fork on cpu %u. Probably an unsynchronized TSC problem on the traced machine.", child_pid, cpu);
+    //g_assert(0); /* This is a problematic case : the process has been created
+    //                before the fork event */
     child_process->ppid = process->pid;
     child_process->tgid = child_tgid;
   }
This page took 0.026989 seconds and 4 git commands to generate.