update compat
[lttv.git] / ltt / branches / poly / lttv / lttv / state.c
index b15c616847d77276471919f5f1808a1eab055ac7..952f6cde9bf866dfc8b349e17d533744b9183e65 100644 (file)
@@ -1155,7 +1155,7 @@ static void lttv_state_free_cpu_states(LttvCPUState *states, guint n)
   guint i;
 
   for(i=0; i<n; i++) {
-    g_array_free(states[i].mode_stack, FALSE);
+    g_array_free(states[i].mode_stack, TRUE);
   }
 
   g_free(states);
@@ -1184,7 +1184,7 @@ static void lttv_state_free_irq_states(LttvIRQState *states, guint n)
   guint i;
 
   for(i=0; i<n; i++) {
-    g_array_free(states[i].mode_stack, FALSE);
+    g_array_free(states[i].mode_stack, TRUE);
   }
 
   g_free(states);
@@ -1221,7 +1221,7 @@ static LttvBdevState *bdevstate_new(void)
 
 static void bdevstate_free(LttvBdevState *bds)
 {
-  g_array_free(bds->mode_stack, FALSE);
+  g_array_free(bds->mode_stack, TRUE);
   g_free(bds);
 }
 
@@ -2139,7 +2139,7 @@ lttv_state_find_process_or_create(LttvTraceState *ts, guint cpu, guint pid,
  * the parent waits for its child terminaison, but may also happen in special
  * cases in the child's exit : when the parent ignores its children SIGCCHLD or
  * has the flag SA_NOCLDWAIT. It can also happen when the child is part
- * of a killed thread ground, but isn't the leader.
+ * of a killed thread group, but isn't the leader.
  */
 static void exit_process(LttvTracefileState *tfs, LttvProcessState *process) 
 {
@@ -2565,9 +2565,18 @@ static gboolean schedchange(void *hook_data, void *call_data)
 
   /* update cpu status */
   if(pid_in == 0)
+    /* going to idle task */
     cpu_set_base_mode(s->cpu_state, LTTV_CPU_IDLE);
-  else
+  else {
+    /* scheduling a real task.
+     * we must be careful here:
+     * if we just schedule()'ed to a process that is
+     * in a trap, we must put the cpu in trap mode
+     */
     cpu_set_base_mode(s->cpu_state, LTTV_CPU_BUSY);
+    if(process->state->t == LTTV_STATE_TRAP)
+      cpu_push_mode(s->cpu_state, LTTV_CPU_TRAP);
+  }
 
   return FALSE;
 }
This page took 0.027435 seconds and 4 git commands to generate.