list_out : many events requests
-A. While (list_in !empty or list_out !empty) and !GTK Event pending
+0.1 Lock the traces
+0.2 Seek traces positions to current context position.
+
+A. While (list_in !empty or list_out !empty)
1. If list_in is empty (need a seek)
1.1 Add requests to list_in
1.1.1 Find all time requests with lowest start time in list_out (ltime)
1.3.2 call before chunk
1.3.3 events hooks added
2. Else, list_in is not empty, we continue a read
+ 2.0 For each req of list_in
+ - Call before chunk
+ - events hooks added
2.1 For each req of list_out
- if req.start time == current context time
or req.start position == current position
- req.num -= count
- if req.num == 0
or
- current context time > req.end time
+ current context time >= req.end time
or
req.end pos == current pos
or
req.stop_flag == TRUE
- Call end request for req
- remove req from list_in
+ If GTK Event pending : break A loop
B. When interrupted between chunks
1. for each request in list_in
1.2. Remove start time
1.3. Move from list_in to list_out
+C. Unlock the traces
+
Notes :
after_request
event_hook
event_hook_by_id
+ hook_adder
+ hook_remover
stats/
...
modulename1/
...
+Hook Adder and Hook remover
+
+Hook functions that takes a trace context as call data. They simply
+add / remove the computation related hooks from the trace context.
+
+
Modify Traceset
Points to the global traces. Main window must open a new one only when no
notify_out : queue of notifications that comes along with next processing.
+0.1 Lock traces
+0.2 Sync tracefiles
+
1. Before processing
- if list_in is empty
- Add all requests in list_out to list_in, empty list_out
- for each request in list_in
- set hooks'in_progress flag to TRUE
+ - call before request hook
- seek trace to start
- Move all notifications from notify_out to notify_in.
- for each request in list_in
- Call before chunk hooks for list_in
- - add hooks to context
+ - add hooks to context *note only one hook of each type added.
2. call process traceset middle for a chunk
(assert list_in is not empty! : should not even be called in that case)
3.1 call after_chunk hooks for list_in
- for each request in list_in
- Call after chunk hooks for list_in
- - remove hooks from context
+ - remove hooks from context *note : only one hook of each type
3.2 for each notify_in
- if current time >= notify time, call notify and remove from notify_in
- if current position >= notify position, call notify and remove from
- for each request in list_in
- set hooks'in_progress flag to FALSE
- set hooks'ready flag to TRUE
+ - call after request hook
- remove request
- for each notifications in notify_in
- call notify and remove from notify_in
- - return FALSE (scheduler stopped)
+ - reset the context
+ - if list_out is empty
+ return FALSE (scheduler stopped)
+ - else
+ return TRUE (scheduler still registered)
3.4 else
- return TRUE (scheduler still registered)
+4. Unlock traces
*
* So we have 53-30 = 23 bits left for tv_sec.
* */
+ g_assert(t1.tv_sec <= MAX_TV_SEC_TO_DOUBLE);
if(t1.tv_sec > MAX_TV_SEC_TO_DOUBLE)
g_warning("Precision loss in conversion LttTime to double");
return (double)t1.tv_sec + (double)t1.tv_nsec / NANOSECONDS_PER_SECOND;
*
* So we have 53-30 = 23 bits left for tv_sec.
* */
+ g_assert(t1 <= MAX_TV_SEC_TO_DOUBLE);
if(t1 > MAX_TV_SEC_TO_DOUBLE)
g_warning("Conversion from non precise double to LttTime");
LttTime res;
LttTime window_end = ltt_time_add(time_window.time_width,
time_window.start_time);
- convert_time_to_pixels(
- time_window.start_time,
- window_end,
- current_time,
- drawing->width,
- &cursor_x);
-
/* update the screen from the pixmap buffer */
gdk_draw_pixmap(widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
event->area.x, event->area.y,
event->area.width, event->area.height);
+
+ if(ltt_time_compare(time_window.start_time, current_time) <= 0 &&
+ ltt_time_compare(window_end, current_time) >= 0)
+ {
+ /* Draw the dotted lines */
+ convert_time_to_pixels(
+ time_window.start_time,
+ window_end,
+ current_time,
+ drawing->width,
+ &cursor_x);
+
- /* Draw the dotted lines */
+ if(drawing->dotted_gc == NULL) {
- if(drawing->dotted_gc == NULL) {
+ drawing->dotted_gc = gdk_gc_new(drawing->drawing_area->window);
+ gdk_gc_copy(drawing->dotted_gc, widget->style->white_gc);
+
+ gint8 dash_list[] = { 1, 2 };
+ gdk_gc_set_line_attributes(drawing->dotted_gc,
+ 1,
+ GDK_LINE_ON_OFF_DASH,
+ GDK_CAP_BUTT,
+ GDK_JOIN_MITER);
+ gdk_gc_set_dashes(drawing->dotted_gc,
+ 0,
+ dash_list,
+ 2);
+ }
- drawing->dotted_gc = gdk_gc_new(drawing->drawing_area->window);
- gdk_gc_copy(drawing->dotted_gc, widget->style->white_gc);
-
- gint8 dash_list[] = { 1, 2 };
- gdk_gc_set_line_attributes(drawing->dotted_gc,
- 1,
- GDK_LINE_ON_OFF_DASH,
- GDK_CAP_BUTT,
- GDK_JOIN_MITER);
- gdk_gc_set_dashes(drawing->dotted_gc,
- 0,
- dash_list,
- 2);
+ drawing_draw_line(NULL, widget->window,
+ cursor_x, 0,
+ cursor_x, drawing->height,
+ drawing->dotted_gc);
}
-
- drawing_draw_line(NULL, widget->window,
- cursor_x, 0,
- cursor_x, drawing->height,
- drawing->dotted_gc);
return FALSE;
}
LttTime window_time_interval;
double interval_double, time_double;
+ g_assert(ltt_time_compare(window_time_begin, time) <= 0 &&
+ ltt_time_compare(window_time_end, time) >= 0);
+
window_time_interval = ltt_time_sub(window_time_end,window_time_begin);
time = ltt_time_sub(time, window_time_begin);
ProcessList *process_list =
guicontrolflow_get_process_list(control_flow_data);
- if(tfc != NULL)
+ if(tfc != NULL
+ && ltt_time_compare(tfc->timestamp, events_request->end_time) <= 0)
end_time = tfc->timestamp;
- else /* end of traceset */
- end_time = tsc->time_span.end_time;
-
+ else /* end of traceset, or position now out of request : end */
+ end_time = events_request->end_time;
+
ClosureData closure_data;
closure_data.events_request = (EventsRequest*)hook_data;
closure_data.tss = tss;
sprintf(str_path,"%d\0",count);
path = gtk_tree_path_new_from_string (str_path);
gtk_tree_view_set_cursor(GTK_TREE_VIEW(event_viewer_data->tree_v), path, NULL, FALSE);
- g_signal_stop_emission_by_name(G_OBJECT(event_viewer_data->tree_v), "cursor-changed");
+ //g_signal_stop_emission_by_name(G_OBJECT(event_viewer_data->tree_v), "cursor-changed");
gtk_tree_path_free(path);
return FALSE;
LTTV_TRACESET_CONTEXT(tab->traceset_info->traceset_context);
TimeInterval time_span = tsc->time_span;
GtkAdjustment *adjustment = gtk_range_get_adjustment(GTK_RANGE(tab->scrollbar));
+ LttTime upper = ltt_time_sub(time_span.end_time, time_span.start_time);
g_object_set(G_OBJECT(adjustment),
"lower",
- 0, /* lower */
+ 0.0, /* lower */
"upper",
- ltt_time_to_double(
- ltt_time_sub(time_span.end_time, time_span.start_time))
+ ltt_time_to_double(upper)
* NANOSECONDS_PER_SECOND, /* upper */
"step_increment",
ltt_time_to_double(tab->time_window.time_width)
//
//
+ LttTime rel_time =
+ ltt_time_sub(new_time_window.start_time, time_span.start_time);
if( ltt_time_to_double(new_time_window.time_width)
* NANOSECONDS_PER_SECOND
/ SCROLL_STEP_PER_PAGE/* step increment */
+
- ltt_time_to_double(new_time_window.start_time)
- * NANOSECONDS_PER_SECOND /* page size */
+ ltt_time_to_double(rel_time) * NANOSECONDS_PER_SECOND /* page size */
==
- ltt_time_to_double(new_time_window.start_time)
- * NANOSECONDS_PER_SECOND /* page size */
+ ltt_time_to_double(rel_time) * NANOSECONDS_PER_SECOND /* page size */
) {
g_warning("Can not zoom that far due to scrollbar precision");
} else if(
//ltt_time_to_double(new_time_window.start_time)
// * NANOSECONDS_PER_SECOND, /* value */
"lower",
- 0, /* lower */
+ 0.0, /* lower */
"upper",
ltt_time_to_double(
ltt_time_sub(time_span.end_time, time_span.start_time))
g_object_set(G_OBJECT(adjustment),
"lower",
- 0, /* lower */
+ 0.0, /* lower */
"upper",
ltt_time_to_double(
ltt_time_sub(time_span.end_time, time_span.start_time))
LTTV_MODULE("textDump", "Print events in a file", \
"Produce a detailed text printout of a trace", \
- init, destroy, "stats", "batchAnalysis")
-
-
-
+ init, destroy, "stats", "batchAnalysis", "option")