1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2003-2004 Mathieu Desnoyers
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20 /*****************************************************************************
21 * Hooks to be called by the main window *
22 *****************************************************************************/
25 /* Event hooks are the drawing hooks called during traceset read. They draw the
26 * icons, text, lines and background color corresponding to the events read.
28 * Two hooks are used for drawing : before_schedchange and after_schedchange hooks. The
29 * before_schedchange is called before the state update that occurs with an event and
30 * the after_schedchange hook is called after this state update.
32 * The before_schedchange hooks fulfill the task of drawing the visible objects that
33 * corresponds to the data accumulated by the after_schedchange hook.
35 * The after_schedchange hook accumulates the data that need to be shown on the screen
36 * (items) into a queue. Then, the next before_schedchange hook will draw what that
37 * queue contains. That's the Right Way (TM) of drawing items on the screen,
38 * because we need to draw the background first (and then add icons, text, ...
39 * over it), but we only know the length of a background region once the state
40 * corresponding to it is over, which happens to be at the next before_schedchange
43 * We also have a hook called at the end of a chunk to draw the information left
44 * undrawn in each process queue. We use the current time as end of
52 //#define PANGO_ENABLE_BACKEND
61 //#include <pango/pango.h>
63 #include <ltt/event.h>
65 #include <ltt/trace.h>
67 #include <lttv/lttv.h>
68 #include <lttv/hook.h>
69 #include <lttv/state.h>
70 #include <lttvwindow/lttvwindow.h>
71 #include <lttvwindow/lttvwindowtraces.h>
72 #include <lttvwindow/support.h>
75 #include "eventhooks.h"
77 #include "processlist.h"
81 #define MAX_PATH_LEN 256
82 #define STATE_LINE_WIDTH 6
83 #define COLLISION_POSITION(height) (((height - STATE_LINE_WIDTH)/2) -3)
85 extern GSList
*g_legend_list
;
88 /* Action to do when background computation completed.
90 * Wait for all the awaited computations to be over.
93 static gint
background_ready(void *hook_data
, void *call_data
)
95 ControlFlowData
*resourceview_data
= (ControlFlowData
*)hook_data
;
97 resourceview_data
->background_info_waiting
--;
99 if(resourceview_data
->background_info_waiting
== 0) {
100 g_message("control flow viewer : background computation data ready.");
102 drawing_clear(resourceview_data
->drawing
);
103 processlist_clear(resourceview_data
->process_list
);
104 gtk_widget_set_size_request(
105 resourceview_data
->drawing
->drawing_area
,
106 -1, processlist_get_height(resourceview_data
->process_list
));
107 redraw_notify(resourceview_data
, NULL
);
114 /* Request background computation. Verify if it is in progress or ready first.
115 * Only for each trace in the tab's traceset.
117 static void request_background_data(ControlFlowData
*resourceview_data
)
120 lttvwindow_get_traceset(resourceview_data
->tab
);
121 gint num_traces
= lttv_traceset_number(ts
);
124 LttvTraceState
*tstate
;
126 LttvHooks
*background_ready_hook
=
128 lttv_hooks_add(background_ready_hook
, background_ready
, resourceview_data
,
130 resourceview_data
->background_info_waiting
= 0;
132 for(i
=0;i
<num_traces
;i
++) {
133 trace
= lttv_traceset_get(ts
, i
);
135 if(lttvwindowtraces_get_ready(g_quark_from_string("state"),trace
)==FALSE
136 && !ts
->has_precomputed_states
) {
138 if(lttvwindowtraces_get_in_progress(g_quark_from_string("state"),
140 /* We first remove requests that could have been done for the same
141 * information. Happens when two viewers ask for it before servicing
144 if(!lttvwindowtraces_background_request_find(trace
, "state"))
145 lttvwindowtraces_background_request_queue(
146 main_window_get_widget(resourceview_data
->tab
), trace
, "state");
147 lttvwindowtraces_background_notify_queue(resourceview_data
,
151 background_ready_hook
);
152 resourceview_data
->background_info_waiting
++;
153 } else { /* in progress */
155 lttvwindowtraces_background_notify_current(resourceview_data
,
159 background_ready_hook
);
160 resourceview_data
->background_info_waiting
++;
163 /* Data ready. By its nature, this viewer doesn't need to have
164 * its data ready hook called there, because a background
165 * request is always linked with a redraw.
170 lttv_hooks_destroy(background_ready_hook
);
175 * Event Viewer's constructor hook
177 * This constructor is given as a parameter to the menuitem and toolbar button
178 * registration. It creates the list.
179 * @param tab A pointer to the parent tab.
180 * @return The widget created.
183 h_resourceview(LttvPlugin
*plugin
)
185 LttvPluginTab
*ptab
= LTTV_PLUGIN_TAB(plugin
);
186 Tab
*tab
= ptab
->tab
;
187 g_info("h_guicontrolflow, %p", tab
);
188 ControlFlowData
*resourceview_data
= resourceview(ptab
);
190 resourceview_data
->tab
= tab
;
192 // Unreg done in the GuiControlFlow_Destructor
193 lttvwindow_register_traceset_notify(tab
,
197 lttvwindow_register_time_window_notify(tab
,
198 update_time_window_hook
,
200 lttvwindow_register_current_time_notify(tab
,
201 update_current_time_hook
,
203 lttvwindow_register_redraw_notify(tab
,
206 lttvwindow_register_continue_notify(tab
,
209 request_background_data(resourceview_data
);
212 return guicontrolflow_get_widget(resourceview_data
) ;
216 void legend_destructor(GtkWindow
*legend
)
218 g_legend_list
= g_slist_remove(g_legend_list
, legend
);
221 /* Create a popup legend */
223 h_legend(LttvPlugin
*plugin
)
225 LttvPluginTab
*ptab
= LTTV_PLUGIN_TAB(plugin
);
226 Tab
*tab
= ptab
->tab
;
227 g_info("h_legend, %p", tab
);
229 GtkWindow
*legend
= GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL
));
231 g_legend_list
= g_slist_append(
235 g_object_set_data_full(
239 (GDestroyNotify
)legend_destructor
);
241 gtk_window_set_title(legend
, "Control Flow View Legend");
243 GtkWidget
*pixmap
= create_pixmap(GTK_WIDGET(legend
), "lttv-color-list.png");
245 gtk_container_add(GTK_CONTAINER(legend
), GTK_WIDGET(pixmap
));
247 gtk_widget_show(GTK_WIDGET(pixmap
));
248 gtk_widget_show(GTK_WIDGET(legend
));
251 return NULL
; /* This is a popup window */
255 int event_selected_hook(void *hook_data
, void *call_data
)
257 guint
*event_number
= (guint
*) call_data
;
259 g_debug("DEBUG : event selected by main window : %u", *event_number
);
264 static void cpu_set_line_color(PropertiesLine
*prop_line
, LttvCPUState
*s
)
266 GQuark present_state
;
268 if(s
->mode_stack
->len
== 0)
269 present_state
= LTTV_CPU_UNKNOWN
;
271 present_state
= ((GQuark
*)s
->mode_stack
->data
)[s
->mode_stack
->len
-1];
273 if(present_state
== LTTV_CPU_IDLE
) {
274 prop_line
->color
= drawing_colors_cpu
[COL_CPU_IDLE
];
276 else if(present_state
== LTTV_CPU_BUSY
) {
277 prop_line
->color
= drawing_colors_cpu
[COL_CPU_BUSY
];
279 else if(present_state
== LTTV_CPU_IRQ
) {
280 prop_line
->color
= drawing_colors_cpu
[COL_CPU_IRQ
];
282 else if(present_state
== LTTV_CPU_SOFT_IRQ
) {
283 prop_line
->color
= drawing_colors_cpu
[COL_CPU_SOFT_IRQ
];
285 else if(present_state
== LTTV_CPU_TRAP
) {
286 prop_line
->color
= drawing_colors_cpu
[COL_CPU_TRAP
];
288 prop_line
->color
= drawing_colors_cpu
[COL_CPU_UNKNOWN
];
292 static void irq_set_line_color(PropertiesLine
*prop_line
, LttvIRQState
*s
)
294 GQuark present_state
;
295 if(s
->mode_stack
->len
== 0)
296 present_state
= LTTV_IRQ_UNKNOWN
;
298 present_state
= ((GQuark
*)s
->mode_stack
->data
)[s
->mode_stack
->len
-1];
300 if(present_state
== LTTV_IRQ_IDLE
) {
301 prop_line
->color
= drawing_colors_irq
[COL_IRQ_IDLE
];
303 else if(present_state
== LTTV_IRQ_BUSY
) {
304 prop_line
->color
= drawing_colors_irq
[COL_IRQ_BUSY
];
307 prop_line
->color
= drawing_colors_irq
[COL_IRQ_UNKNOWN
];
311 static void soft_irq_set_line_color(PropertiesLine
*prop_line
, LttvSoftIRQState
*s
)
314 prop_line
->color
= drawing_colors_soft_irq
[COL_SOFT_IRQ_BUSY
];
316 prop_line
->color
= drawing_colors_soft_irq
[COL_SOFT_IRQ_PENDING
];
318 prop_line
->color
= drawing_colors_soft_irq
[COL_SOFT_IRQ_IDLE
];
321 static void trap_set_line_color(PropertiesLine
*prop_line
, LttvTrapState
*s
)
324 prop_line
->color
= drawing_colors_trap
[COL_TRAP_IDLE
];
326 prop_line
->color
= drawing_colors_trap
[COL_TRAP_BUSY
];
329 static void bdev_set_line_color(PropertiesLine
*prop_line
, LttvBdevState
*s
)
331 GQuark present_state
;
332 if(s
== 0 || s
->mode_stack
->len
== 0)
333 present_state
= LTTV_BDEV_UNKNOWN
;
335 present_state
= ((GQuark
*)s
->mode_stack
->data
)[s
->mode_stack
->len
-1];
337 if(present_state
== LTTV_BDEV_IDLE
) {
338 prop_line
->color
= drawing_colors_bdev
[COL_BDEV_IDLE
];
340 else if(present_state
== LTTV_BDEV_BUSY_READING
) {
341 prop_line
->color
= drawing_colors_bdev
[COL_BDEV_BUSY_READING
];
343 else if(present_state
== LTTV_BDEV_BUSY_WRITING
) {
344 prop_line
->color
= drawing_colors_bdev
[COL_BDEV_BUSY_WRITING
];
347 prop_line
->color
= drawing_colors_bdev
[COL_BDEV_UNKNOWN
];
351 /* before_schedchange_hook
353 * This function basically draw lines and icons. Two types of lines are drawn :
354 * one small (3 pixels?) representing the state of the process and the second
355 * type is thicker (10 pixels?) representing on which CPU a process is running
356 * (and this only in running state).
358 * Extremums of the lines :
359 * x_min : time of the last event context for this process kept in memory.
360 * x_max : time of the current event.
361 * y : middle of the process in the process list. The process is found in the
362 * list, therefore is it's position in pixels.
364 * The choice of lines'color is defined by the context of the last event for this
369 int before_schedchange_hook(void *hook_data
, void *call_data
)
375 event
= (LttvEvent
*) call_data
;
376 if (strcmp(lttv_traceset_get_name_from_event(event
),"sched_switch") != 0)
379 ControlFlowData
*resourceview_data
= (ControlFlowData
*)hook_data
;
381 LttTime evtime
= lttv_event_get_timestamp(event
);
383 /* we are in a schedchange, before the state update. We must draw the
384 * items corresponding to the state before it changes : now is the right
389 pid_out
= lttv_event_get_long(event
, "prev_tid");
390 // TODO: can't we reenable this? pmf
391 // if(pid_in != 0 && pid_out != 0) {
392 // /* not a transition to/from idle */
397 guint cpu
= lttv_traceset_get_cpuid_from_event(event
);
400 guint trace_num
= lttv_traceset_get_trace_index_from_event(event
);
402 /* Add process to process list (if not present) */
403 HashedResourceData
*hashed_process_data
= NULL
;
405 hashed_process_data
= resourcelist_obtain_cpu(resourceview_data
, trace_num
, cpu
);
407 /* Now, the process is in the state hash and our own process hash.
408 * We definitely can draw the items related to the ending state.
411 if(ltt_time_compare(hashed_process_data
->next_good_time
,
414 if(hashed_process_data
->x
.middle_marked
== FALSE
) {
416 TimeWindow time_window
=
417 lttvwindow_get_time_window(resourceview_data
->tab
);
419 if(ltt_time_compare(evtime
, time_window
.start_time
) == -1
420 || ltt_time_compare(evtime
, time_window
.end_time
) == 1)
423 Drawing_t
*drawing
= resourceview_data
->drawing
;
424 guint width
= drawing
->width
;
426 convert_time_to_pixels(
432 /* Draw collision indicator */
433 gdk_gc_set_foreground(drawing
->gc
, &drawing_colors
[COL_WHITE
]);
434 gdk_draw_point(hashed_process_data
->pixmap
,
437 COLLISION_POSITION(hashed_process_data
->height
));
438 hashed_process_data
->x
.middle_marked
= TRUE
;
441 TimeWindow time_window
=
442 lttvwindow_get_time_window(resourceview_data
->tab
);
444 if(ltt_time_compare(evtime
, time_window
.start_time
) == -1
445 || ltt_time_compare(evtime
, time_window
.end_time
) == 1)
448 Drawing_t
*drawing
= resourceview_data
->drawing
;
449 guint width
= drawing
->width
;
451 convert_time_to_pixels(
457 /* Jump over draw if we are at the same x position */
458 if(x
== hashed_process_data
->x
.middle
&&
459 hashed_process_data
->x
.middle_used
)
461 if(hashed_process_data
->x
.middle_marked
== FALSE
) {
462 /* Draw collision indicator */
463 gdk_gc_set_foreground(drawing
->gc
, &drawing_colors
[COL_WHITE
]);
464 gdk_draw_point(hashed_process_data
->pixmap
,
467 COLLISION_POSITION(hashed_process_data
->height
));
468 hashed_process_data
->x
.middle_marked
= TRUE
;
472 DrawContext draw_context
;
474 /* Now create the drawing context that will be used to draw
475 * items related to the last state. */
476 draw_context
.drawable
= hashed_process_data
->pixmap
;
477 draw_context
.gc
= drawing
->gc
;
478 draw_context
.pango_layout
= drawing
->pango_layout
;
479 draw_context
.drawinfo
.start
.x
= hashed_process_data
->x
.middle
;
480 draw_context
.drawinfo
.end
.x
= x
;
482 draw_context
.drawinfo
.y
.over
= 1;
483 draw_context
.drawinfo
.y
.middle
= (hashed_process_data
->height
/2);
484 draw_context
.drawinfo
.y
.under
= hashed_process_data
->height
;
486 draw_context
.drawinfo
.start
.offset
.over
= 0;
487 draw_context
.drawinfo
.start
.offset
.middle
= 0;
488 draw_context
.drawinfo
.start
.offset
.under
= 0;
489 draw_context
.drawinfo
.end
.offset
.over
= 0;
490 draw_context
.drawinfo
.end
.offset
.middle
= 0;
491 draw_context
.drawinfo
.end
.offset
.under
= 0;
495 //PropertiesLine prop_line = prepare_s_e_line(process);
496 PropertiesLine prop_line
;
497 prop_line
.line_width
= STATE_LINE_WIDTH
;
498 prop_line
.style
= GDK_LINE_SOLID
;
499 prop_line
.y
= MIDDLE
;
500 cpu_set_line_color(&prop_line
, &(ts
->cpu_states
[cpu
]));
501 draw_line((void*)&prop_line
, (void*)&draw_context
);
504 /* become the last x position */
505 hashed_process_data
->x
.middle
= x
;
506 hashed_process_data
->x
.middle_used
= TRUE
;
507 hashed_process_data
->x
.middle_marked
= FALSE
;
509 /* Calculate the next good time */
510 convert_pixels_to_time(width
, x
+1, time_window
,
511 &hashed_process_data
->next_good_time
);
518 /* after_schedchange_hook
520 * The draw after hook is called by the reading API to have a
521 * particular event drawn on the screen.
522 * @param hook_data ControlFlowData structure of the viewer.
523 * @param call_data Event context.
525 * This function adds items to be drawn in a queue for each process.
528 int after_schedchange_hook(void *hook_data
, void *call_data
)
532 event
= (LttvEvent
*) call_data
;
534 if (strcmp(lttv_traceset_get_name_from_event(event
),"sched_switch") != 0)
537 ControlFlowData
*resourceview_data
= (ControlFlowData
*) hook_data
;
539 LttvTraceState
*ts
= event
->state
;
541 LttvFilter
*filter
= resourceview_data
->filter
;
542 if(filter
!= NULL
&& filter
->head
!= NULL
)
543 if(!lttv_filter_tree_parse(filter
->head
,e
,tfc
->tf
,
544 tfc
->t_context
->t
,tfc
,NULL
,NULL
))
548 LttTime evtime
= lttv_event_get_timestamp(event
);
550 /* Add process to process list (if not present) */
551 LttvProcessState
*process_in
;
552 HashedResourceData
*hashed_process_data_in
= NULL
;
554 ProcessList
*process_list
= resourceview_data
->process_list
;
556 /* Find process pid_in in the list... */
557 //process_in = lttv_state_find_process(ts, ANY_CPU, pid_in);
558 //process_in = tfs->process;
559 guint cpu
= lttv_traceset_get_cpuid_from_event(event
);
560 guint trace_num
= lttv_traceset_get_trace_index_from_event(event
);
561 process_in
= ts
->running_process
[cpu
];
562 /* It should exist, because we are after the state update. */
564 g_assert(process_in
!= NULL
);
567 //hashed_process_data_in = processlist_get_process_data(process_list, cpuq, trace_num);
568 hashed_process_data_in
= resourcelist_obtain_cpu(resourceview_data
, trace_num
, cpu
);
570 /* Set the current process */
571 process_list
->current_hash_data
[trace_num
][process_in
->cpu
] =
572 hashed_process_data_in
;
574 if(ltt_time_compare(hashed_process_data_in
->next_good_time
,
577 TimeWindow time_window
=
578 lttvwindow_get_time_window(resourceview_data
->tab
);
581 if(ltt_time_compare(evtime
, time_window
.start_time
) == -1
582 || ltt_time_compare(evtime
, time_window
.end_time
) == 1)
585 Drawing_t
*drawing
= resourceview_data
->drawing
;
586 guint width
= drawing
->width
;
589 convert_time_to_pixels(
595 if(hashed_process_data_in
->x
.middle
!= new_x
) {
596 hashed_process_data_in
->x
.middle
= new_x
;
597 hashed_process_data_in
->x
.middle_used
= FALSE
;
598 hashed_process_data_in
->x
.middle_marked
= FALSE
;
604 int before_execmode_hook_irq(void *hook_data
, void *call_data
);
605 int before_execmode_hook_soft_irq(void *hook_data
, void *call_data
);
606 int before_execmode_hook_trap(void *hook_data
, void *call_data
);
608 /* before_execmode_hook
610 * This function basically draw lines and icons. Two types of lines are drawn :
611 * one small (3 pixels?) representing the state of the process and the second
612 * type is thicker (10 pixels?) representing on which CPU a process is running
613 * (and this only in running state).
615 * Extremums of the lines :
616 * x_min : time of the last event context for this process kept in memory.
617 * x_max : time of the current event.
618 * y : middle of the process in the process list. The process is found in the
619 * list, therefore is it's position in pixels.
621 * The choice of lines'color is defined by the context of the last event for this
625 int before_execmode_hook(void *hook_data
, void *call_data
)
631 LttvProcessState
*process
;
633 before_execmode_hook_irq(hook_data
, call_data
);
634 before_execmode_hook_soft_irq(hook_data
, call_data
);
636 before_execmode_hook_trap(hook_data
, call_data
);
638 /* we are in a execmode, before the state update. We must draw the
639 * items corresponding to the state before it changes : now is the right
642 event
= (LttvEvent
*) call_data
;
643 if ((strncmp(lttv_traceset_get_name_from_event(event
),"sys_", sizeof("sys_") - 1) == 0)
644 ||(strcmp(lttv_traceset_get_name_from_event(event
),"exit_syscall") == 0)
645 ||(strncmp(lttv_traceset_get_name_from_event(event
),"irq_handler_",sizeof("irq_handler_") -1) == 0)
646 ||(strncmp(lttv_traceset_get_name_from_event(event
),"softirq_", sizeof("softirq_") - 1) == 0)) {
648 LttTime evtime
= lttv_event_get_timestamp(event
);
649 ControlFlowData
*resourceview_data
= (ControlFlowData
*)hook_data
;
652 LttvTraceset
*traceSet
= lttvwindow_get_traceset(resourceview_data
->tab
);
654 cpu
= lttv_traceset_get_cpuid_from_event(event
);
657 guint trace_num
= lttv_traceset_get_trace_index_from_event(event
);
659 process
= ts
->running_process
[cpu
];
660 g_assert(process
!= NULL
);
662 /* Well, the process_out existed : we must get it in the process hash
663 * or add it, and draw its items.
665 /* Add process to process list (if not present) */
666 HashedResourceData
*hashed_process_data
= NULL
;
667 ProcessList
*process_list
= resourceview_data
->process_list
;
669 if(likely(process_list
->current_hash_data
[trace_num
][cpu
] != NULL
)) {
670 hashed_process_data
= process_list
->current_hash_data
[trace_num
][cpu
];
672 hashed_process_data
= resourcelist_obtain_cpu(resourceview_data
, trace_num
, cpu
);
674 /* Set the current process */
675 process_list
->current_hash_data
[trace_num
][process
->cpu
] =
679 /* Now, the process is in the state hash and our own process hash.
680 * We definitely can draw the items related to the ending state.
683 if(likely(ltt_time_compare(hashed_process_data
->next_good_time
,
686 if(unlikely(hashed_process_data
->x
.middle_marked
== FALSE
)) {
687 TimeWindow time_window
=
688 lttvwindow_get_time_window(resourceview_data
->tab
);
691 if(ltt_time_compare(evtime
, time_window
.start_time
) == -1
692 || ltt_time_compare(evtime
, time_window
.end_time
) == 1)
695 Drawing_t
*drawing
= resourceview_data
->drawing
;
696 guint width
= drawing
->width
;
698 convert_time_to_pixels(
704 /* Draw collision indicator */
705 gdk_gc_set_foreground(drawing
->gc
, &drawing_colors
[COL_WHITE
]);
706 gdk_draw_point(hashed_process_data
->pixmap
,
709 COLLISION_POSITION(hashed_process_data
->height
));
710 hashed_process_data
->x
.middle_marked
= TRUE
;
714 TimeWindow time_window
=
715 lttvwindow_get_time_window(resourceview_data
->tab
);
718 if(ltt_time_compare(evtime
, time_window
.start_time
) == -1
719 || ltt_time_compare(evtime
, time_window
.end_time
) == 1)
722 Drawing_t
*drawing
= resourceview_data
->drawing
;
723 guint width
= drawing
->width
;
726 convert_time_to_pixels(
733 /* Jump over draw if we are at the same x position */
734 if(unlikely(x
== hashed_process_data
->x
.middle
&&
735 hashed_process_data
->x
.middle_used
))
737 if(unlikely(hashed_process_data
->x
.middle_marked
== FALSE
)) {
738 /* Draw collision indicator */
739 gdk_gc_set_foreground(drawing
->gc
, &drawing_colors
[COL_WHITE
]);
740 gdk_draw_point(hashed_process_data
->pixmap
,
743 COLLISION_POSITION(hashed_process_data
->height
));
744 hashed_process_data
->x
.middle_marked
= TRUE
;
750 DrawContext draw_context
;
751 /* Now create the drawing context that will be used to draw
752 * items related to the last state. */
753 draw_context
.drawable
= hashed_process_data
->pixmap
;
754 draw_context
.gc
= drawing
->gc
;
755 draw_context
.pango_layout
= drawing
->pango_layout
;
756 draw_context
.drawinfo
.start
.x
= hashed_process_data
->x
.middle
;
757 draw_context
.drawinfo
.end
.x
= x
;
759 draw_context
.drawinfo
.y
.over
= 1;
760 draw_context
.drawinfo
.y
.middle
= (hashed_process_data
->height
/2);
761 draw_context
.drawinfo
.y
.under
= hashed_process_data
->height
;
763 draw_context
.drawinfo
.start
.offset
.over
= 0;
764 draw_context
.drawinfo
.start
.offset
.middle
= 0;
765 draw_context
.drawinfo
.start
.offset
.under
= 0;
766 draw_context
.drawinfo
.end
.offset
.over
= 0;
767 draw_context
.drawinfo
.end
.offset
.middle
= 0;
768 draw_context
.drawinfo
.end
.offset
.under
= 0;
772 PropertiesLine prop_line
;
773 prop_line
.line_width
= STATE_LINE_WIDTH
;
774 prop_line
.style
= GDK_LINE_SOLID
;
775 prop_line
.y
= MIDDLE
;
776 cpu_set_line_color(&prop_line
, &ts
->cpu_states
[cpu
]);
777 draw_line((void*)&prop_line
, (void*)&draw_context
);
779 /* become the last x position */
780 hashed_process_data
->x
.middle
= x
;
781 hashed_process_data
->x
.middle_used
= TRUE
;
782 hashed_process_data
->x
.middle_marked
= FALSE
;
784 /* Calculate the next good time */
785 convert_pixels_to_time(width
, x
+1, time_window
,
786 &hashed_process_data
->next_good_time
);
793 int before_execmode_hook_irq(void *hook_data
, void *call_data
)
797 event
= (LttvEvent
*) call_data
;
799 LttTime evtime
= lttv_event_get_timestamp(event
);
800 ControlFlowData
*resourceview_data
= (ControlFlowData
*)hook_data
;
802 /* we are in a execmode, before the state update. We must draw the
803 * items corresponding to the state before it changes : now is the right
809 guint cpu
= lttv_traceset_get_cpuid_from_event(event
);
810 LttvTraceset
*traceSet
= lttvwindow_get_traceset(resourceview_data
->tab
);
811 LttvTraceState
*ts
= event
->state
;;
814 * Check for LTT_CHANNEL_KERNEL channel name and event ID
815 * corresponding to LTT_EVENT_IRQ_ENTRY or LTT_EVENT_IRQ_EXIT.
817 if (strncmp(lttv_traceset_get_name_from_event(event
),"irq_handler_entry",sizeof("irq_handler_entry")) == 0) {
818 irq
= lttv_event_get_long(event
, "irq");
819 } else if (strncmp(lttv_traceset_get_name_from_event(event
),"irq_handler_exit",sizeof("irq_handler_exit")) == 0) {
820 gint len
= ts
->cpu_states
[cpu
].irq_stack
->len
;
822 irq
= g_array_index(ts
->cpu_states
[cpu
].irq_stack
, gint
, len
-1);
830 guint trace_num
= lttv_traceset_get_trace_index_from_event(event
);
832 /* Well, the process_out existed : we must get it in the process hash
833 * or add it, and draw its items.
835 /* Add process to process list (if not present) */
836 HashedResourceData
*hashed_process_data
= NULL
;
838 hashed_process_data
= resourcelist_obtain_irq(resourceview_data
, trace_num
, irq
);
839 // TODO: fix this, it's ugly and slow:
843 str
= g_strdup_printf("IRQ %" PRIu64
" [%s]", irq
,
844 (char*)g_quark_to_string(ts
->name_tables
->irq_names
[irq
]));
845 name
= g_quark_from_string(str
);
848 gtk_tree_store_set(resourceview_data
->process_list
->list_store
, &hashed_process_data
->y_iter
, NAME_COLUMN
, g_quark_to_string(name
), -1);
850 /* Now, the process is in the state hash and our own process hash.
851 * We definitely can draw the items related to the ending state.
854 if(likely(ltt_time_compare(hashed_process_data
->next_good_time
,
857 if(unlikely(hashed_process_data
->x
.middle_marked
== FALSE
)) {
858 TimeWindow time_window
=
859 lttvwindow_get_time_window(resourceview_data
->tab
);
862 if(ltt_time_compare(evtime
, time_window
.start_time
) == -1
863 || ltt_time_compare(evtime
, time_window
.end_time
) == 1)
866 Drawing_t
*drawing
= resourceview_data
->drawing
;
867 guint width
= drawing
->width
;
869 convert_time_to_pixels(
875 /* Draw collision indicator */
876 gdk_gc_set_foreground(drawing
->gc
, &drawing_colors
[COL_WHITE
]);
877 gdk_draw_point(hashed_process_data
->pixmap
,
880 COLLISION_POSITION(hashed_process_data
->height
));
881 hashed_process_data
->x
.middle_marked
= TRUE
;
885 TimeWindow time_window
=
886 lttvwindow_get_time_window(resourceview_data
->tab
);
889 if(ltt_time_compare(evtime
, time_window
.start_time
) == -1
890 || ltt_time_compare(evtime
, time_window
.end_time
) == 1)
893 Drawing_t
*drawing
= resourceview_data
->drawing
;
894 guint width
= drawing
->width
;
897 convert_time_to_pixels(
904 /* Jump over draw if we are at the same x position */
905 if(unlikely(x
== hashed_process_data
->x
.middle
&&
906 hashed_process_data
->x
.middle_used
))
908 if(unlikely(hashed_process_data
->x
.middle_marked
== FALSE
)) {
909 /* Draw collision indicator */
910 gdk_gc_set_foreground(drawing
->gc
, &drawing_colors
[COL_WHITE
]);
911 gdk_draw_point(hashed_process_data
->pixmap
,
914 COLLISION_POSITION(hashed_process_data
->height
));
915 hashed_process_data
->x
.middle_marked
= TRUE
;
921 DrawContext draw_context
;
922 /* Now create the drawing context that will be used to draw
923 * items related to the last state. */
924 draw_context
.drawable
= hashed_process_data
->pixmap
;
925 draw_context
.gc
= drawing
->gc
;
926 draw_context
.pango_layout
= drawing
->pango_layout
;
927 draw_context
.drawinfo
.start
.x
= hashed_process_data
->x
.middle
;
928 draw_context
.drawinfo
.end
.x
= x
;
930 draw_context
.drawinfo
.y
.over
= 1;
931 draw_context
.drawinfo
.y
.middle
= (hashed_process_data
->height
/2);
932 draw_context
.drawinfo
.y
.under
= hashed_process_data
->height
;
934 draw_context
.drawinfo
.start
.offset
.over
= 0;
935 draw_context
.drawinfo
.start
.offset
.middle
= 0;
936 draw_context
.drawinfo
.start
.offset
.under
= 0;
937 draw_context
.drawinfo
.end
.offset
.over
= 0;
938 draw_context
.drawinfo
.end
.offset
.middle
= 0;
939 draw_context
.drawinfo
.end
.offset
.under
= 0;
943 PropertiesLine prop_line
;
944 prop_line
.line_width
= STATE_LINE_WIDTH
;
945 prop_line
.style
= GDK_LINE_SOLID
;
946 prop_line
.y
= MIDDLE
;
947 irq_set_line_color(&prop_line
, &ts
->irq_states
[irq
]);
948 draw_line((void*)&prop_line
, (void*)&draw_context
);
950 /* become the last x position */
951 hashed_process_data
->x
.middle
= x
;
952 hashed_process_data
->x
.middle_used
= TRUE
;
953 hashed_process_data
->x
.middle_marked
= FALSE
;
955 /* Calculate the next good time */
956 convert_pixels_to_time(width
, x
+1, time_window
,
957 &hashed_process_data
->next_good_time
);
964 int before_execmode_hook_soft_irq(void *hook_data
, void *call_data
)
970 event
= (LttvEvent
*) call_data
;
975 /* we are in a execmode, before the state update. We must draw the
976 * items corresponding to the state before it changes : now is the right
985 * Check for LTT_CHANNEL_KERNEL channel name and event ID
986 * corresponding to LTT_EVENT_SOFT_IRQ_RAISE, LTT_EVENT_SOFT_IRQ_ENTRY
987 * or LTT_EVENT_SOFT_IRQ_EXIT.
990 if (strncmp(lttv_traceset_get_name_from_event(event
),"softirq_entry",sizeof("softirq_entry")) == 0
991 || strncmp(lttv_traceset_get_name_from_event(event
),"softirq_raise",sizeof("softirq_raise")) == 0
992 || strncmp(lttv_traceset_get_name_from_event(event
),"softirq_exit",sizeof("softirq_exit")) == 0 ) {
994 softirq
= lttv_event_get_long_unsigned(event
, "vec");
1000 LttTime evtime
= lttv_event_get_timestamp(event
);
1001 ControlFlowData
*resourceview_data
= (ControlFlowData
*)hook_data
;
1002 LttvTraceset
*traceSet
= lttvwindow_get_traceset(resourceview_data
->tab
);
1003 guint cpu
= lttv_traceset_get_cpuid_from_event(event
);
1005 guint trace_num
= lttv_traceset_get_trace_index_from_event(event
);
1007 /* Well, the process_out existed : we must get it in the process hash
1008 * or add it, and draw its items.
1010 /* Add process to process list (if not present) */
1011 HashedResourceData
*hashed_process_data
= NULL
;
1013 hashed_process_data
= resourcelist_obtain_soft_irq(resourceview_data
, trace_num
, softirq
);
1015 /* Now, the process is in the state hash and our own process hash.
1016 * We definitely can draw the items related to the ending state.
1019 if(likely(ltt_time_compare(hashed_process_data
->next_good_time
,
1022 if(unlikely(hashed_process_data
->x
.middle_marked
== FALSE
)) {
1023 TimeWindow time_window
=
1024 lttvwindow_get_time_window(resourceview_data
->tab
);
1027 if(ltt_time_compare(evtime
, time_window
.start_time
) == -1
1028 || ltt_time_compare(evtime
, time_window
.end_time
) == 1)
1030 #endif //EXTRA_CHECK
1031 Drawing_t
*drawing
= resourceview_data
->drawing
;
1032 guint width
= drawing
->width
;
1034 convert_time_to_pixels(
1040 /* Draw collision indicator */
1041 gdk_gc_set_foreground(drawing
->gc
, &drawing_colors
[COL_WHITE
]);
1042 gdk_draw_point(hashed_process_data
->pixmap
,
1045 COLLISION_POSITION(hashed_process_data
->height
));
1046 hashed_process_data
->x
.middle_marked
= TRUE
;
1050 TimeWindow time_window
=
1051 lttvwindow_get_time_window(resourceview_data
->tab
);
1054 if(ltt_time_compare(evtime
, time_window
.start_time
) == -1
1055 || ltt_time_compare(evtime
, time_window
.end_time
) == 1)
1057 #endif //EXTRA_CHECK
1058 Drawing_t
*drawing
= resourceview_data
->drawing
;
1059 guint width
= drawing
->width
;
1062 convert_time_to_pixels(
1069 /* Jump over draw if we are at the same x position */
1070 if(unlikely(x
== hashed_process_data
->x
.middle
&&
1071 hashed_process_data
->x
.middle_used
))
1073 if(unlikely(hashed_process_data
->x
.middle_marked
== FALSE
)) {
1074 /* Draw collision indicator */
1075 gdk_gc_set_foreground(drawing
->gc
, &drawing_colors
[COL_WHITE
]);
1076 gdk_draw_point(hashed_process_data
->pixmap
,
1079 COLLISION_POSITION(hashed_process_data
->height
));
1080 hashed_process_data
->x
.middle_marked
= TRUE
;
1086 DrawContext draw_context
;
1087 /* Now create the drawing context that will be used to draw
1088 * items related to the last state. */
1089 draw_context
.drawable
= hashed_process_data
->pixmap
;
1090 draw_context
.gc
= drawing
->gc
;
1091 draw_context
.pango_layout
= drawing
->pango_layout
;
1092 draw_context
.drawinfo
.start
.x
= hashed_process_data
->x
.middle
;
1093 draw_context
.drawinfo
.end
.x
= x
;
1095 draw_context
.drawinfo
.y
.over
= 1;
1096 draw_context
.drawinfo
.y
.middle
= (hashed_process_data
->height
/2);
1097 draw_context
.drawinfo
.y
.under
= hashed_process_data
->height
;
1099 draw_context
.drawinfo
.start
.offset
.over
= 0;
1100 draw_context
.drawinfo
.start
.offset
.middle
= 0;
1101 draw_context
.drawinfo
.start
.offset
.under
= 0;
1102 draw_context
.drawinfo
.end
.offset
.over
= 0;
1103 draw_context
.drawinfo
.end
.offset
.middle
= 0;
1104 draw_context
.drawinfo
.end
.offset
.under
= 0;
1108 PropertiesLine prop_line
;
1109 prop_line
.line_width
= STATE_LINE_WIDTH
;
1110 prop_line
.style
= GDK_LINE_SOLID
;
1111 prop_line
.y
= MIDDLE
;
1112 soft_irq_set_line_color(&prop_line
, &ts
->soft_irq_states
[softirq
]);
1113 draw_line((void*)&prop_line
, (void*)&draw_context
);
1115 /* become the last x position */
1116 hashed_process_data
->x
.middle
= x
;
1117 hashed_process_data
->x
.middle_used
= TRUE
;
1118 hashed_process_data
->x
.middle_marked
= FALSE
;
1120 /* Calculate the next good time */
1121 convert_pixels_to_time(width
, x
+1, time_window
,
1122 &hashed_process_data
->next_good_time
);
1128 #ifdef TRAP_NO_EXIST
1129 int before_execmode_hook_trap(void *hook_data
, void *call_data
)
1131 LttvTraceHook
*th
= (LttvTraceHook
*)hook_data
;
1132 EventsRequest
*events_request
= (EventsRequest
*)th
->hook_data
;
1133 ControlFlowData
*resourceview_data
= events_request
->viewer_data
;
1135 LttvTracefileContext
*tfc
= (LttvTracefileContext
*)call_data
;
1137 LttvTracefileState
*tfs
= (LttvTracefileState
*)call_data
;
1138 LttvTraceState
*ts
= (LttvTraceState
*)tfc
->t_context
;
1139 struct marker_info
*minfo
;
1142 e
= ltt_tracefile_get_event(tfc
->tf
);
1144 LttTime evtime
= ltt_event_time(e
);
1146 /* we are in a execmode, before the state update. We must draw the
1147 * items corresponding to the state before it changes : now is the right
1153 guint cpu
= tfs
->cpu
;
1156 * Check for LTT_CHANNEL_KERNEL channel name and event ID
1157 * corresponding to LTT_EVENT_TRAP/PAGE_FAULT_ENTRY or
1158 * LTT_EVENT_TRAP/PAGE_FAULT_EXIT.
1160 if (tfc
->tf
->name
!= LTT_CHANNEL_KERNEL
)
1162 minfo
= marker_get_info_from_id(tfc
->tf
->mdata
, e
->event_id
);
1163 g_assert(minfo
!= NULL
);
1164 if (minfo
->name
== LTT_EVENT_TRAP_ENTRY
1165 || minfo
->name
== LTT_EVENT_PAGE_FAULT_ENTRY
1166 || minfo
->name
== LTT_EVENT_PAGE_FAULT_NOSEM_ENTRY
) {
1167 trap
= ltt_event_get_long_unsigned(e
, lttv_trace_get_hook_field(th
, 0));
1168 } else if (minfo
->name
== LTT_EVENT_TRAP_EXIT
1169 || minfo
->name
== LTT_EVENT_PAGE_FAULT_EXIT
1170 || minfo
->name
== LTT_EVENT_PAGE_FAULT_NOSEM_EXIT
) {
1171 gint len
= ts
->cpu_states
[cpu
].trap_stack
->len
;
1173 trap
= g_array_index(ts
->cpu_states
[cpu
].trap_stack
, gint
, len
-1);
1181 guint trace_num
= ts
->parent
.index
;
1183 /* Well, the process_out existed : we must get it in the process hash
1184 * or add it, and draw its items.
1186 /* Add process to process list (if not present) */
1187 HashedResourceData
*hashed_process_data
= NULL
;
1189 hashed_process_data
= resourcelist_obtain_trap(resourceview_data
, trace_num
, trap
);
1191 /* Now, the process is in the state hash and our own process hash.
1192 * We definitely can draw the items related to the ending state.
1195 if(likely(ltt_time_compare(hashed_process_data
->next_good_time
,
1198 if(unlikely(hashed_process_data
->x
.middle_marked
== FALSE
)) {
1199 TimeWindow time_window
=
1200 lttvwindow_get_time_window(resourceview_data
->tab
);
1203 if(ltt_time_compare(evtime
, time_window
.start_time
) == -1
1204 || ltt_time_compare(evtime
, time_window
.end_time
) == 1)
1206 #endif //EXTRA_CHECK
1207 Drawing_t
*drawing
= resourceview_data
->drawing
;
1208 guint width
= drawing
->width
;
1210 convert_time_to_pixels(
1216 /* Draw collision indicator */
1217 gdk_gc_set_foreground(drawing
->gc
, &drawing_colors
[COL_WHITE
]);
1218 gdk_draw_point(hashed_process_data
->pixmap
,
1221 COLLISION_POSITION(hashed_process_data
->height
));
1222 hashed_process_data
->x
.middle_marked
= TRUE
;
1226 TimeWindow time_window
=
1227 lttvwindow_get_time_window(resourceview_data
->tab
);
1230 if(ltt_time_compare(evtime
, time_window
.start_time
) == -1
1231 || ltt_time_compare(evtime
, time_window
.end_time
) == 1)
1233 #endif //EXTRA_CHECK
1234 Drawing_t
*drawing
= resourceview_data
->drawing
;
1235 guint width
= drawing
->width
;
1238 convert_time_to_pixels(
1245 /* Jump over draw if we are at the same x position */
1246 if(unlikely(x
== hashed_process_data
->x
.middle
&&
1247 hashed_process_data
->x
.middle_used
))
1249 if(unlikely(hashed_process_data
->x
.middle_marked
== FALSE
)) {
1250 /* Draw collision indicator */
1251 gdk_gc_set_foreground(drawing
->gc
, &drawing_colors
[COL_WHITE
]);
1252 gdk_draw_point(hashed_process_data
->pixmap
,
1255 COLLISION_POSITION(hashed_process_data
->height
));
1256 hashed_process_data
->x
.middle_marked
= TRUE
;
1262 DrawContext draw_context
;
1263 /* Now create the drawing context that will be used to draw
1264 * items related to the last state. */
1265 draw_context
.drawable
= hashed_process_data
->pixmap
;
1266 draw_context
.gc
= drawing
->gc
;
1267 draw_context
.pango_layout
= drawing
->pango_layout
;
1268 draw_context
.drawinfo
.start
.x
= hashed_process_data
->x
.middle
;
1269 draw_context
.drawinfo
.end
.x
= x
;
1271 draw_context
.drawinfo
.y
.over
= 1;
1272 draw_context
.drawinfo
.y
.middle
= (hashed_process_data
->height
/2);
1273 draw_context
.drawinfo
.y
.under
= hashed_process_data
->height
;
1275 draw_context
.drawinfo
.start
.offset
.over
= 0;
1276 draw_context
.drawinfo
.start
.offset
.middle
= 0;
1277 draw_context
.drawinfo
.start
.offset
.under
= 0;
1278 draw_context
.drawinfo
.end
.offset
.over
= 0;
1279 draw_context
.drawinfo
.end
.offset
.middle
= 0;
1280 draw_context
.drawinfo
.end
.offset
.under
= 0;
1284 PropertiesLine prop_line
;
1285 prop_line
.line_width
= STATE_LINE_WIDTH
;
1286 prop_line
.style
= GDK_LINE_SOLID
;
1287 prop_line
.y
= MIDDLE
;
1288 trap_set_line_color(&prop_line
, &ts
->trap_states
[trap
]);
1289 draw_line((void*)&prop_line
, (void*)&draw_context
);
1291 /* become the last x position */
1292 hashed_process_data
->x
.middle
= x
;
1293 hashed_process_data
->x
.middle_used
= TRUE
;
1294 hashed_process_data
->x
.middle_marked
= FALSE
;
1296 /* Calculate the next good time */
1297 convert_pixels_to_time(width
, x
+1, time_window
,
1298 &hashed_process_data
->next_good_time
);
1305 #ifdef BABEL_CLEANUP
1306 //TODO investigate the use of block dev resource
1307 int before_bdev_event_hook(void *hook_data
, void *call_data
)
1313 LttvProcessState
*process
;
1316 /* we are in a execmode, before the state update. We must draw the
1317 * items corresponding to the state before it changes : now is the right
1321 event
= (LttvEvent
*) call_data
;
1322 if (strcmp(lttv_traceset_get_name_from_event(event
),"block_rq_issue") != 0 && strcmp(lttv_traceset_get_name_from_event(event
),"block_rq_complete") != 0)
1326 ControlFlowData
*resourceview_data
= (ControlFlowData
*) hook_data
;
1328 LttvTraceState
*ts
= event
->state
;
1331 guint8 major
= ltt_event_get_long_unsigned(e
, lttv_trace_get_hook_field(th
, 0));
1332 guint8 minor
= ltt_event_get_long_unsigned(e
, lttv_trace_get_hook_field(th
, 1));
1333 gint devcode_gint
= MKDEV(major
,minor
);
1335 guint trace_num
= lttv_traceset_get_trace_index_from_event(event
);
1337 LttvBdevState
*bdev
= g_hash_table_lookup(ts
->bdev_states
, &devcode_gint
);
1338 /* the result of the lookup might be NULL. that's ok, the rest of the function
1339 should understand it was not found and that its state is unknown */
1341 /* Well, the process_out existed : we must get it in the process hash
1342 * or add it, and draw its items.
1344 /* Add process to process list (if not present) */
1345 HashedResourceData
*hashed_process_data
= NULL
;
1346 // LttTime birth = process->creation_time;
1348 // if(likely(process_list->current_hash_data[trace_num][cpu] != NULL)) {
1349 // hashed_process_data = process_list->current_hash_data[trace_num][cpu];
1351 hashed_process_data
= resourcelist_obtain_bdev(resourceview_data
, trace_num
, devcode_gint
);
1352 ////hashed_process_data = processlist_get_process_data(process_list, resourceq, trace_num);
1353 // hashed_process_data = processlist_get_process_data(process_list,
1359 /* Set the current process */
1360 // process_list->current_hash_data[trace_num][process->cpu] =
1361 // hashed_process_data;
1364 /* Now, the process is in the state hash and our own process hash.
1365 * We definitely can draw the items related to the ending state.
1368 if(likely(ltt_time_compare(hashed_process_data
->next_good_time
,
1371 if(unlikely(hashed_process_data
->x
.middle_marked
== FALSE
)) {
1372 TimeWindow time_window
=
1373 lttvwindow_get_time_window(resourceview_data
->tab
);
1376 if(ltt_time_compare(evtime
, time_window
.start_time
) == -1
1377 || ltt_time_compare(evtime
, time_window
.end_time
) == 1)
1379 #endif //EXTRA_CHECK
1380 Drawing_t
*drawing
= resourceview_data
->drawing
;
1381 guint width
= drawing
->width
;
1383 convert_time_to_pixels(
1389 /* Draw collision indicator */
1390 gdk_gc_set_foreground(drawing
->gc
, &drawing_colors
[COL_WHITE
]);
1391 gdk_draw_point(hashed_process_data
->pixmap
,
1394 COLLISION_POSITION(hashed_process_data
->height
));
1395 hashed_process_data
->x
.middle_marked
= TRUE
;
1399 TimeWindow time_window
=
1400 lttvwindow_get_time_window(resourceview_data
->tab
);
1403 if(ltt_time_compare(evtime
, time_window
.start_time
) == -1
1404 || ltt_time_compare(evtime
, time_window
.end_time
) == 1)
1406 #endif //EXTRA_CHECK
1407 Drawing_t
*drawing
= resourceview_data
->drawing
;
1408 guint width
= drawing
->width
;
1411 convert_time_to_pixels(
1418 /* Jump over draw if we are at the same x position */
1419 if(unlikely(x
== hashed_process_data
->x
.middle
&&
1420 hashed_process_data
->x
.middle_used
))
1422 if(unlikely(hashed_process_data
->x
.middle_marked
== FALSE
)) {
1423 /* Draw collision indicator */
1424 gdk_gc_set_foreground(drawing
->gc
, &drawing_colors
[COL_WHITE
]);
1425 gdk_draw_point(hashed_process_data
->pixmap
,
1428 COLLISION_POSITION(hashed_process_data
->height
));
1429 hashed_process_data
->x
.middle_marked
= TRUE
;
1435 DrawContext draw_context
;
1436 /* Now create the drawing context that will be used to draw
1437 * items related to the last state. */
1438 draw_context
.drawable
= hashed_process_data
->pixmap
;
1439 draw_context
.gc
= drawing
->gc
;
1440 draw_context
.pango_layout
= drawing
->pango_layout
;
1441 draw_context
.drawinfo
.start
.x
= hashed_process_data
->x
.middle
;
1442 draw_context
.drawinfo
.end
.x
= x
;
1444 draw_context
.drawinfo
.y
.over
= 1;
1445 draw_context
.drawinfo
.y
.middle
= (hashed_process_data
->height
/2);
1446 draw_context
.drawinfo
.y
.under
= hashed_process_data
->height
;
1448 draw_context
.drawinfo
.start
.offset
.over
= 0;
1449 draw_context
.drawinfo
.start
.offset
.middle
= 0;
1450 draw_context
.drawinfo
.start
.offset
.under
= 0;
1451 draw_context
.drawinfo
.end
.offset
.over
= 0;
1452 draw_context
.drawinfo
.end
.offset
.middle
= 0;
1453 draw_context
.drawinfo
.end
.offset
.under
= 0;
1457 PropertiesLine prop_line
;
1458 prop_line
.line_width
= STATE_LINE_WIDTH
;
1459 prop_line
.style
= GDK_LINE_SOLID
;
1460 prop_line
.y
= MIDDLE
;
1461 bdev_set_line_color(&prop_line
, bdev
);
1462 draw_line((void*)&prop_line
, (void*)&draw_context
);
1464 /* become the last x position */
1465 hashed_process_data
->x
.middle
= x
;
1466 hashed_process_data
->x
.middle_used
= TRUE
;
1467 hashed_process_data
->x
.middle_marked
= FALSE
;
1469 /* Calculate the next good time */
1470 convert_pixels_to_time(width
, x
+1, time_window
,
1471 &hashed_process_data
->next_good_time
);
1478 gint
update_time_window_hook(void *hook_data
, void *call_data
)
1480 ControlFlowData
*resourceview_data
= (ControlFlowData
*) hook_data
;
1481 Drawing_t
*drawing
= resourceview_data
->drawing
;
1482 ProcessList
*process_list
= resourceview_data
->process_list
;
1484 const TimeWindowNotifyData
*time_window_nofify_data
=
1485 ((const TimeWindowNotifyData
*)call_data
);
1487 TimeWindow
*old_time_window
=
1488 time_window_nofify_data
->old_time_window
;
1489 TimeWindow
*new_time_window
=
1490 time_window_nofify_data
->new_time_window
;
1492 /* Update the ruler */
1493 drawing_update_ruler(resourceview_data
->drawing
,
1497 /* Two cases : zoom in/out or scrolling */
1499 /* In order to make sure we can reuse the old drawing, the scale must
1500 * be the same and the new time interval being partly located in the
1501 * currently shown time interval. (reuse is only for scrolling)
1504 g_info("Old time window HOOK : %lu, %lu to %lu, %lu",
1505 old_time_window
->start_time
.tv_sec
,
1506 old_time_window
->start_time
.tv_nsec
,
1507 old_time_window
->time_width
.tv_sec
,
1508 old_time_window
->time_width
.tv_nsec
);
1510 g_info("New time window HOOK : %lu, %lu to %lu, %lu",
1511 new_time_window
->start_time
.tv_sec
,
1512 new_time_window
->start_time
.tv_nsec
,
1513 new_time_window
->time_width
.tv_sec
,
1514 new_time_window
->time_width
.tv_nsec
);
1516 if( new_time_window
->time_width
.tv_sec
== old_time_window
->time_width
.tv_sec
1517 && new_time_window
->time_width
.tv_nsec
== old_time_window
->time_width
.tv_nsec
)
1519 /* Same scale (scrolling) */
1520 g_info("scrolling");
1521 LttTime
*ns
= &new_time_window
->start_time
;
1522 LttTime
*os
= &old_time_window
->start_time
;
1523 LttTime old_end
= old_time_window
->end_time
;
1524 LttTime new_end
= new_time_window
->end_time
;
1526 //if(ns<os+w && os+w<ns+w)
1527 //if(ns<old_end && os<ns)
1528 if(ltt_time_compare(*ns
, old_end
) == -1
1529 && ltt_time_compare(*os
, *ns
) == -1)
1531 g_info("scrolling near right");
1532 /* Scroll right, keep right part of the screen */
1534 guint width
= resourceview_data
->drawing
->width
;
1535 convert_time_to_pixels(
1541 /* Copy old data to new location */
1542 copy_pixmap_region(process_list
,
1544 resourceview_data
->drawing
->drawing_area
->style
->black_gc
,
1548 resourceview_data
->drawing
->width
-x
+SAFETY
, -1);
1550 if(drawing
->damage_begin
== drawing
->damage_end
)
1551 drawing
->damage_begin
= resourceview_data
->drawing
->width
-x
;
1553 drawing
->damage_begin
= 0;
1555 drawing
->damage_end
= resourceview_data
->drawing
->width
;
1557 /* Clear the data request background, but not SAFETY */
1558 rectangle_pixmap(process_list
,
1559 resourceview_data
->drawing
->drawing_area
->style
->black_gc
,
1561 drawing
->damage_begin
+SAFETY
, 0,
1562 drawing
->damage_end
- drawing
->damage_begin
, // do not overlap
1564 gtk_widget_queue_draw(drawing
->drawing_area
);
1566 /* Get new data for the rest. */
1567 drawing_data_request(resourceview_data
->drawing
,
1568 drawing
->damage_begin
, 0,
1569 drawing
->damage_end
- drawing
->damage_begin
,
1570 resourceview_data
->drawing
->height
);
1572 if(ltt_time_compare(*ns
,*os
) == -1
1573 && ltt_time_compare(*os
,new_end
) == -1)
1575 g_info("scrolling near left");
1576 /* Scroll left, keep left part of the screen */
1578 guint width
= resourceview_data
->drawing
->width
;
1579 convert_time_to_pixels(
1585 /* Copy old data to new location */
1586 copy_pixmap_region (process_list
,
1588 resourceview_data
->drawing
->drawing_area
->style
->black_gc
,
1594 if(drawing
->damage_begin
== drawing
->damage_end
)
1595 drawing
->damage_end
= x
;
1597 drawing
->damage_end
=
1598 resourceview_data
->drawing
->width
;
1600 drawing
->damage_begin
= 0;
1602 rectangle_pixmap (process_list
,
1603 resourceview_data
->drawing
->drawing_area
->style
->black_gc
,
1605 drawing
->damage_begin
, 0,
1606 drawing
->damage_end
- drawing
->damage_begin
, // do not overlap
1609 gtk_widget_queue_draw(drawing
->drawing_area
);
1611 /* Get new data for the rest. */
1612 drawing_data_request(resourceview_data
->drawing
,
1613 drawing
->damage_begin
, 0,
1614 drawing
->damage_end
- drawing
->damage_begin
,
1615 resourceview_data
->drawing
->height
);
1618 if(ltt_time_compare(*ns
,*os
) == 0)
1620 g_info("not scrolling");
1622 g_info("scrolling far");
1623 /* Cannot reuse any part of the screen : far jump */
1626 rectangle_pixmap (process_list
,
1627 resourceview_data
->drawing
->drawing_area
->style
->black_gc
,
1630 resourceview_data
->drawing
->width
+SAFETY
, // do not overlap
1633 gtk_widget_queue_draw(drawing
->drawing_area
);
1635 drawing
->damage_begin
= 0;
1636 drawing
->damage_end
= resourceview_data
->drawing
->width
;
1638 drawing_data_request(resourceview_data
->drawing
,
1640 resourceview_data
->drawing
->width
,
1641 resourceview_data
->drawing
->height
);
1647 /* Different scale (zoom) */
1650 rectangle_pixmap (process_list
,
1651 resourceview_data
->drawing
->drawing_area
->style
->black_gc
,
1654 resourceview_data
->drawing
->width
+SAFETY
, // do not overlap
1657 gtk_widget_queue_draw(drawing
->drawing_area
);
1659 drawing
->damage_begin
= 0;
1660 drawing
->damage_end
= resourceview_data
->drawing
->width
;
1662 drawing_data_request(resourceview_data
->drawing
,
1664 resourceview_data
->drawing
->width
,
1665 resourceview_data
->drawing
->height
);
1668 /* Update directly when scrolling */
1669 gdk_window_process_updates(resourceview_data
->drawing
->drawing_area
->window
,
1675 gint
traceset_notify(void *hook_data
, void *call_data
)
1677 ControlFlowData
*resourceview_data
= (ControlFlowData
*) hook_data
;
1678 Drawing_t
*drawing
= resourceview_data
->drawing
;
1680 if(unlikely(drawing
->gc
== NULL
)) {
1683 if(drawing
->dotted_gc
== NULL
) {
1687 drawing_clear(resourceview_data
->drawing
);
1688 processlist_clear(resourceview_data
->process_list
);
1689 gtk_widget_set_size_request(
1690 resourceview_data
->drawing
->drawing_area
,
1691 -1, processlist_get_height(resourceview_data
->process_list
));
1692 redraw_notify(resourceview_data
, NULL
);
1694 request_background_data(resourceview_data
);
1699 gint
redraw_notify(void *hook_data
, void *call_data
)
1701 ControlFlowData
*resourceview_data
= (ControlFlowData
*) hook_data
;
1702 Drawing_t
*drawing
= resourceview_data
->drawing
;
1703 GtkWidget
*widget
= drawing
->drawing_area
;
1705 drawing
->damage_begin
= 0;
1706 drawing
->damage_end
= drawing
->width
;
1708 /* fun feature, to be separated someday... */
1709 drawing_clear(resourceview_data
->drawing
);
1710 processlist_clear(resourceview_data
->process_list
);
1711 gtk_widget_set_size_request(
1712 resourceview_data
->drawing
->drawing_area
,
1713 -1, processlist_get_height(resourceview_data
->process_list
));
1715 rectangle_pixmap (resourceview_data
->process_list
,
1716 widget
->style
->black_gc
,
1719 drawing
->alloc_width
,
1722 gtk_widget_queue_draw(drawing
->drawing_area
);
1724 if(drawing
->damage_begin
< drawing
->damage_end
)
1726 drawing_data_request(drawing
,
1727 drawing
->damage_begin
,
1729 drawing
->damage_end
-drawing
->damage_begin
,
1738 gint
continue_notify(void *hook_data
, void *call_data
)
1740 ControlFlowData
*resourceview_data
= (ControlFlowData
*) hook_data
;
1741 Drawing_t
*drawing
= resourceview_data
->drawing
;
1743 if(drawing
->damage_begin
< drawing
->damage_end
)
1745 drawing_data_request(drawing
,
1746 drawing
->damage_begin
,
1748 drawing
->damage_end
-drawing
->damage_begin
,
1756 gint
update_current_time_hook(void *hook_data
, void *call_data
)
1758 ControlFlowData
*resourceview_data
= (ControlFlowData
*)hook_data
;
1760 LttTime current_time
= *((LttTime
*)call_data
);
1762 TimeWindow time_window
=
1763 lttvwindow_get_time_window(resourceview_data
->tab
);
1765 LttTime time_begin
= time_window
.start_time
;
1766 LttTime width
= time_window
.time_width
;
1769 guint64 time_ll
= ltt_time_to_uint64(width
);
1770 time_ll
= time_ll
>> 1; /* divide by two */
1771 half_width
= ltt_time_from_uint64(time_ll
);
1773 LttTime time_end
= ltt_time_add(time_begin
, width
);
1775 LttvTraceset
* ts
= lttvwindow_get_traceset(resourceview_data
->tab
);
1777 TimeInterval time_span
= lttv_traceset_get_time_span_real(ts
);
1778 LttTime trace_start
= time_span
.start_time
;
1779 LttTime trace_end
= time_span
.end_time
;
1781 g_info("New current time HOOK : %lu, %lu", current_time
.tv_sec
,
1782 current_time
.tv_nsec
);
1784 /* If current time is inside time interval, just move the highlight
1787 /* Else, we have to change the time interval. We have to tell it
1788 * to the main window. */
1789 /* The time interval change will take care of placing the current
1790 * time at the center of the visible area, or nearest possible if we are
1791 * at one end of the trace. */
1794 if(ltt_time_compare(current_time
, time_begin
) < 0)
1796 TimeWindow new_time_window
;
1798 if(ltt_time_compare(current_time
,
1799 ltt_time_add(trace_start
,half_width
)) < 0)
1800 time_begin
= trace_start
;
1802 time_begin
= ltt_time_sub(current_time
,half_width
);
1804 new_time_window
.start_time
= time_begin
;
1805 new_time_window
.time_width
= width
;
1806 new_time_window
.time_width_double
= ltt_time_to_double(width
);
1807 new_time_window
.end_time
= ltt_time_add(time_begin
, width
);
1809 lttvwindow_report_time_window(resourceview_data
->tab
, new_time_window
);
1811 else if(ltt_time_compare(current_time
, time_end
) > 0)
1813 TimeWindow new_time_window
;
1815 if(ltt_time_compare(current_time
, ltt_time_sub(trace_end
, half_width
)) > 0)
1816 time_begin
= ltt_time_sub(trace_end
,width
);
1818 time_begin
= ltt_time_sub(current_time
,half_width
);
1820 new_time_window
.start_time
= time_begin
;
1821 new_time_window
.time_width
= width
;
1822 new_time_window
.time_width_double
= ltt_time_to_double(width
);
1823 new_time_window
.end_time
= ltt_time_add(time_begin
, width
);
1825 lttvwindow_report_time_window(resourceview_data
->tab
, new_time_window
);
1828 gtk_widget_queue_draw(resourceview_data
->drawing
->drawing_area
);
1830 /* Update directly when scrolling */
1831 gdk_window_process_updates(resourceview_data
->drawing
->drawing_area
->window
,
1837 typedef struct _ClosureData
{
1838 EventsRequest
*events_request
;
1843 /* Draw line until end of the screen */
1845 void draw_closure(gpointer key
, gpointer value
, gpointer user_data
)
1847 ResourceUniqueNumeric
*process_info
= (ResourceUniqueNumeric
*)key
;
1848 HashedResourceData
*hashed_process_data
= (HashedResourceData
*)value
;
1849 ClosureData
*closure_data
= (ClosureData
*)user_data
;
1851 EventsRequest
*events_request
= closure_data
->events_request
;
1852 ControlFlowData
*resourceview_data
= events_request
->viewer_data
;
1853 LttvTraceset
*ts
= lttvwindow_get_traceset(resourceview_data
->tab
);
1855 LttTime evtime
= closure_data
->end_time
;
1857 gboolean dodraw
= TRUE
;
1859 if(hashed_process_data
->type
== RV_RESOURCE_MACHINE
)
1863 /* For the process */
1864 /* First, check if the current process is in the state computation
1865 * process list. If it is there, that means we must add it right now and
1866 * draw items from the beginning of the read for it. If it is not
1867 * present, it's a new process and it was not present : it will
1868 * be added after the state update. */
1870 g_assert(lttv_traceset_number(tsc
->ts
) > 0);
1871 #endif //EXTRA_CHECK
1873 LttvTrace
*trace
= lttv_traceset_get(ts
,process_info
->trace_num
);
1874 LttvTraceState
*ts
= trace
->state
;
1876 /* Only draw for processes that are currently in the trace states */
1879 /* Should be alike when background info is ready */
1880 if(resourceview_data
->background_info_waiting
==0)
1881 g_assert(ltt_time_compare(process
->creation_time
,
1882 process_info
->birth
) == 0);
1883 #endif //EXTRA_CHECK
1885 /* Now, the process is in the state hash and our own process hash.
1886 * We definitely can draw the items related to the ending state.
1889 if(unlikely(ltt_time_compare(hashed_process_data
->next_good_time
,
1892 TimeWindow time_window
=
1893 lttvwindow_get_time_window(resourceview_data
->tab
);
1896 if(ltt_time_compare(evtime
, time_window
.start_time
) == -1
1897 || ltt_time_compare(evtime
, time_window
.end_time
) == 1)
1899 #endif //EXTRA_CHECK
1900 Drawing_t
*drawing
= resourceview_data
->drawing
;
1901 guint width
= drawing
->width
;
1903 guint x
= closure_data
->x_end
;
1905 DrawContext draw_context
;
1907 /* Now create the drawing context that will be used to draw
1908 * items related to the last state. */
1909 draw_context
.drawable
= hashed_process_data
->pixmap
;
1910 draw_context
.gc
= drawing
->gc
;
1911 draw_context
.pango_layout
= drawing
->pango_layout
;
1912 draw_context
.drawinfo
.end
.x
= x
;
1914 draw_context
.drawinfo
.y
.over
= 1;
1915 draw_context
.drawinfo
.y
.middle
= (hashed_process_data
->height
/2);
1916 draw_context
.drawinfo
.y
.under
= hashed_process_data
->height
;
1918 draw_context
.drawinfo
.start
.offset
.over
= 0;
1919 draw_context
.drawinfo
.start
.offset
.middle
= 0;
1920 draw_context
.drawinfo
.start
.offset
.under
= 0;
1921 draw_context
.drawinfo
.end
.offset
.over
= 0;
1922 draw_context
.drawinfo
.end
.offset
.middle
= 0;
1923 draw_context
.drawinfo
.end
.offset
.under
= 0;
1925 /* Jump over draw if we are at the same x position */
1926 if(x
== hashed_process_data
->x
.over
)
1930 draw_context
.drawinfo
.start
.x
= hashed_process_data
->x
.over
;
1932 PropertiesLine prop_line
= prepare_execmode_line(process
);
1933 draw_line((void*)&prop_line
, (void*)&draw_context
);
1935 hashed_process_data
->x
.over
= x
;
1939 if(unlikely(x
== hashed_process_data
->x
.middle
&&
1940 hashed_process_data
->x
.middle_used
)) {
1941 #if 0 /* do not mark closure : not missing information */
1942 if(hashed_process_data
->x
.middle_marked
== FALSE
) {
1943 /* Draw collision indicator */
1944 gdk_gc_set_foreground(drawing
->gc
, &drawing_colors
[COL_WHITE
]);
1945 gdk_draw_point(drawing
->pixmap
,
1949 hashed_process_data
->x
.middle_marked
= TRUE
;
1954 draw_context
.drawinfo
.start
.x
= hashed_process_data
->x
.middle
;
1957 PropertiesLine prop_line
;
1958 prop_line
.line_width
= STATE_LINE_WIDTH
;
1959 prop_line
.style
= GDK_LINE_SOLID
;
1960 prop_line
.y
= MIDDLE
;
1961 if(hashed_process_data
->type
== RV_RESOURCE_CPU
)
1962 cpu_set_line_color(&prop_line
, &ts
->cpu_states
[process_info
->id
]);
1963 else if(hashed_process_data
->type
== RV_RESOURCE_IRQ
)
1964 irq_set_line_color(&prop_line
, &ts
->irq_states
[process_info
->id
]);
1965 else if(hashed_process_data
->type
== RV_RESOURCE_SOFT_IRQ
)
1966 soft_irq_set_line_color(&prop_line
, &ts
->soft_irq_states
[process_info
->id
]);
1967 else if(hashed_process_data
->type
== RV_RESOURCE_TRAP
)
1968 trap_set_line_color(&prop_line
, &ts
->trap_states
[process_info
->id
]);
1969 else if(hashed_process_data
->type
== RV_RESOURCE_BDEV
) {
1970 gint devcode_gint
= process_info
->id
;
1971 LttvBdevState
*bdev
= g_hash_table_lookup(ts
->bdev_states
, &devcode_gint
);
1972 // the lookup may return null; bdev_set_line_color must act appropriately
1973 bdev_set_line_color(&prop_line
, bdev
);
1976 draw_line((void*)&prop_line
, (void*)&draw_context
);
1979 /* become the last x position */
1980 if(likely(x
!= hashed_process_data
->x
.middle
)) {
1981 hashed_process_data
->x
.middle
= x
;
1982 /* but don't use the pixel */
1983 hashed_process_data
->x
.middle_used
= FALSE
;
1985 /* Calculate the next good time */
1986 convert_pixels_to_time(width
, x
+1, time_window
,
1987 &hashed_process_data
->next_good_time
);
1994 int before_chunk(void *hook_data
, void *call_data
)
1996 EventsRequest
*events_request
= (EventsRequest
*)hook_data
;
1997 LttvTraceset
*ts
= (LttvTraceset
*)call_data
;
2000 /* Deactivate sort */
2001 gtk_tree_sortable_set_sort_column_id(
2002 GTK_TREE_SORTABLE(cfd
->process_list
->list_store
),
2004 GTK_SORT_ASCENDING
);
2006 drawing_chunk_begin(events_request
, ts
);
2013 * This gets executed just before an events request is executed
2016 int before_request(void *hook_data
, void *call_data
)
2018 EventsRequest
*events_request
= (EventsRequest
*)hook_data
;
2020 drawing_data_request_begin(events_request
);
2025 void draw_closing_lines(ControlFlowData
*resourceview_data
,
2026 EventsRequest
* events_request
)
2028 LttTime end_time
= events_request
->end_time
;
2029 ClosureData closure_data
;
2030 closure_data
.events_request
= events_request
;
2031 closure_data
.end_time
= end_time
;
2034 TimeWindow time_window
=
2035 lttvwindow_get_time_window(resourceview_data
->tab
);
2036 guint width
= resourceview_data
->drawing
->width
;
2037 convert_time_to_pixels(
2041 &closure_data
.x_end
);
2044 /* Draw last items */
2045 for(i
=0; i
<RV_RESOURCE_COUNT
; i
++) {
2046 g_hash_table_foreach(resourcelist_get_resource_hash_table(resourceview_data
, i
), draw_closure
,
2047 (void*)&closure_data
);
2050 /* Request expose */
2051 drawing_request_expose(events_request
, end_time
);
2055 * after request is necessary in addition of after chunk in order to draw
2056 * lines until the end of the screen. after chunk just draws lines until
2063 int after_request(void *hook_data
, void *call_data
)
2066 EventsRequest
*events_request
= (EventsRequest
*)hook_data
;
2067 ControlFlowData
*resourceview_data
= events_request
->viewer_data
;
2069 draw_closing_lines(resourceview_data
, events_request
);
2079 int after_chunk(void *hook_data
, void *call_data
)
2081 EventsRequest
*events_request
= (EventsRequest
*)hook_data
;
2082 ControlFlowData
*resourceview_data
= events_request
->viewer_data
;
2083 LttvTraceset
*ts
= (LttvTraceset
*)call_data
;
2087 ProcessList
*process_list
= resourceview_data
->process_list
;
2089 guint nb_trace
= lttv_traceset_number(ts
);
2091 /* Only execute when called for the first trace's events request */
2092 if(!process_list
->current_hash_data
)
2095 for(i
= 0 ; i
< nb_trace
; i
++) {
2096 g_free(process_list
->current_hash_data
[i
]);
2098 g_free(process_list
->current_hash_data
);
2099 process_list
->current_hash_data
= NULL
;
2100 #ifdef BABEL_CLEANUP
2102 end_time
= LTT_TIME_MIN(tfc
->timestamp
, events_request
->end_time
);
2103 else /* end of traceset, or position now out of request : end */
2104 end_time
= events_request
->end_time
;
2106 draw_closing_lines(resourceview_data
, events_request
);
2111 /* after_statedump_end
2113 * @param hook_data ControlFlowData structure of the viewer.
2114 * @param call_data Event context.
2116 * This function adds items to be drawn in a queue for each process.
2119 int before_statedump_end(void *hook_data
, void *call_data
)
2123 event
= (LttvEvent
*) call_data
;
2125 if (strcmp(lttv_traceset_get_name_from_event(event
),"lttng_statedump_end") != 0)
2128 ControlFlowData
*resourceview_data
= (ControlFlowData
*) hook_data
;
2131 LttvTraceState
*ts
= event
->state
;
2136 #ifdef BABEL_CLEANUP
2138 LttvFilter
*filter
= resourceview_data
->filter
;
2139 if(filter
!= NULL
&& filter
->head
!= NULL
)
2140 if(!lttv_filter_tree_parse(filter
->head
,e
,tfc
->tf
,
2141 tfc
->t_context
->t
,tfc
,NULL
,NULL
))
2145 LttTime evtime
= lttv_event_get_timestamp(event
);
2147 ClosureData closure_data
;
2148 //TODO ybrosseau 2013-03-27: Fake and event_request.
2149 // We need to change the API of drawing_request_expose to ask
2150 // For and control flow data only.
2151 EventsRequest events_request
;
2152 events_request
.viewer_data
= resourceview_data
;
2153 closure_data
.events_request
= &events_request
;
2154 closure_data
.end_time
= evtime
;
2156 TimeWindow time_window
=
2157 lttvwindow_get_time_window(resourceview_data
->tab
);
2158 guint width
= resourceview_data
->drawing
->width
;
2159 convert_time_to_pixels(
2163 &closure_data
.x_end
);
2165 /* Draw last items */
2167 for(i
=0; i
<RV_RESOURCE_COUNT
; i
++) {
2168 g_hash_table_foreach(resourcelist_get_resource_hash_table(resourceview_data
, i
), draw_closure
,
2169 (void*)&closure_data
);
2172 /* Reactivate sort */
2173 gtk_tree_sortable_set_sort_column_id(
2174 GTK_TREE_SORTABLE(resourceview_data
->process_list
->list_store
),
2175 GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID
,
2176 GTK_SORT_ASCENDING
);
2178 update_index_to_pixmap(resourceview_data
->process_list
);
2179 /* Request a full expose : drawing scrambled */
2180 gtk_widget_queue_draw(resourceview_data
->drawing
->drawing_area
);
2182 /* Request expose (updates damages zone also) */
2183 drawing_request_expose(&events_request
, evtime
);