guint i, nb_cpus;
LttvTracefileState *tfcs;
+
+ LttTime start_time, end_time;
/* Free the process tables */
if(self->processes != NULL) lttv_state_free_process_table(self->processes);
//g_tree_destroy(self->parent.ts_context->pqueue);
//self->parent.ts_context->pqueue = g_tree_new(compare_tracefile);
+ ltt_trace_time_span_get(self->parent.t, &start_time, &end_time);
//lttv_process_trace_seek_time(&self->parent, ltt_time_zero);
/* Put the per cpu running_process to beginning state : process 0. */
for(i=0; i< nb_cpus; i++) {
self->running_process[i] = lttv_state_create_process(self, NULL, i, 0,
- LTTV_STATE_UNNAMED, <t_time_zero);
+ LTTV_STATE_UNNAMED, &start_time);
self->running_process[i]->state->s = LTTV_STATE_RUN;
self->running_process[i]->cpu = i;
}
return FALSE;
}
+gboolean before_enum_process_state(void *hook_data, void *call_data)
+{
+ mode_end((LttvTracefileStats *)call_data);
+ after_mode_end((LttvTracefileStats *)call_data);
+ mode_change((LttvTracefileStats *)call_data);
+ return FALSE;
+}
+
+gboolean after_enum_process_state(void *hook_data, void *call_data)
+{
+ update_event_tree((LttvTracefileStats *)call_data);
+ return FALSE;
+}
+
gboolean process_free(void *hook_data, void *call_data)
{
return FALSE;
/* Find the eventtype id for the following events and register the
associated by id hooks. */
- hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 11);
- g_array_set_size(hooks, 11);
- hn=0;
+ hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 12);
+ g_array_set_size(hooks, 12);
+ hn=0;
ret = lttv_trace_find_hook(ts->parent.parent.t,
LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY,
before_function_exit, NULL,
&g_array_index(hooks, LttvTraceHook, hn++));
if(ret) hn--;
-
+
+ /* statedump-related hooks */
+ ret = lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_STATEDUMP, LTT_EVENT_ENUM_PROCESS_STATE,
+ LTT_FIELD_PID, LTT_FIELD_PARENT_PID, LTT_FIELD_NAME,
+ before_enum_process_state, NULL,
+ &g_array_index(hooks, LttvTraceHook, hn++));
+ if(ret) hn--;
+
g_array_set_size(hooks, hn);
before_hooks = hooks;
- hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 14);
- g_array_set_size(hooks, 14);
- hn=0;
+ hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 15);
+ g_array_set_size(hooks, 15);
+ hn=0;
ret = lttv_trace_find_hook(ts->parent.parent.t,
LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY,
after_function_exit, NULL,
&g_array_index(hooks, LttvTraceHook, hn++));
if(ret) hn--;
-
+
+ /* statedump-related hooks */
+ ret = lttv_trace_find_hook(ts->parent.parent.t,
+ LTT_FACILITY_STATEDUMP, LTT_EVENT_ENUM_PROCESS_STATE,
+ LTT_FIELD_PID, LTT_FIELD_PARENT_PID, LTT_FIELD_NAME,
+ after_enum_process_state, NULL,
+ &g_array_index(hooks, LttvTraceHook, hn++));
+ if(ret) hn--;
+
g_array_set_size(hooks, hn);
after_hooks = hooks;