//LttvTracefileState *tfcs;
- //LttTime start_time, end_time;
+ LttTime start_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);
- //TODO use babeltrace one.
- //ltt_trace_time_span_get(self->parent.t, &start_time, &end_time);
+ start_time = ltt_time_from_uint64(
+ bt_trace_handle_get_timestamp_begin(self->trace->traceset->context,
+ self->trace->id));
+
//lttv_process_trace_seek_time(&self->parent, ltt_time_zero);
for(i=0; i< nb_cpus; i++) {
LttvExecutionState *es;
self->running_process[i] = lttv_state_create_process(self, NULL, i, 0, 0,
- //TODO use &start_time...
- LTTV_STATE_UNNAMED, <t_time_zero);
+ LTTV_STATE_UNNAMED, &start_time);
/* We are not sure is it's a kernel thread or normal thread, put the
* bottom stack state to unknown */
self->running_process[i]->execution_stack =
/* Save the current position */
value = lttv_attribute_add(container, LTTV_STATE_POSITION,
LTTV_POINTER);
- *(value.v_pointer) = lttv_traceset_create_position(lttv_trace_get_traceset(self->trace));
+ *(value.v_pointer) = lttv_traceset_create_current_position(lttv_trace_get_traceset(self->trace));
#ifdef BABEL_CLEANUP
nb_tracefile = self->parent.tracefiles->len;
guint pid_in, pid_out;
gint64 state_out;
+ //TODO ybrosseau 2012-07-13: manage this 20 in a constact or dynamically
+ char next_comm[20];
LttTime timestamp;
event = (LttvEvent *) call_data;
if (strcmp(lttv_traceset_get_name_from_event(event),
pid_in = lttv_event_get_long_unsigned(event, "next_tid");
state_out = lttv_event_get_long(event, "prev_state");
+ strncpy(next_comm, lttv_event_get_string(event, "next_comm"), 20);
+ next_comm[20-1] = '\0';
+
timestamp = lttv_event_get_timestamp(event);
if(likely(process != NULL)) {
process->cpu = cpu;
// process->last_cpu_index = ltt_tracefile_num(((LttvTracefileContext*)s)->tf);
process->state->change = timestamp;
+ process->name = g_quark_from_string(next_comm);
/* update cpu status */
if(pid_in == 0)
LttvAttributeValue value;
LttvHooks*event_hook;
+#ifdef BABEL_CLEANUP
LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
result = lttv_iattribute_find_by_path(attributes, "hooks/event",
LTTV_POINTER, &value);
g_assert(result);
event_hook = *(value.v_pointer);
+#endif
+ //TODO ybrosseau 2012-07-12: Validate that using traceset hooks instead of the global one is valid
+ //Use traceset hooks
+ event_hook = lttv_traceset_get_hooks(traceset);
g_assert(event_hook);
lttv_hooks_add(event_hook,syscall_entry , NULL, LTTV_PRIO_STATE);