LttvTracefileContext *tfc = (LttvTracefileContext *)call_data;
LttvTracefileState *tfs = (LttvTracefileState *)call_data;
+ LttvTraceState *ts = (LttvTraceState *)tfc->t_context;
LttEvent *e;
e = ltt_tracefile_get_event(tfc->tf);
* draw items from the beginning of the read for it. If it is not
* present, it's a new process and it was not present : it will
* be added after the state update. */
- LttvProcessState *process;
+ guint cpu = ltt_tracefile_num(tfc->tf);
+ LttvProcessState *process = ts->running_process[cpu];
/* 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->pid != pid_out)
+ process = lttv_state_find_process(ts,
+ ltt_tracefile_num(tfc->tf), pid_out);
if(process != NULL) {
/* Well, the process_out existed : we must get it in the process hash
hashed_process_data = processlist_get_process_data(process_list,
pid_out,
- process->last_cpu_index,
+ process->cpu,
&birth,
tfc->t_context->index);
if(hashed_process_data == NULL)
{
g_assert(pid_out == 0 || pid_out != process->ppid);
- const gchar *name = g_quark_to_string(process->name);
/* Process not present */
ProcessInfo *process_info;
Drawing_t *drawing = control_flow_data->drawing;
processlist_add(process_list,
drawing,
pid_out,
- process->last_cpu_index,
+ process->cpu,
process->ppid,
&birth,
tfc->t_context->index,
- name,
+ process->name,
&pl_height,
&process_info,
&hashed_process_data);
* 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_in);
+ process = lttv_state_find_process(ts,
+ ltt_tracefile_num(tfc->tf), pid_in);
if(process != NULL) {
- /* Well, the process_out existed : we must get it in the process hash
+ /* Well, the process existed : we must get it in the process hash
* or add it, and draw its items.
*/
/* Add process to process list (if not present) */
hashed_process_data = processlist_get_process_data(process_list,
pid_in,
- process->last_cpu_index,
+ process->cpu,
&birth,
tfc->t_context->index);
if(hashed_process_data == NULL)
{
g_assert(pid_in == 0 || pid_in != process->ppid);
- const gchar *name = g_quark_to_string(process->name);
/* Process not present */
ProcessInfo *process_info;
Drawing_t *drawing = control_flow_data->drawing;
processlist_add(process_list,
drawing,
pid_in,
- process->last_cpu_index,
+ process->cpu,
process->ppid,
&birth,
tfc->t_context->index,
- name,
+ process->name,
&pl_height,
&process_info,
&hashed_process_data);
LttvTracefileState *tfs = (LttvTracefileState *)call_data;
+ LttvTraceState *ts = (LttvTraceState *)tfc->t_context;
+
LttEvent *e;
e = ltt_tracefile_get_event(tfc->tf);
/* Find process pid_in in the list... */
- //process_in = lttv_state_find_process(tfs, pid_in);
- process_in = tfs->process;
+ //process_in = lttv_state_find_process(ts, ANY_CPU, pid_in);
+ //process_in = tfs->process;
+ guint cpu = ltt_tracefile_num(tfc->tf);
+ process_in = ts->running_process[cpu];
/* It should exist, because we are after the state update. */
#ifdef EXTRA_CHECK
g_assert(process_in != NULL);
hashed_process_data_in = processlist_get_process_data(process_list,
pid_in,
- process_in->last_cpu_index,
+ process_in->cpu,
&birth,
tfc->t_context->index);
if(hashed_process_data_in == NULL)
{
g_assert(pid_in == 0 || pid_in != process_in->ppid);
- const gchar *name = g_quark_to_string(process_in->name);
ProcessInfo *process_info;
Drawing_t *drawing = control_flow_data->drawing;
/* Process not present */
processlist_add(process_list,
drawing,
pid_in,
- process_in->last_cpu_index,
+ process_in->cpu,
process_in->ppid,
&birth,
tfc->t_context->index,
- name,
+ process_in->name,
&pl_height,
&process_info,
&hashed_process_data_in);
gtk_widget_queue_draw(drawing->drawing_area);
}
/* Set the current process */
- process_list->current_hash_data[process_in->last_cpu_index] =
+ process_list->current_hash_data[process_in->cpu] =
hashed_process_data_in;
if(ltt_time_compare(hashed_process_data_in->next_good_time,
int before_execmode_hook(void *hook_data, void *call_data)
{
- return 0; //DISABLED
LttvTraceHookByFacility *thf = (LttvTraceHookByFacility*)hook_data;
EventsRequest *events_request = (EventsRequest*)thf->hook_data;
ControlFlowData *control_flow_data = events_request->viewer_data;
LttvTracefileState *tfs = (LttvTracefileState *)call_data;
+ LttvTraceState *ts = (LttvTraceState *)tfc->t_context;
+
LttEvent *e;
e = ltt_tracefile_get_event(tfc->tf);
* time to do it.
*/
/* For the pid */
- LttvProcessState *process = tfs->process;
+ //LttvProcessState *process = tfs->process;
+ guint cpu = ltt_tracefile_num(tfc->tf);
+ LttvProcessState *process = ts->running_process[cpu];
g_assert(process != NULL);
guint pid = process->pid;
ProcessList *process_list = control_flow_data->process_list;
LttTime birth = process->creation_time;
- if(likely(process_list->current_hash_data[ltt_tracefile_num(tfc->tf)] != NULL)) {
- hashed_process_data = process_list->current_hash_data[ltt_tracefile_num(tfc->tf)];
+ if(likely(process_list->current_hash_data[cpu] != NULL)) {
+ hashed_process_data = process_list->current_hash_data[cpu];
} else {
hashed_process_data = processlist_get_process_data(process_list,
pid,
- process->last_cpu_index,
+ process->cpu,
&birth,
tfc->t_context->index);
if(unlikely(hashed_process_data == NULL))
ProcessInfo *process_info;
/* Process not present */
Drawing_t *drawing = control_flow_data->drawing;
- const gchar *name = g_quark_to_string(process->name);
processlist_add(process_list,
drawing,
pid,
- process->last_cpu_index,
+ process->cpu,
process->ppid,
&birth,
tfc->t_context->index,
- name,
+ process->name,
&pl_height,
&process_info,
&hashed_process_data);
gtk_widget_queue_draw(drawing->drawing_area);
}
/* Set the current process */
- process_list->current_hash_data[process->last_cpu_index] =
+ process_list->current_hash_data[process->cpu] =
hashed_process_data;
}
* This function adds items to be drawn in a queue for each process.
*
*/
+#if 0
int after_execmode_hook(void *hook_data, void *call_data)
{
/**************** DOES NOTHING!! *************/
}
return 0;
}
-
+#endif //0
int before_process_exit_hook(void *hook_data, void *call_data)
{
- return 0; //DISABLED
LttvTraceHookByFacility *thf = (LttvTraceHookByFacility*)hook_data;
EventsRequest *events_request = (EventsRequest*)thf->hook_data;
LttvTracefileState *tfs = (LttvTracefileState *)call_data;
+ LttvTraceState *ts = (LttvTraceState *)tfc->t_context;
+
LttEvent *e;
e = ltt_tracefile_get_event(tfc->tf);
LttTime evtime = ltt_event_time(e);
/* Add process to process list (if not present) */
- LttvProcessState *process = tfs->process;
+ //LttvProcessState *process = tfs->process;
+ guint cpu = ltt_tracefile_num(tfc->tf);
+ LttvProcessState *process = ts->running_process[cpu];
guint pid = process->pid;
LttTime birth;
guint pl_height = 0;
birth = process->creation_time;
- if(likely(process_list->current_hash_data[ltt_tracefile_num(tfc->tf)] != NULL)) {
- hashed_process_data = process_list->current_hash_data[ltt_tracefile_num(tfc->tf)];
+ if(likely(process_list->current_hash_data[cpu] != NULL)) {
+ hashed_process_data = process_list->current_hash_data[cpu];
} else {
hashed_process_data = processlist_get_process_data(process_list,
pid,
- process->last_cpu_index,
+ process->cpu,
&birth,
tfc->t_context->index);
if(unlikely(hashed_process_data == NULL))
g_assert(pid == 0 || pid != process->ppid);
/* Process not present */
Drawing_t *drawing = control_flow_data->drawing;
- const gchar *name = g_quark_to_string(process->name);
ProcessInfo *process_info;
processlist_add(process_list,
drawing,
pid,
- process->last_cpu_index,
+ process->cpu,
process->ppid,
&birth,
tfc->t_context->index,
- name,
+ process->name,
&pl_height,
&process_info,
&hashed_process_data);
int before_process_release_hook(void *hook_data, void *call_data)
{
- return 0; //DISABLED
LttvTraceHookByFacility *thf = (LttvTraceHookByFacility*)hook_data;
EventsRequest *events_request = (EventsRequest*)thf->hook_data;
LttvTracefileState *tfs = (LttvTracefileState *)call_data;
+ LttvTraceState *ts = (LttvTraceState *)tfc->t_context;
+
LttEvent *e;
e = ltt_tracefile_get_event(tfc->tf);
/* Don't care about the process if it's not in the state hash already :
* that means a process that has never done anything in the trace and
* unknown suddently gets destroyed : no state meaningful to show. */
- LttvProcessState *process = lttv_state_find_process(tfs, pid);
+ LttvProcessState *process = lttv_state_find_process(ts, ANY_CPU, pid);
if(process != NULL) {
LttTime birth;
* action done by the parent. */
hashed_process_data = processlist_get_process_data(process_list,
pid,
- process->last_cpu_index,
+ process->cpu,
&birth,
tfc->t_context->index);
if(unlikely(hashed_process_data == NULL))
g_assert(pid == 0 || pid != process->ppid);
/* Process not present */
Drawing_t *drawing = control_flow_data->drawing;
- const gchar *name = g_quark_to_string(process->name);
ProcessInfo *process_info;
processlist_add(process_list,
drawing,
pid,
- process->last_cpu_index,
+ process->cpu,
process->ppid,
&birth,
tfc->t_context->index,
- name,
+ process->name,
&pl_height,
&process_info,
&hashed_process_data);
g_assert(pid == 0 || pid != process->ppid);
/* Process not present */
Drawing_t *drawing = control_flow_data->drawing;
- const gchar *name = g_quark_to_string(process->name);
ProcessInfo *process_info;
processlist_add(process_list,
drawing,
process->ppid,
&birth,
tfc->t_context->index,
- name,
+ process->name,
&pl_height,
&process_info,
&hashed_process_data);
*/
int after_process_fork_hook(void *hook_data, void *call_data)
{
- return 0; //DISABLED
LttvTraceHookByFacility *thf = (LttvTraceHookByFacility*)hook_data;
EventsRequest *events_request = (EventsRequest*)thf->hook_data;
ControlFlowData *control_flow_data = events_request->viewer_data;
LttvTracefileState *tfs = (LttvTracefileState *)call_data;
+ LttvTraceState *ts = (LttvTraceState *)tfc->t_context;
+
LttEvent *e;
e = ltt_tracefile_get_event(tfc->tf);
ProcessList *process_list = control_flow_data->process_list;
/* Find child in the list... */
- process_child = lttv_state_find_process(tfs, child_pid);
+ process_child = lttv_state_find_process(ts, ANY_CPU, child_pid);
/* It should exist, because we are after the state update. */
g_assert(process_child != NULL);
* on its child. */
hashed_process_data_child = processlist_get_process_data(process_list,
child_pid,
- process_child->last_cpu_index,
+ process_child->cpu,
&birth,
tfc->t_context->index);
if(likely(hashed_process_data_child == NULL))
g_assert(child_pid == 0 || child_pid != process_child->ppid);
/* Process not present */
Drawing_t *drawing = control_flow_data->drawing;
- const gchar *name = g_quark_to_string(process_child->name);
ProcessInfo *process_info;
processlist_add(process_list,
drawing,
child_pid,
- process_child->last_cpu_index,
+ process_child->cpu,
process_child->ppid,
&birth,
tfc->t_context->index,
- name,
+ process_child->name,
&pl_height,
&process_info,
&hashed_process_data_child);
*/
int after_process_exit_hook(void *hook_data, void *call_data)
{
- return 0; //DISABLED
LttvTraceHookByFacility *thf = (LttvTraceHookByFacility*)hook_data;
EventsRequest *events_request = (EventsRequest*)thf->hook_data;
ControlFlowData *control_flow_data = events_request->viewer_data;
LttvTracefileState *tfs = (LttvTracefileState *)call_data;
+ LttvTraceState *ts = (LttvTraceState *)tfc->t_context;
+
LttEvent *e;
e = ltt_tracefile_get_event(tfc->tf);
LttTime evtime = ltt_event_time(e);
/* Add process to process list (if not present) */
- LttvProcessState *process = tfs->process;
+ //LttvProcessState *process = tfs->process;
+ guint cpu = ltt_tracefile_num(tfc->tf);
+ LttvProcessState *process = ts->running_process[cpu];
+
+ /* It should exist, because we are after the state update. */
+ g_assert(process != NULL);
+
guint pid = process->pid;
LttTime birth;
guint pl_height = 0;
ProcessList *process_list = control_flow_data->process_list;
- /* It should exist, because we are after the state update. */
- g_assert(process != NULL);
-
birth = process->creation_time;
- if(likely(process_list->current_hash_data[ltt_tracefile_num(tfc->tf)] != NULL) ){
- hashed_process_data = process_list->current_hash_data[ltt_tracefile_num(tfc->tf)];
+ if(likely(process_list->current_hash_data[cpu] != NULL) ){
+ hashed_process_data = process_list->current_hash_data[cpu];
} else {
hashed_process_data = processlist_get_process_data(process_list,
pid,
- process->last_cpu_index,
+ process->cpu,
&birth,
tfc->t_context->index);
if(unlikely(hashed_process_data == NULL))
g_assert(pid == 0 || pid != process->ppid);
/* Process not present */
Drawing_t *drawing = control_flow_data->drawing;
- const gchar *name = g_quark_to_string(process->name);
ProcessInfo *process_info;
processlist_add(process_list,
drawing,
pid,
- process->last_cpu_index,
+ process->cpu,
process->ppid,
&birth,
tfc->t_context->index,
- name,
+ process->name,
&pl_height,
&process_info,
&hashed_process_data);
}
/* Set the current process */
- process_list->current_hash_data[process->last_cpu_index] =
+ process_list->current_hash_data[process->cpu] =
hashed_process_data;
}
}
#endif //0
+/* Get the filename of the process to print */
+int after_fs_exec_hook(void *hook_data, void *call_data)
+{
+ LttvTraceHookByFacility *thf = (LttvTraceHookByFacility*)hook_data;
+ EventsRequest *events_request = (EventsRequest*)thf->hook_data;
+ ControlFlowData *control_flow_data = events_request->viewer_data;
+
+ LttvTracefileContext *tfc = (LttvTracefileContext *)call_data;
+
+ LttvTracefileState *tfs = (LttvTracefileState *)call_data;
+
+ LttvTraceState *ts = (LttvTraceState *)tfc->t_context;
+
+ guint cpu = ltt_tracefile_num(tfc->tf);
+ LttvProcessState *process = ts->running_process[cpu];
+ g_assert(process != NULL);
+
+ guint pid = process->pid;
+
+ /* Well, the process_out existed : we must get it in the process hash
+ * or add it, and draw its items.
+ */
+ /* Add process to process list (if not present) */
+ guint pl_height = 0;
+ HashedProcessData *hashed_process_data = 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];
+ } else {
+ hashed_process_data = processlist_get_process_data(process_list,
+ pid,
+ process->cpu,
+ &birth,
+ tfc->t_context->index);
+ if(unlikely(hashed_process_data == NULL))
+ {
+ g_assert(pid == 0 || pid != process->ppid);
+ ProcessInfo *process_info;
+ /* Process not present */
+ Drawing_t *drawing = control_flow_data->drawing;
+ processlist_add(process_list,
+ drawing,
+ pid,
+ process->cpu,
+ process->ppid,
+ &birth,
+ tfc->t_context->index,
+ process->name,
+ &pl_height,
+ &process_info,
+ &hashed_process_data);
+ gtk_widget_set_size_request(drawing->drawing_area,
+ -1,
+ pl_height);
+ gtk_widget_queue_draw(drawing->drawing_area);
+ }
+ /* Set the current process */
+ process_list->current_hash_data[process->cpu] =
+ hashed_process_data;
+ }
+
+ processlist_set_name(process_list, process->name, hashed_process_data);
+
+ return 0;
+
+}
+
+
+
+
gint update_time_window_hook(void *hook_data, void *call_data)
{
ControlFlowData *control_flow_data = (ControlFlowData*) hook_data;
g_assert(lttv_traceset_number(tsc->ts) > 0);
#endif //EXTRA_CHECK
LttvTraceContext *tc = tsc->traces[process_info->trace_num];
+ LttvTraceState *ts = (LttvTraceState*)tc;
+#if 0
//FIXME : optimize data structures.
LttvTracefileState *tfs;
LttvTracefileContext *tfc;
}
g_assert(i<tc->tracefiles->len);
tfs = LTTV_TRACEFILE_STATE(tfc);
-
+#endif //0
// LttvTracefileState *tfs =
// (LttvTracefileState*)tsc->traces[process_info->trace_num]->
// tracefiles[process_info->cpu];
LttvProcessState *process;
- process = lttv_state_find_process(tfs,
+ process = lttv_state_find_process(ts, process_info->cpu,
process_info->pid);
if(unlikely(process != NULL)) {