g_hash_table_destroy(usertraces);
}
-
+gboolean rettrue(gpointer key, gpointer value, gpointer user_data)
+{
+ return TRUE;
+}
static void
restore_init_state(LttvTraceState *self)
/* reset bdev states */
g_hash_table_foreach(self->bdev_states, bdevstate_free_cb, NULL);
- g_hash_table_steal_all(self->bdev_states);
+ //g_hash_table_steal_all(self->bdev_states);
+ g_hash_table_foreach_steal(self->bdev_states, rettrue, NULL);
#if 0
nb_tracefile = self->parent.tracefiles->len;
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);
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);
static void bdevstate_free(LttvBdevState *bds)
{
- g_array_free(bds->mode_stack, FALSE);
+ g_array_free(bds->mode_stack, TRUE);
g_free(bds);
}
* 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)
{
process->state->change = s->parent.timestamp;
}
- if(state_out == 32 || state_out == 128)
+ if(state_out == 32 || state_out == 64)
exit_process(s, process); /* EXIT_DEAD || TASK_DEAD */
/* see sched.h for states */
}
/* 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;
}