* be added after the state update. */
LttvProcessState *process;
process = lttv_state_find_process(tfs, pid_out);
+ //process = tfs->process;
if(process != NULL) {
/* Well, the process_out existed : we must get it in the process hash
{
g_assert(pid_out == 0 || pid_out != process->ppid);
/* Process not present */
+ ProcessInfo *process_info;
processlist_add(process_list,
pid_out,
process->last_cpu,
tfc->t_context->index,
name,
&pl_height,
+ &process_info,
&hashed_process_data);
- processlist_get_process_pixels(process_list,
- pid_out,
- process->last_cpu,
- &birth,
- tfc->t_context->index,
+ processlist_get_pixels_from_data(process_list,
+ process_info,
+ hashed_process_data,
&y,
- &height,
- &hashed_process_data);
+ &height);
drawing_insert_square( drawing, y, height);
}
{
g_assert(pid_in == 0 || pid_in != process->ppid);
/* Process not present */
+ ProcessInfo *process_info;
processlist_add(process_list,
pid_in,
process->last_cpu,
tfc->t_context->index,
name,
&pl_height,
+ &process_info,
&hashed_process_data);
- processlist_get_process_pixels(process_list,
- pid_in,
- process->last_cpu,
- &birth,
- tfc->t_context->index,
+ processlist_get_pixels_from_data(process_list,
+ process_info,
+ hashed_process_data,
&y,
- &height,
- &hashed_process_data);
+ &height);
drawing_insert_square( drawing, y, height);
}
&hashed_process_data_in) == 1)
{
g_assert(pid_in == 0 || pid_in != process_in->ppid);
+ ProcessInfo *process_info;
/* Process not present */
processlist_add(process_list,
pid_in,
tfc->t_context->index,
name,
&pl_height,
+ &process_info,
&hashed_process_data_in);
- processlist_get_process_pixels(process_list,
- pid_in,
- process_in->last_cpu,
- &birth,
- tfc->t_context->index,
- &y_in,
- &height,
- &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);
}
&hashed_process_data) == 1)
{
g_assert(pid == 0 || pid != process->ppid);
+ ProcessInfo *process_info;
/* Process not present */
processlist_add(process_list,
pid,
tfc->t_context->index,
name,
&pl_height,
+ &process_info,
&hashed_process_data);
- processlist_get_process_pixels(process_list,
- pid,
- process->last_cpu,
- &birth,
- tfc->t_context->index,
- &y,
- &height,
- &hashed_process_data);
+ processlist_get_pixels_from_data(process_list,
+ process_info,
+ hashed_process_data,
+ &y,
+ &height);
drawing_insert_square( drawing, y, height);
}
{
g_assert(pid == 0 || pid != process->ppid);
/* Process not present */
+ ProcessInfo *process_info;
processlist_add(process_list,
pid,
process->last_cpu,
tfc->t_context->index,
name,
&pl_height,
+ &process_info,
&hashed_process_data);
- processlist_get_process_pixels(process_list,
- pid,
- process->last_cpu,
- &birth,
- tfc->t_context->index,
- &y,
- &height,
- &hashed_process_data);
+ processlist_get_pixels_from_data(process_list,
+ process_info,
+ hashed_process_data,
+ &y,
+ &height);
drawing_insert_square( control_flow_data->drawing, y, height);
}
{
g_assert(pid == 0 || pid != process->ppid);
/* Process not present */
+ ProcessInfo *process_info;
processlist_add(process_list,
pid,
process->last_cpu,
tfc->t_context->index,
name,
&pl_height,
+ &process_info,
&hashed_process_data);
- processlist_get_process_pixels(process_list,
- pid,
- process->last_cpu,
- &birth,
- tfc->t_context->index,
- &y,
- &height,
- &hashed_process_data);
+ processlist_get_pixels_from_data(process_list,
+ process_info,
+ hashed_process_data,
+ &y,
+ &height);
drawing_insert_square( control_flow_data->drawing, y, height);
}
{
g_assert(child_pid == 0 || child_pid != process_child->ppid);
/* Process not present */
+ ProcessInfo *process_info;
processlist_add(process_list,
child_pid,
process_child->last_cpu,
tfc->t_context->index,
name,
&pl_height,
+ &process_info,
&hashed_process_data_child);
- processlist_get_process_pixels(process_list,
- child_pid,
- process_child->last_cpu,
- &birth,
- tfc->t_context->index,
- &y_child,
- &height,
- &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);
}
{
g_assert(pid == 0 || pid != process->ppid);
/* Process not present */
+ ProcessInfo *process_info;
processlist_add(process_list,
pid,
process->last_cpu,
tfc->t_context->index,
name,
&pl_height,
+ &process_info,
&hashed_process_data);
- processlist_get_process_pixels(process_list,
- pid,
- process->last_cpu,
- &birth,
- tfc->t_context->index,
- &y,
- &height,
- &hashed_process_data);
+ processlist_get_pixels_from_data(process_list,
+ process_info,
+ hashed_process_data,
+ &y,
+ &height);
drawing_insert_square( control_flow_data->drawing, y, height);
}
process_list->number_of_process = 0;
process_list->cell_height_cache = -1;
+ process_list->current_process_info = NULL;
+ process_list->current_hash_data = NULL;
+
/* Create the Process list */
process_list->list_store = gtk_list_store_new ( N_COLUMNS,
G_TYPE_STRING,
gtk_list_store_remove (process_list->list_store, &iter);
+ if(process_info == process_list->current_process_info)
+ process_list->current_process_info = NULL;
+ if(hashed_process_data == process_list->current_hash_data)
+ process_list->current_hash_data = NULL;
+
return TRUE; /* remove the element from the hash table */
}
guint trace_num,
const gchar *name,
guint *height,
+ ProcessInfo **pm_process_info,
HashedProcessData **pm_hashed_process_data)
{
ProcessInfo *Process_Info = g_new(ProcessInfo, 1);
HashedProcessData *hashed_process_data = g_new(HashedProcessData, 1);
*pm_hashed_process_data = hashed_process_data;
+ *pm_process_info = Process_Info;
Process_Info->pid = pid;
if(pid == 0)
LttTime *birth,
guint trace_num)
{
- ProcessInfo Process_Info;
+ ProcessInfo process_info;
gint *path_indices;
HashedProcessData *hashed_process_data;
GtkTreeIter iter;
- Process_Info.pid = pid;
+ process_info.pid = pid;
if(pid == 0)
- Process_Info.cpu = cpu;
+ process_info.cpu = cpu;
else
- Process_Info.cpu = 0;
- Process_Info.birth = *birth;
- Process_Info.trace_num = trace_num;
+ process_info.cpu = 0;
+ process_info.birth = *birth;
+ process_info.trace_num = trace_num;
if(hashed_process_data =
(HashedProcessData*)g_hash_table_lookup(
process_list->process_hash,
- &Process_Info))
+ &process_info))
{
iter = hashed_process_data->y_iter;
gtk_list_store_remove (process_list->list_store, &iter);
g_hash_table_remove(process_list->process_hash,
- &Process_Info);
-
+ &process_info);
+
+ if(hashed_process_data == process_list->current_hash_data) {
+ process_list->current_process_info = NULL;
+ process_list->current_hash_data = NULL;
+ }
+
process_list->number_of_process--;
return 0;
guint *height,
HashedProcessData **pm_hashed_process_data)
{
- ProcessInfo Process_Info;
+ ProcessInfo process_info;
gint *path_indices;
GtkTreePath *tree_path;
HashedProcessData *hashed_process_data = NULL;
- Process_Info.pid = pid;
+ process_info.pid = pid;
if(pid == 0)
- Process_Info.cpu = cpu;
+ process_info.cpu = cpu;
else
- Process_Info.cpu = 0;
- Process_Info.birth = *birth;
- Process_Info.trace_num = trace_num;
+ process_info.cpu = 0;
+ process_info.birth = *birth;
+ process_info.trace_num = trace_num;
if(hashed_process_data =
(HashedProcessData*)g_hash_table_lookup(
process_list->process_hash,
- &Process_Info))
+ &process_info))
{
tree_path = gtk_tree_model_get_path(
GTK_TREE_MODEL(process_list->list_store),