1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2006 Parisa heidari (inspired from CFV by 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., 51 Franklin Street, Fifth Floor, 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
60 //#include <pango/pango.h>
62 #include <lttv/lttv.h>
63 #include <lttv/hook.h>
64 #include <lttv/state.h>
65 #include <lttvwindow/lttvwindow.h>
66 #include <lttvwindow/lttvwindowtraces.h>
67 #include <lttvwindow/support.h>
70 #include "histoeventhooks.h"
72 #include "histobuttonwidget.h"
73 #include "histodrawing.h"
76 #define MAX_PATH_LEN 256
77 #define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
79 // fixed #define TRACE_NUMBER 0
80 #define EXTRA_ALLOC 1024 // pixels
83 * Most functions here are inspired from the controlflow module.
84 * Look in gui/controlflow/eventhooks.c if you need to add more functionality
88 * Histogram Viewer's constructor hook
90 * This constructor is given as a parameter to the menuitem and toolbar button
91 * registration. It creates the list.
92 * @param tab A pointer to the parent tab.
93 * @return The widget created.
96 h_guihistocontrolflow(LttvPlugin
*plugin
)
98 LttvPluginTab
*ptab
= LTTV_PLUGIN_TAB(plugin
);
99 g_info("h_guihistocontrolflow, %p", ptab
);
100 HistoControlFlowData
*histocontrol_flow_data
= guihistocontrolflow(ptab
) ;
102 Tab
*tab
= ptab
->tab
;
103 histocontrol_flow_data
->tab
= tab
;
105 // Unreg done in the GuiHistoControlFlow_Destructor
106 lttvwindow_register_traceset_notify(tab
,
107 histo_traceset_notify
,
108 histocontrol_flow_data
);
110 lttvwindow_register_time_window_notify(tab
,
111 histo_update_time_window_hook
,
112 histocontrol_flow_data
);
113 lttvwindow_register_current_time_notify(tab
,
114 histo_update_current_time_hook
,
115 histocontrol_flow_data
);
116 lttvwindow_register_redraw_notify(tab
,
118 histocontrol_flow_data
);
119 lttvwindow_register_continue_notify(tab
,
120 histo_continue_notify
,
121 histocontrol_flow_data
);
122 //added for histogram, enable filter:
123 lttvwindow_register_filter_notify(tab
,
124 histo_filter_changed
,histocontrol_flow_data
);
125 histocontrol_flow_data
->histo_main_win_filter
= lttvwindow_get_filter(tab
);
127 // histo_request_background_data(histocontrol_flow_data);
129 return guihistocontrolflow_get_widget(histocontrol_flow_data
) ;
135 /// added for histogram.
136 void histo_request_event( HistoControlFlowData
*histocontrol_flow_data
, guint x
, guint width
)
138 if(width
< 0) return ;
141 Tab
*tab
= histocontrol_flow_data
->tab
;
142 TimeWindow time_window
= lttvwindow_get_time_window( tab
);
143 LttTime time_start
, time_end
;
145 //find the tracehooks
146 LttvTraceset
*traceset
= lttvwindow_get_traceset(tab
);
148 nb_trace
= lttv_traceset_number(traceset
);
149 guint drawing_width
= histocontrol_flow_data
->drawing
->width
;
150 //start time for chunk.
151 histo_convert_pixels_to_time(drawing_width
, /*0*/x
, time_window
,
153 //end time for chunk.
154 histo_convert_pixels_to_time(drawing_width
,
155 /*width*/x
+width
,time_window
,
157 time_end
= ltt_time_add(time_end
, ltt_time_one
); // because main window
158 // doesn't deliver end time.
160 lttvwindow_events_request_remove_all(tab
,
161 histocontrol_flow_data
);
164 // LttvHooksById *histo_event_by_id = lttv_hooks_by_id_new();//if necessary for filter!
165 // FIXME : eventually request for more traces
166 // fixed for(i = 0; i<MIN(TRACE_NUMBER+1, nb_trace);i++) {
167 //TODO ybrosseau 2012-07-10: Just do one request
168 for(i
=0;i
<nb_trace
;i
++) {
169 //should be in the loop or before?
170 EventsRequest
*histo_events_request
= g_new(EventsRequest
, 1);
172 LttvHooks
*histo_before_trace_hooks
= lttv_hooks_new();
173 lttv_hooks_add(histo_before_trace_hooks
, histo_before_trace
,
174 histo_events_request
, LTTV_PRIO_DEFAULT
);
176 LttvHooks
*histo_count_event_hooks
= lttv_hooks_new();
177 lttv_hooks_add(histo_count_event_hooks
, histo_count_event
,
178 histo_events_request
, LTTV_PRIO_DEFAULT
);
180 LttvHooks
*histo_after_trace_hooks
= lttv_hooks_new();
181 lttv_hooks_add(histo_after_trace_hooks
, histo_after_trace
,
182 histo_events_request
, LTTV_PRIO_DEFAULT
);
185 LttvHooks
*histo_before_chunk_traceset
= lttv_hooks_new();
186 LttvHooks
*histo_after_chunk_traceset
= lttv_hooks_new();
188 lttv_hooks_add(histo_before_chunk_traceset
,
190 histo_events_request
,
193 lttv_hooks_add(histo_after_chunk_traceset
,
195 histo_events_request
,
197 // Fill the events request
198 histo_events_request
->owner
= histocontrol_flow_data
;
199 histo_events_request
->viewer_data
= histocontrol_flow_data
;
200 histo_events_request
->servicing
= FALSE
;
201 histo_events_request
->start_time
= time_start
;//time_window.start_time;
203 histo_events_request
->start_position
= NULL
;
204 histo_events_request
->stop_flag
= FALSE
;
205 histo_events_request
->end_time
= time_end
;//time_window.end_time;
207 histo_events_request
->num_events
= G_MAXUINT
;
208 histo_events_request
->end_position
= NULL
;
209 histo_events_request
->trace
= i
;
210 histo_events_request
->hooks
= NULL
;
211 histo_events_request
->before_chunk_traceset
= histo_before_chunk_traceset
;//NULL;
212 histo_events_request
->before_chunk_trace
= NULL
;
213 histo_events_request
->before_chunk_tracefile
= NULL
;
214 histo_events_request
->event
= histo_count_event_hooks
;
215 histo_events_request
->after_chunk_tracefile
= NULL
;
216 histo_events_request
->after_chunk_trace
= NULL
;
217 histo_events_request
->after_chunk_traceset
= histo_after_chunk_traceset
;//NULL;
218 histo_events_request
->before_request
= histo_before_trace_hooks
;
219 histo_events_request
->after_request
= histo_after_trace_hooks
;
221 lttvwindow_events_request(histocontrol_flow_data
->tab
, histo_events_request
);
226 //hook,added for histogram
227 int histo_count_event(void *hook_data
, void *call_data
){
229 guint x
;//time to pixel
234 EventsRequest
*events_request
= (EventsRequest
*)hook_data
;
235 HistoControlFlowData
*histocontrol_flow_data
= events_request
->viewer_data
;
237 histoDrawing_t
*drawing
= histocontrol_flow_data
->drawing
;
238 int width
= drawing
->width
;
240 g_info("Histogram: count_event() \n");
242 e
= (LttvEvent
*)call_data
;
244 LttvFilter
*histo_filter
= histocontrol_flow_data
->histo_main_win_filter
;
245 if(histo_filter
!= NULL
&& histo_filter
->head
!= NULL
)
246 if(!lttv_filter_tree_parse(histo_filter
->head
,e
,tfc
->tf
,
247 tfc
->t_context
->t
,tfc
,NULL
,NULL
))
250 TimeWindow time_window
= lttvwindow_get_time_window(histocontrol_flow_data
->tab
);
251 event_time
= lttv_event_get_timestamp(e
);
253 histo_convert_time_to_pixels(
258 element
= &g_array_index(histocontrol_flow_data
->number_of_process
, guint
, x
);
263 ///befor hook:Added for histogram
264 int histo_before_trace(void *hook_data
, void *call_data
){
266 EventsRequest
*events_request
= (EventsRequest
*)hook_data
;
267 HistoControlFlowData
*histocontrol_flow_data
= events_request
->viewer_data
;
269 histoDrawing_t
*drawing
= histocontrol_flow_data
->drawing
;
271 //in order to reset all of the array elements.
273 end
= MIN(histocontrol_flow_data
->number_of_process
->len
,drawing
->damage_end
);
274 for(i
=drawing
->damage_begin
/*0*/;
275 i
< end
/*histocontrol_flow_data->number_of_process->len*/;i
++)
277 g_array_index(histocontrol_flow_data
->number_of_process
, guint
, i
) = 0;
279 histo_drawing_clear(drawing
,drawing
->damage_begin
/*0*/,
280 drawing
->damage_end
- drawing
->damage_begin
/*drawing->width*/);
281 //g_array_free(histocontrol_flow_data->number_of_process,TRUE);
282 //histocontrol_flow_data->number_of_process =g_array_new (FALSE,
284 // sizeof(guint));//4 byte for guint
285 //g_array_set_size (histocontrol_flow_data->number_of_process,
286 // drawing->drawing_area->allocation.width);
287 // gtk_widget_set_size_request(drawing->drawing_area,-1,-1);
288 gtk_widget_queue_draw(drawing
->drawing_area
);
291 //after hook,added for histogram
292 int histo_after_trace(void *hook_data
, void *call_data
){
294 EventsRequest
*events_request
= (EventsRequest
*)hook_data
;
295 HistoControlFlowData
*histocontrol_flow_data
= events_request
->viewer_data
;
296 histoDrawing_t
*drawing
= histocontrol_flow_data
->drawing
;
297 guint x
, x_end
, width
;
298 LttTime end_time
= events_request
->end_time
;
299 TimeWindow time_window
=
300 lttvwindow_get_time_window(histocontrol_flow_data
->tab
);
302 g_debug("histo after trace");
304 histo_convert_time_to_pixels(
309 x
= drawing
->damage_begin
;
311 drawing
->damage_begin
= x
+width
;
312 histogram_show (histocontrol_flow_data
,x
,x_end
);
316 /* TODO ybrosseau 2012-03-15: Cleanup line_src */
317 void histogram_show(HistoControlFlowData
*histocontrol_flow_data
,guint draw_begin
,
320 histoDrawing_t
*drawing
= histocontrol_flow_data
->drawing
;
321 GtkWidget
*drawingarea
= histo_drawing_get_drawing_area(drawing
);
322 guint width
= drawing
->width
;
323 guint height
= drawing
->height
;//drawingarea->allocation.height;
325 /* gdk_gc_set_line_attributes(drawing->gc,
331 histo_drawing_clear(drawing
,draw_begin
,draw_end
);
333 TimeWindow time_window
=
334 lttvwindow_get_time_window(histocontrol_flow_data
->tab
);
338 guint i
/*, line_src*/;
339 guint end_chunk
=MIN(draw_end
,(histocontrol_flow_data
->number_of_process
)->len
);
341 for (i
=draw_begin
/*0*/;i
<end_chunk
/* (histocontrol_flow_data->number_of_process)->len*/;i
++){
342 val
=g_array_index(histocontrol_flow_data
->number_of_process
,guint
,i
);
343 h_val
= height
-((height
*val
)/histocontrol_flow_data
->max_height
);
345 histo_convert_pixels_to_time(width
, i
,
348 histo_convert_pixels_to_time(width
, i
+1,
353 //check if zoom in is used and more than 1 pixel correspond to each 1nsec
354 //used for drawing point (not line) on the screen.
355 /* while (ltt_time_compare(t1,t2)==0)
357 histo_convert_pixels_to_time(width, i++,
360 histo_convert_pixels_to_time(width, i+1,
366 */ //replaced later for lines.
368 if(val
> drawing
->histo_control_flow_data
->max_height
){
369 //overlimit, yellow color
370 gdk_gc_set_foreground(drawing
->gc
,&histo_drawing_colors
[COL_WHITE
] );//COL_RUN_TRAP
371 gdk_draw_line (drawing
->pixmap
,
377 gdk_gc_set_foreground(drawing
->gc
,&histo_drawing_colors
[COL_RUN_USER_MODE
] );
378 gdk_draw_line (drawing
->pixmap
,
384 while ((ltt_time_compare(t1
,t2
)==0)&&(i
<end_chunk
))//-1 , i to be incremented later
388 if(val
> drawing
->histo_control_flow_data
->max_height
){
389 //overlimit, yellow color
390 gdk_gc_set_foreground(drawing
->gc
,
391 &histo_drawing_colors
[COL_RUN_TRAP
] );
392 gdk_draw_line (drawing
->pixmap
,
398 gdk_gc_set_foreground(drawing
->gc
,&histo_drawing_colors
[COL_RUN_USER_MODE
] );
399 gdk_draw_line (drawing
->pixmap
,
404 histo_convert_pixels_to_time(width
, i
,
408 histo_convert_pixels_to_time(width
, i
+1,
412 }//while (t1==t2)////
416 histo_drawing_update_vertical_ruler(drawing
);
417 gtk_widget_queue_draw_area ( drawing
->drawing_area
,
419 draw_end
-draw_begin
, drawing
->height
);
420 gdk_window_process_updates(drawingarea
->window
,TRUE
);
423 int histo_event_selected_hook(void *hook_data
, void *call_data
)
425 guint
*event_number
= (guint
*) call_data
;
427 g_debug("DEBUG : event selected by main window : %u", *event_number
);
434 /* histo_before_schedchange_hook
436 * This function basically draw lines and icons. Two types of lines are drawn :
437 * one small (3 pixels?) representing the state of the process and the second
438 * type is thicker (10 pixels?) representing on which CPU a process is running
439 * (and this only in running state).
441 * Extremums of the lines :
442 * x_min : time of the last event context for this process kept in memory.
443 * x_max : time of the current event.
444 * y : middle of the process in the process list. The process is found in the
445 * list, therefore is it's position in pixels.
447 * The choice of lines'color is defined by the context of the last event for this
452 int histo_before_schedchange_hook(void *hook_data, void *call_data)
458 gint
histo_update_time_window_hook(void *hook_data
, void *call_data
)
460 HistoControlFlowData
*histocontrol_flow_data
= (HistoControlFlowData
*) hook_data
;
461 histoDrawing_t
*drawing
= histocontrol_flow_data
->drawing
;
463 const TimeWindowNotifyData
*histo_time_window_nofify_data
=
464 ((const TimeWindowNotifyData
*)call_data
);
466 TimeWindow
*histo_old_time_window
=
467 histo_time_window_nofify_data
->old_time_window
;
468 TimeWindow
*histo_new_time_window
=
469 histo_time_window_nofify_data
->new_time_window
;
472 histo_drawing_update_ruler(drawing
,
473 histo_new_time_window
);
475 /* Two cases : zoom in/out or scrolling */
477 /* In order to make sure we can reuse the old drawing, the scale must
478 * be the same and the new time interval being partly located in the
479 * currently shown time interval. (reuse is only for scrolling)
482 g_info("Old time window HOOK : %lu, %lu to %lu, %lu",
483 histo_old_time_window
->start_time
.tv_sec
,
484 histo_old_time_window
->start_time
.tv_nsec
,
485 histo_old_time_window
->time_width
.tv_sec
,
486 histo_old_time_window
->time_width
.tv_nsec
);
488 g_info("New time window HOOK : %lu, %lu to %lu, %lu",
489 histo_new_time_window
->start_time
.tv_sec
,
490 histo_new_time_window
->start_time
.tv_nsec
,
491 histo_new_time_window
->time_width
.tv_sec
,
492 histo_new_time_window
->time_width
.tv_nsec
);
494 //For Histo,redraw always except if zoom fit is pushed 2 times consequently
495 if( histo_new_time_window
->start_time
.tv_sec
== histo_old_time_window
->start_time
.tv_sec
496 && histo_new_time_window
->start_time
.tv_nsec
== histo_old_time_window
->start_time
.tv_nsec
497 && histo_new_time_window
->time_width
.tv_sec
== histo_old_time_window
->time_width
.tv_sec
498 && histo_new_time_window
->time_width
.tv_nsec
== histo_old_time_window
->time_width
.tv_nsec
)
502 histo_rectangle_pixmap (drawing
->drawing_area
->style
->black_gc
,
505 drawing
->width
,//+SAFETY, // do not overlap
508 drawing
->damage_begin
= 0;
509 drawing
->damage_end
= drawing
->width
;
511 gtk_widget_queue_draw(drawing
->drawing_area
);
512 histo_request_event(histocontrol_flow_data
,drawing
->damage_begin
,
513 drawing
->damage_end
- drawing
->damage_begin
);
515 gdk_window_process_updates(drawing
->drawing_area
->window
,TRUE
);
517 //show number of event at current time
519 histo_drawing_update_vertical_ruler(drawing
);
523 gint
histo_traceset_notify(void *hook_data
, void *call_data
)
525 HistoControlFlowData
*histocontrol_flow_data
= (HistoControlFlowData
*) hook_data
;
526 histoDrawing_t
*drawing
= histocontrol_flow_data
->drawing
;
528 if(unlikely(drawing
->gc
== NULL
)) {
531 if(drawing
->dotted_gc
== NULL
) {
535 histo_drawing_clear(drawing
,0,drawing
->width
);
538 for(i
=0;i
< histocontrol_flow_data
->number_of_process
->len
;i
++)
540 g_array_index(histocontrol_flow_data
->number_of_process
, guint
, i
) = 0;
542 gtk_widget_set_size_request(
543 drawing
->drawing_area
,
545 histo_redraw_notify(histocontrol_flow_data
, NULL
);
547 ///histo_request_background_data(histocontrol_flow_data);
552 gint
histo_redraw_notify(void *hook_data
, void *call_data
)
554 HistoControlFlowData
*histocontrol_flow_data
= (HistoControlFlowData
*) hook_data
;
555 histoDrawing_t
*drawing
= histocontrol_flow_data
->drawing
;
556 GtkWidget
*widget
= drawing
->drawing_area
;
558 drawing
->damage_begin
= 0;
559 drawing
->damage_end
= drawing
->width
;
561 // fun feature, to be separated someday...
563 histo_drawing_clear(drawing
,0,drawing
->width
);
565 gtk_widget_set_size_request(
566 drawing
->drawing_area
,
570 histo_rectangle_pixmap (widget
->style
->black_gc
,
573 drawing
->alloc_width
,
575 gtk_widget_queue_draw(widget
);
578 if(drawing
->damage_begin
< drawing
->damage_end
)
580 //replaced for histogram
581 histo_request_event(histocontrol_flow_data
,0,drawing
->width
);
585 //gtk_widget_queue_draw_area(drawing->drawing_area,
594 gint
histo_continue_notify(void *hook_data
, void *call_data
)
596 HistoControlFlowData
*histocontrol_flow_data
= (HistoControlFlowData
*) hook_data
;
597 histoDrawing_t
*drawing
= histocontrol_flow_data
->drawing
;
599 //g_assert(widget->allocation.width == drawing->damage_end);
601 if(drawing
->damage_begin
< drawing
->damage_end
)
603 histo_request_event(histocontrol_flow_data
,drawing
->damage_begin
,
604 drawing
->damage_end
-drawing
->damage_begin
);
611 gint
histo_update_current_time_hook(void *hook_data
, void *call_data
)
613 HistoControlFlowData
*histocontrol_flow_data
= (HistoControlFlowData
*)hook_data
;
614 histoDrawing_t
*drawing
= histocontrol_flow_data
->drawing
;
616 LttTime current_time
= *((LttTime
*)call_data
);
618 TimeWindow time_window
=
619 lttvwindow_get_time_window(histocontrol_flow_data
->tab
);
621 LttTime time_begin
= time_window
.start_time
;
622 LttTime width
= time_window
.time_width
;
625 guint64 time_ll
= ltt_time_to_uint64(width
);
626 time_ll
= time_ll
>> 1; /* divide by two */
627 half_width
= ltt_time_from_uint64(time_ll
);
629 LttTime time_end
= ltt_time_add(time_begin
, width
);
631 LttvTraceset
*traceset
=
632 lttvwindow_get_traceset(histocontrol_flow_data
->tab
);
633 TimeInterval time_span
= lttv_traceset_get_time_span_real(traceset
);
635 LttTime trace_start
= time_span
.start_time
;
636 LttTime trace_end
= time_span
.end_time
;
638 g_info("Histogram: New current time HOOK : %lu, %lu", current_time
.tv_sec
,
639 current_time
.tv_nsec
);
643 /* If current time is inside time interval, just move the highlight
646 /* Else, we have to change the time interval. We have to tell it
647 * to the main window. */
648 /* The time interval change will take care of placing the current
649 * time at the center of the visible area, or nearest possible if we are
650 * at one end of the trace. */
653 if(ltt_time_compare(current_time
, time_begin
) < 0)
655 TimeWindow histo_new_time_window
;
657 if(ltt_time_compare(current_time
,
658 ltt_time_add(trace_start
,half_width
)) < 0)
659 time_begin
= trace_start
;
661 time_begin
= ltt_time_sub(current_time
,half_width
);
663 histo_new_time_window
.start_time
= time_begin
;
664 histo_new_time_window
.time_width
= width
;
665 histo_new_time_window
.time_width_double
= ltt_time_to_double(width
);
666 histo_new_time_window
.end_time
= ltt_time_add(time_begin
, width
);
668 lttvwindow_report_time_window(histocontrol_flow_data
->tab
, histo_new_time_window
);
670 else if(ltt_time_compare(current_time
, time_end
) > 0)
672 TimeWindow histo_new_time_window
;
674 if(ltt_time_compare(current_time
, ltt_time_sub(trace_end
, half_width
)) > 0)
675 time_begin
= ltt_time_sub(trace_end
,width
);
677 time_begin
= ltt_time_sub(current_time
,half_width
);
679 histo_new_time_window
.start_time
= time_begin
;
680 histo_new_time_window
.time_width
= width
;
681 histo_new_time_window
.time_width_double
= ltt_time_to_double(width
);
682 histo_new_time_window
.end_time
= ltt_time_add(time_begin
, width
);
684 lttvwindow_report_time_window(histocontrol_flow_data
->tab
, histo_new_time_window
);
687 gtk_widget_queue_draw(drawing
->drawing_area
);
689 /* Update directly when scrolling */
690 gdk_window_process_updates(drawing
->drawing_area
->window
,
693 histo_drawing_update_vertical_ruler(drawing
);
698 gboolean
histo_filter_changed(void * hook_data
, void * call_data
)
700 HistoControlFlowData
*histocontrol_flow_data
= (HistoControlFlowData
*)hook_data
;
701 histoDrawing_t
*drawing
=histocontrol_flow_data
->drawing
;
703 histocontrol_flow_data
->histo_main_win_filter
=
704 (LttvFilter
*)call_data
;
705 //get_events(event_viewer_data->vadjust_c->value, event_viewer_data);
706 gtk_widget_set_size_request(
707 drawing
->drawing_area
,
709 drawing
->damage_begin
= 0;
710 drawing
->damage_end
= drawing
->width
;
712 /* //done in, before request!
713 histo_drawing_clear(drawing,0,drawing->width);
715 for(i=0;i < histocontrol_flow_data->number_of_process->len;i++)
717 g_array_index(histocontrol_flow_data->number_of_process, guint, i) = 0;
720 histo_request_event(histocontrol_flow_data
,0,drawing
->width
);
725 typedef struct _histo_ClosureData
{
726 EventsRequest
*events_request
;
727 LttvTraceset
*traceset
;
734 int histo_before_chunk(void *hook_data
, void *call_data
)
736 EventsRequest
*histo_events_request
= (EventsRequest
*)hook_data
;
737 LttvTraceset
*histo_traceset
= (LttvTraceset
*)call_data
;
739 /* Desactivate sort */
740 gtk_tree_sortable_set_sort_column_id(
741 GTK_TREE_SORTABLE(cfd
->process_list
->list_store
),
745 histo_drawing_chunk_begin(histo_events_request
, histo_traceset
);
750 /*int histo_before_request(void *hook_data, void *call_data)
752 EventsRequest *events_request = (EventsRequest*)hook_data;
753 LttvTracesetState *tss = (LttvTracesetState*)call_data;
755 histo_drawing_data_request_begin(events_request, tss);
763 * after request is necessary in addition of after chunk in order to draw
764 * lines until the end of the screen. after chunk just draws lines until
771 /*int histo_after_request(void *hook_data, void *call_data)
782 int histo_after_chunk(void *hook_data
, void *call_data
)
784 EventsRequest
*events_request
= (EventsRequest
*)hook_data
;
785 HistoControlFlowData
*histocontrol_flow_data
= events_request
->viewer_data
;
788 histoDrawing_t
*drawing
= histocontrol_flow_data
->drawing
;
790 if(!histocontrol_flow_data
->chunk_has_begun
)
793 histocontrol_flow_data
->chunk_has_begun
= TRUE
;
797 end_time
= LTT_TIME_MIN(tfc
->timestamp
, events_request
->end_time
);
798 else /* end of traceset, or position now out of request : end */
800 end_time
= events_request
->end_time
;
802 guint x
, x_end
, width
;
804 TimeWindow time_window
=
805 lttvwindow_get_time_window(histocontrol_flow_data
->tab
);
807 g_debug("histo after chunk");
809 histo_convert_time_to_pixels(
814 x
= drawing
->damage_begin
;
816 drawing
->damage_begin
= x
+width
;
818 histogram_show (histocontrol_flow_data
,x
,x_end
);