self->running_process[i]->cpu = i;
/* reset cpu states */
- if(self->cpu_states[i].mode_stack->len > 0)
+ if(self->cpu_states[i].mode_stack->len > 0) {
g_array_remove_range(self->cpu_states[i].mode_stack, 0, self->cpu_states[i].mode_stack->len);
+ self->cpu_states[i].last_irq = -1;
+ self->cpu_states[i].last_soft_irq = -1;
+ self->cpu_states[i].last_trap = -1;
+ }
}
/* reset irq states */
tcs->cpu_states = g_new(LttvCPUState, nb_cpu);
for(j = 0; j<nb_cpu; j++) {
tcs->cpu_states[j].mode_stack = g_array_new(FALSE, FALSE, sizeof(LttvCPUMode));
+ tcs->cpu_states[j].last_irq = -1;
+ tcs->cpu_states[j].last_soft_irq = -1;
+ tcs->cpu_states[j].last_trap = -1;
g_assert(tcs->cpu_states[j].mode_stack != NULL);
}
for(i=0; i<n; i++) {
retval[i].mode_stack = g_array_new(FALSE, FALSE, sizeof(LttvCPUMode));
retval[i].last_irq = states[i].last_irq;
+ retval[i].last_soft_irq = states[i].last_soft_irq;
+ retval[i].last_trap = states[i].last_trap;
g_array_set_size(retval[i].mode_stack, states[i].mode_stack->len);
for(j=0; j<states[i].mode_stack->len; j++) {
g_array_index(retval[i].mode_stack, GQuark, j) = g_array_index(states[i].mode_stack, GQuark, j);
hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 1);
if(!lttv_trace_find_hook(tcs->parent.t,
- LTT_FACILITY_KERNEL_ARCH,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_SYSCALL_ENTRY,
FIELD_ARRAY(LTT_FIELD_SYSCALL_ID),
NULL, NULL, &hooks)) {
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttvTraceState *ts = (LttvTraceState *)s->parent.t_context;
- guint trap = s->cpu_state->last_trap;
+ gint trap = s->cpu_state->last_trap;
pop_state(s, LTTV_STATE_TRAP);
cpu_pop_mode(s->cpu_state);
/* update trap status */
- if(ts->trap_states[trap].running)
- ts->trap_states[trap].running--;
+ if (trap != -1)
+ if(ts->trap_states[trap].running)
+ ts->trap_states[trap].running--;
return FALSE;
}
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttvTraceState *ts = (LttvTraceState *)s->parent.t_context;
- guint softirq = s->cpu_state->last_soft_irq;
+ gint softirq = s->cpu_state->last_soft_irq;
pop_state(s, LTTV_STATE_SOFT_IRQ);
/* update softirq status */
- if(ts->soft_irq_states[softirq].running)
- ts->soft_irq_states[softirq].running--;
+ if (softirq != -1)
+ if(ts->soft_irq_states[softirq].running)
+ ts->soft_irq_states[softirq].running--;
/* update cpu status */
cpu_pop_mode(s->cpu_state);
cpu_pop_mode(s->cpu_state);
/* update irq status */
- irq_pop_mode(&ts->irq_states[s->cpu_state->last_irq]);
+ if (s->cpu_state->last_irq != -1)
+ irq_pop_mode(&ts->irq_states[s->cpu_state->last_irq]);
return FALSE;
}
//hn = 0;
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL_ARCH,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_SYSCALL_ENTRY,
FIELD_ARRAY(LTT_FIELD_SYSCALL_ID),
syscall_entry, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL_ARCH,
+ LTT_FACILITY_KERNEL,
LTT_EVENT_SYSCALL_EXIT,
NULL,
syscall_exit, NULL, &hooks);