* present, it's a new process and it was not present : it will
* be added after the state update. */
LttvProcessState *process;
- process = lttv_state_find_process(tfs, pid_out);
- //process = tfs->process;
+ /* unknown state, bad current pid */
+ if(tfs->process->pid != pid_out)
+ process = lttv_state_find_process(tfs, pid_out);
+ else
+ process = tfs->process;
if(process != NULL) {
/* Well, the process_out existed : we must get it in the process hash
if(processlist_get_process_pixels(process_list,
pid_out,
- process->last_cpu,
+ process->last_cpu_index,
&birth,
tfc->t_context->index,
&y,
ProcessInfo *process_info;
processlist_add(process_list,
pid_out,
- process->last_cpu,
+ process->last_cpu_index,
process->ppid,
&birth,
tfc->t_context->index,
&process_info,
&hashed_process_data);
processlist_get_pixels_from_data(process_list,
- process_info,
hashed_process_data,
&y,
&height);
if(processlist_get_process_pixels(process_list,
pid_in,
- process->last_cpu,
+ process->last_cpu_index,
&birth,
tfc->t_context->index,
&y,
ProcessInfo *process_info;
processlist_add(process_list,
pid_in,
- process->last_cpu,
+ process->last_cpu_index,
process->ppid,
&birth,
tfc->t_context->index,
&process_info,
&hashed_process_data);
processlist_get_pixels_from_data(process_list,
- process_info,
hashed_process_data,
&y,
&height);
drawing_insert_square( drawing, y, height);
}
+ //We could set the current process and hash here, but will be done
+ //by after schedchange hook
/* Now, the process is in the state hash and our own process hash.
* We definitely can draw the items related to the ending state.
/* Find process pid_in in the list... */
- process_in = lttv_state_find_process(tfs, pid_in);
+ //process_in = lttv_state_find_process(tfs, pid_in);
+ process_in = tfs->process;
/* It should exist, because we are after the state update. */
g_assert(process_in != NULL);
if(processlist_get_process_pixels(process_list,
pid_in,
- process_in->last_cpu,
+ process_in->last_cpu_index,
&birth,
tfc->t_context->index,
&y_in,
/* Process not present */
processlist_add(process_list,
pid_in,
- process_in->last_cpu,
+ process_in->last_cpu_index,
process_in->ppid,
&birth,
tfc->t_context->index,
&process_info,
&hashed_process_data_in);
processlist_get_pixels_from_data(process_list,
- process_info,
hashed_process_data_in,
&y_in,
&height);
drawing_insert_square( control_flow_data->drawing, y_in, height);
}
+ /* Set the current process */
+ process_list->current_hash_data[process_in->last_cpu_index] =
+ hashed_process_data_in;
if(ltt_time_compare(hashed_process_data_in->next_good_time,
evtime) <= 0)
HashedProcessData *hashed_process_data = NULL;
ProcessList *process_list = control_flow_data->process_list;
LttTime birth = process->creation_time;
-
- if(processlist_get_process_pixels(process_list,
- pid,
- process->last_cpu,
- &birth,
- tfc->t_context->index,
- &y,
- &height,
- &hashed_process_data) == 1)
- {
- g_assert(pid == 0 || pid != process->ppid);
- ProcessInfo *process_info;
- /* Process not present */
- const gchar *name = g_quark_to_string(process->name);
- processlist_add(process_list,
- pid,
- process->last_cpu,
- process->ppid,
- &birth,
- tfc->t_context->index,
- name,
- &pl_height,
- &process_info,
- &hashed_process_data);
+
+ if(process_list->current_hash_data[tfc->index] != NULL) {
+ hashed_process_data = process_list->current_hash_data[tfc->index];
processlist_get_pixels_from_data(process_list,
- process_info,
hashed_process_data,
&y,
&height);
- drawing_insert_square( drawing, y, height);
+ } else {
+ if(processlist_get_process_pixels(process_list,
+ pid,
+ process->last_cpu_index,
+ &birth,
+ tfc->t_context->index,
+ &y,
+ &height,
+ &hashed_process_data) == 1)
+ {
+ g_assert(pid == 0 || pid != process->ppid);
+ ProcessInfo *process_info;
+ /* Process not present */
+ const gchar *name = g_quark_to_string(process->name);
+ processlist_add(process_list,
+ pid,
+ process->last_cpu_index,
+ process->ppid,
+ &birth,
+ tfc->t_context->index,
+ name,
+ &pl_height,
+ &process_info,
+ &hashed_process_data);
+ processlist_get_pixels_from_data(process_list,
+ hashed_process_data,
+ &y,
+ &height);
+ drawing_insert_square( drawing, y, height);
+ }
+ /* Set the current process */
+ process_list->current_hash_data[process->last_cpu_index] =
+ hashed_process_data;
}
/* Now, the process is in the state hash and our own process hash.
birth = process->creation_time;
- if(processlist_get_process_pixels(process_list,
- pid,
- process->last_cpu,
- &birth,
- tfc->t_context->index,
- &y,
- &height,
- &hashed_process_data) == 1)
- {
- g_assert(pid == 0 || pid != process->ppid);
- /* Process not present */
- const gchar *name = g_quark_to_string(process->name);
- ProcessInfo *process_info;
- processlist_add(process_list,
- pid,
- process->last_cpu,
- process->ppid,
- &birth,
- tfc->t_context->index,
- name,
- &pl_height,
- &process_info,
- &hashed_process_data);
+ if(process_list->current_hash_data[tfc->index] != NULL) {
+ hashed_process_data = process_list->current_hash_data[tfc->index];
processlist_get_pixels_from_data(process_list,
- process_info,
hashed_process_data,
&y,
&height);
- drawing_insert_square( control_flow_data->drawing, y, height);
+ } else {
+ if(processlist_get_process_pixels(process_list,
+ pid,
+ process->last_cpu_index,
+ &birth,
+ tfc->t_context->index,
+ &y,
+ &height,
+ &hashed_process_data) == 1)
+ {
+ g_assert(pid == 0 || pid != process->ppid);
+ /* Process not present */
+ const gchar *name = g_quark_to_string(process->name);
+ ProcessInfo *process_info;
+ processlist_add(process_list,
+ pid,
+ process->last_cpu_index,
+ process->ppid,
+ &birth,
+ tfc->t_context->index,
+ name,
+ &pl_height,
+ &process_info,
+ &hashed_process_data);
+ processlist_get_pixels_from_data(process_list,
+ hashed_process_data,
+ &y,
+ &height);
+ drawing_insert_square( control_flow_data->drawing, y, height);
+ }
+ /* Set the current process */
+ process_list->current_hash_data[process->last_cpu_index] =
+ hashed_process_data;
}
-
+
if(ltt_time_compare(hashed_process_data->next_good_time,
evtime) <= 0)
{
birth = process->creation_time;
- if(processlist_get_process_pixels(process_list,
+ if(process_list->current_hash_data[tfc->index] != NULL) {
+ hashed_process_data = process_list->current_hash_data[tfc->index];
+ processlist_get_pixels_from_data(process_list,
+ hashed_process_data,
+ &y,
+ &height);
+ } else if(processlist_get_process_pixels(process_list,
pid,
- process->last_cpu,
+ process->last_cpu_index,
&birth,
tfc->t_context->index,
&y,
ProcessInfo *process_info;
processlist_add(process_list,
pid,
- process->last_cpu,
+ process->last_cpu_index,
process->ppid,
&birth,
tfc->t_context->index,
&process_info,
&hashed_process_data);
processlist_get_pixels_from_data(process_list,
- process_info,
hashed_process_data,
&y,
&height);
if(processlist_get_process_pixels(process_list,
child_pid,
- process_child->last_cpu,
+ process_child->last_cpu_index,
&birth,
tfc->t_context->index,
&y_child,
ProcessInfo *process_info;
processlist_add(process_list,
child_pid,
- process_child->last_cpu,
+ process_child->last_cpu_index,
process_child->ppid,
&birth,
tfc->t_context->index,
&process_info,
&hashed_process_data_child);
processlist_get_pixels_from_data(process_list,
- process_info,
hashed_process_data_child,
&y_child,
&height);
drawing_insert_square( control_flow_data->drawing, y_child, height);
}
+
if(ltt_time_compare(hashed_process_data_child->next_good_time,
evtime) <= 0)
{
birth = process->creation_time;
- if(processlist_get_process_pixels(process_list,
- pid,
- process->last_cpu,
- &birth,
- tfc->t_context->index,
- &y,
- &height,
- &hashed_process_data) == 1)
- {
- g_assert(pid == 0 || pid != process->ppid);
- /* Process not present */
- const gchar *name = g_quark_to_string(process->name);
- ProcessInfo *process_info;
- processlist_add(process_list,
- pid,
- process->last_cpu,
- process->ppid,
- &birth,
- tfc->t_context->index,
- name,
- &pl_height,
- &process_info,
- &hashed_process_data);
+ if(process_list->current_hash_data[tfc->index] != NULL) {
+ hashed_process_data = process_list->current_hash_data[tfc->index];
processlist_get_pixels_from_data(process_list,
- process_info,
hashed_process_data,
&y,
&height);
- drawing_insert_square( control_flow_data->drawing, y, height);
+
+ } else {
+ if(processlist_get_process_pixels(process_list,
+ pid,
+ process->last_cpu_index,
+ &birth,
+ tfc->t_context->index,
+ &y,
+ &height,
+ &hashed_process_data) == 1)
+ {
+ g_assert(pid == 0 || pid != process->ppid);
+ /* Process not present */
+ const gchar *name = g_quark_to_string(process->name);
+ ProcessInfo *process_info;
+ processlist_add(process_list,
+ pid,
+ process->last_cpu_index,
+ process->ppid,
+ &birth,
+ tfc->t_context->index,
+ name,
+ &pl_height,
+ &process_info,
+ &hashed_process_data);
+ processlist_get_pixels_from_data(process_list,
+ hashed_process_data,
+ &y,
+ &height);
+ drawing_insert_square( control_flow_data->drawing, y, height);
+ }
+
+ /* Set the current process */
+ process_list->current_hash_data[process->last_cpu_index] =
+ hashed_process_data;
}
if(ltt_time_compare(hashed_process_data->next_good_time,
if(control_flow_data->background_info_waiting==0)
g_assert(ltt_time_compare(process->creation_time,
process_info->birth) == 0);
- const gchar *name = g_quark_to_string(process->name);
-
/* process HAS to be present */
processlist_get_pixels_from_data(process_list,
- process_info,
hashed_process_data,
&y,
&height);
ProcessList *process_list = control_flow_data->process_list;
+ 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 */