#define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)
//FIXME
-#define TRACE_NUMBER 0
+// fixed #define TRACE_NUMBER 0
#define EXTRA_ALLOC 1024 // pixels
gint before_hn, after_hn;
nb_trace = lttv_traceset_number(traceset);
- // FIXME : eventually request for more traces
- // for(i = 0 ; i < nb_trace ; i++) {
- for(i = 0; i<MIN(TRACE_NUMBER+1, nb_trace);i++)
- {
+ // FIXME (fixed) : eventually request for more traces
+ for(i = 0 ; i < nb_trace ; i++) {
+ //for(i = 0; i<MIN(TRACE_NUMBER+1, nb_trace);i++) {
EventsRequest *events_request = g_new(EventsRequest, 1);
// Create the hooks
//LttvHooks *event = lttv_hooks_new();
events_request->end_time = time_end;
events_request->num_events = G_MAXUINT;
events_request->end_position = NULL;
- events_request->trace = i; /* FIXME */
+ events_request->trace = i; //fixed /* FIXME */
events_request->before_chunk_traceset = before_chunk_traceset;
events_request->before_chunk_trace = NULL;
events_request->before_chunk_tracefile = NULL;
{
g_debug("Begin of chunk");
ControlFlowData *cfd = events_request->viewer_data;
- LttvTracesetContext *tsc = LTTV_TRACESET_CONTEXT(tss);
+ LttvTracesetContext *tsc = &tss->parent.parent;
//LttTime current_time = lttv_traceset_context_get_current_tfc(tsc)->timestamp;
- guint num_cpu =
- ltt_trace_get_num_cpu(tss->parent.traces[TRACE_NUMBER]->t);
-
- cfd->process_list->current_hash_data = g_new(HashedProcessData*,num_cpu);
- memset(cfd->process_list->current_hash_data, 0,
- sizeof(HashedProcessData*)*num_cpu);
+ guint i;
+ LttvTraceset *traceset = tsc->ts;
+ guint nb_trace = lttv_traceset_number(traceset);
+
+ if(!cfd->process_list->current_hash_data) {
+ cfd->process_list->current_hash_data = g_new(HashedProcessData**,nb_trace);
+ for(i = 0 ; i < nb_trace ; i++) {
+ guint num_cpu = ltt_trace_get_num_cpu(tss->parent.traces[i]->t);
+ cfd->process_list->current_hash_data[i] = g_new(HashedProcessData*,num_cpu);
+ memset(cfd->process_list->current_hash_data[i], 0,
+ sizeof(HashedProcessData*)*num_cpu);
+ }
+ }
//cfd->drawing->last_start = LTT_TIME_MIN(current_time,
// events_request->end_time);
}
* present, it's a new process and it was not present : it will
* be added after the state update. */
guint cpu = tfs->cpu;
+ guint trace_num = ts->parent.index;
LttvProcessState *process = ts->running_process[cpu];
/* unknown state, bad current pid */
if(process->pid != pid_out)
pid_out,
process->cpu,
&birth,
- tfc->t_context->index);
+ trace_num);
if(hashed_process_data == NULL)
{
g_assert(pid_out == 0 || pid_out != process->ppid);
process->cpu,
process->ppid,
&birth,
- tfc->t_context->index,
+ trace_num,
process->name,
process->brand,
&pl_height,
LttvProcessState *process;
process = lttv_state_find_process(ts,
tfs->cpu, pid_in);
+ guint trace_num = ts->parent.index;
if(process != NULL) {
/* Well, the process existed : we must get it in the process hash
pid_in,
tfs->cpu,
&birth,
- tfc->t_context->index);
+ trace_num);
if(hashed_process_data == NULL)
{
g_assert(pid_in == 0 || pid_in != process->ppid);
tfs->cpu,
process->ppid,
&birth,
- tfc->t_context->index,
+ trace_num,
process->name,
process->brand,
&pl_height,
//process_in = lttv_state_find_process(ts, ANY_CPU, pid_in);
//process_in = tfs->process;
guint cpu = tfs->cpu;
+ guint trace_num = ts->parent.index;
process_in = ts->running_process[cpu];
/* It should exist, because we are after the state update. */
#ifdef EXTRA_CHECK
pid_in,
process_in->cpu,
&birth,
- tfc->t_context->index);
+ trace_num);
if(hashed_process_data_in == NULL)
{
g_assert(pid_in == 0 || pid_in != process_in->ppid);
process_in->cpu,
process_in->ppid,
&birth,
- tfc->t_context->index,
+ trace_num,
process_in->name,
process_in->brand,
&pl_height,
gtk_widget_queue_draw(drawing->drawing_area);
}
/* Set the current process */
- process_list->current_hash_data[process_in->cpu] =
+ process_list->current_hash_data[trace_num][process_in->cpu] =
hashed_process_data_in;
if(ltt_time_compare(hashed_process_data_in->next_good_time,
/* For the pid */
//LttvProcessState *process = tfs->process;
guint cpu = tfs->cpu;
+ guint trace_num = ts->parent.index;
LttvProcessState *process = ts->running_process[cpu];
g_assert(process != NULL);
ProcessList *process_list = control_flow_data->process_list;
LttTime birth = process->creation_time;
- if(likely(process_list->current_hash_data[cpu] != NULL)) {
- hashed_process_data = process_list->current_hash_data[cpu];
+ if(likely(process_list->current_hash_data[trace_num][cpu] != NULL)) {
+ hashed_process_data = process_list->current_hash_data[trace_num][cpu];
} else {
hashed_process_data = processlist_get_process_data(process_list,
pid,
process->cpu,
&birth,
- tfc->t_context->index);
+ trace_num);
if(unlikely(hashed_process_data == NULL))
{
g_assert(pid == 0 || pid != process->ppid);
process->cpu,
process->ppid,
&birth,
- tfc->t_context->index,
+ trace_num,
process->name,
process->brand,
&pl_height,
gtk_widget_queue_draw(drawing->drawing_area);
}
/* Set the current process */
- process_list->current_hash_data[process->cpu] =
+ process_list->current_hash_data[trace_num][process->cpu] =
hashed_process_data;
}
/* Add process to process list (if not present) */
//LttvProcessState *process = tfs->process;
guint cpu = tfs->cpu;
+ guint trace_num = ts->parent.index;
LttvProcessState *process = ts->running_process[cpu];
guint pid = process->pid;
LttTime birth;
birth = process->creation_time;
- if(likely(process_list->current_hash_data[cpu] != NULL)) {
- hashed_process_data = process_list->current_hash_data[cpu];
+ if(likely(process_list->current_hash_data[trace_num][cpu] != NULL)) {
+ hashed_process_data = process_list->current_hash_data[trace_num][cpu];
} else {
hashed_process_data = processlist_get_process_data(process_list,
pid,
process->cpu,
&birth,
- tfc->t_context->index);
+ trace_num);
if(unlikely(hashed_process_data == NULL))
{
g_assert(pid == 0 || pid != process->ppid);
process->cpu,
process->ppid,
&birth,
- tfc->t_context->index,
+ trace_num,
process->name,
process->brand,
&pl_height,
LttTime evtime = ltt_event_time(e);
+ guint trace_num = ts->parent.index;
guint pid;
{
pid,
process->cpu,
&birth,
- tfc->t_context->index);
+ trace_num);
if(unlikely(hashed_process_data == NULL))
{
g_assert(pid == 0 || pid != process->ppid);
process->cpu,
process->ppid,
&birth,
- tfc->t_context->index,
+ trace_num,
process->name,
process->brand,
&pl_height,
g_assert(process_child != NULL);
birth = process_child->creation_time;
+ guint trace_num = ts->parent.index;
/* Cannot use current process, because this action is done by the parent
* on its child. */
child_pid,
process_child->cpu,
&birth,
- tfc->t_context->index);
+ trace_num);
if(likely(hashed_process_data_child == NULL))
{
g_assert(child_pid == 0 || child_pid != process_child->ppid);
process_child->cpu,
process_child->ppid,
&birth,
- tfc->t_context->index,
+ trace_num,
process_child->name,
process_child->brand,
&pl_height,
/* Add process to process list (if not present) */
//LttvProcessState *process = tfs->process;
guint cpu = tfs->cpu;
+ guint trace_num = ts->parent.index;
LttvProcessState *process = ts->running_process[cpu];
/* It should exist, because we are after the state update. */
birth = process->creation_time;
- if(likely(process_list->current_hash_data[cpu] != NULL) ){
- hashed_process_data = process_list->current_hash_data[cpu];
+ if(likely(process_list->current_hash_data[trace_num][cpu] != NULL) ){
+ hashed_process_data = process_list->current_hash_data[trace_num][cpu];
} else {
hashed_process_data = processlist_get_process_data(process_list,
pid,
process->cpu,
&birth,
- tfc->t_context->index);
+ trace_num);
if(unlikely(hashed_process_data == NULL))
{
g_assert(pid == 0 || pid != process->ppid);
process->cpu,
process->ppid,
&birth,
- tfc->t_context->index,
+ trace_num,
process->name,
process->brand,
&pl_height,
}
/* Set the current process */
- process_list->current_hash_data[process->cpu] =
+ process_list->current_hash_data[trace_num][process->cpu] =
hashed_process_data;
}
return FALSE;
guint cpu = tfs->cpu;
+ guint trace_num = ts->parent.index;
LttvProcessState *process = ts->running_process[cpu];
g_assert(process != NULL);
ProcessList *process_list = control_flow_data->process_list;
LttTime birth = process->creation_time;
- if(likely(process_list->current_hash_data[cpu] != NULL)) {
- hashed_process_data = process_list->current_hash_data[cpu];
+ if(likely(process_list->current_hash_data[trace_num][cpu] != NULL)) {
+ hashed_process_data = process_list->current_hash_data[trace_num][cpu];
} else {
hashed_process_data = processlist_get_process_data(process_list,
pid,
process->cpu,
&birth,
- tfc->t_context->index);
+ trace_num);
if(unlikely(hashed_process_data == NULL))
{
g_assert(pid == 0 || pid != process->ppid);
process->cpu,
process->ppid,
&birth,
- tfc->t_context->index,
+ trace_num,
process->name,
process->brand,
&pl_height,
gtk_widget_queue_draw(drawing->drawing_area);
}
/* Set the current process */
- process_list->current_hash_data[process->cpu] =
+ process_list->current_hash_data[trace_num][process->cpu] =
hashed_process_data;
}
return FALSE;
guint cpu = tfs->cpu;
+ guint trace_num = ts->parent.index;
LttvProcessState *process = ts->running_process[cpu];
g_assert(process != NULL);
ProcessList *process_list = control_flow_data->process_list;
LttTime birth = process->creation_time;
- if(likely(process_list->current_hash_data[cpu] != NULL)) {
- hashed_process_data = process_list->current_hash_data[cpu];
+ if(likely(process_list->current_hash_data[trace_num][cpu] != NULL)) {
+ hashed_process_data = process_list->current_hash_data[trace_num][cpu];
} else {
hashed_process_data = processlist_get_process_data(process_list,
pid,
process->cpu,
&birth,
- tfc->t_context->index);
+ trace_num);
if(unlikely(hashed_process_data == NULL))
{
g_assert(pid == 0 || pid != process->ppid);
process->cpu,
process->ppid,
&birth,
- tfc->t_context->index,
+ trace_num,
process->name,
process->brand,
&pl_height,
gtk_widget_queue_draw(drawing->drawing_area);
}
/* Set the current process */
- process_list->current_hash_data[process->cpu] =
+ process_list->current_hash_data[trace_num][process->cpu] =
hashed_process_data;
}
HashedProcessData *hashed_process_data_in = NULL;
ProcessList *process_list = control_flow_data->process_list;
+ guint trace_num = ts->parent.index;
guint pid_in;
{
process_in = lttv_state_find_process(ts, ANY_CPU, pid_in);
//process_in = tfs->process;
//guint cpu = tfs->cpu;
+ //guint trace_num = ts->parent.index;
//process_in = ts->running_process[cpu];
/* It should exist, because we are after the state update. */
#ifdef EXTRA_CHECK
pid_in,
process_in->cpu,
&birth,
- tfc->t_context->index);
+ trace_num);
if(hashed_process_data_in == NULL)
{
if(pid_in != 0 && pid_in == process_in->ppid)
process_in->cpu,
process_in->ppid,
&birth,
- tfc->t_context->index,
+ trace_num,
process_in->name,
process_in->brand,
&pl_height,
LttTime end_time;
ProcessList *process_list = control_flow_data->process_list;
+ guint i;
+ LttvTraceset *traceset = tsc->ts;
+ guint nb_trace = lttv_traceset_number(traceset);
+ /* Only execute when called for the first trace's events request */
+ if(!process_list->current_hash_data) return;
+
+ for(i = 0 ; i < nb_trace ; i++) {
+ g_free(process_list->current_hash_data[i]);
+ }
g_free(process_list->current_hash_data);
process_list->current_hash_data = NULL;
-
+
if(tfc != NULL)
end_time = LTT_TIME_MIN(tfc->timestamp, events_request->end_time);
else /* end of traceset, or position now out of request : end */