//FIXME
#define TRACE_NUMBER 0
-
+#if 0 /* colors for two lines representation */
GdkColor drawing_colors[NUM_COLORS] =
{ /* Pixel, R, G, B */
{ 0, 0, 0, 0 }, /* COL_BLACK */
{ 0, 0xFFFF, 0xFFFF, 0xFFFF } /* COL_MODE_UNKNOWN : white */
};
+#endif //0
+
+
+GdkColor drawing_colors[NUM_COLORS] =
+{ /* Pixel, R, G, B */
+ { 0, 0, 0, 0 }, /* COL_BLACK */
+ { 0, 0xFFFF, 0xFFFF, 0xFFFF }, /* COL_WHITE */
+ { 0, 0x0000, 0xFF00, 0x0000 }, /* COL_RUN_USER_MODE : green */
+ { 0, 0x0100, 0x9E00, 0xFFFF }, /* COL_RUN_SYSCALL : pale blue */
+ { 0, 0xFF00, 0xFF00, 0x0100 }, /* COL_RUN_TRAP : yellow */
+ { 0, 0xFFFF, 0x0000, 0x0000 }, /* COL_RUN_IRQ : red */
+ { 0, 0xA3FF, 0x0000, 0x0000 }, /* COL_WAIT : dark red */
+ { 0, 0x7700, 0x7700, 0x0000 }, /* COL_WAIT_CPU : dark yellow */
+ { 0, 0x6400, 0x0000, 0x5D00 }, /* COL_ZOMBIE : dark purple */
+ { 0, 0x0700, 0x6400, 0x0000 }, /* COL_WAIT_FORK : dark green */
+ { 0, 0x8900, 0x0000, 0x8400 }, /* COL_EXIT : "less dark" magenta */
+ { 0, 0xFFFF, 0xFFFF, 0xFFFF }, /* COL_MODE_UNKNOWN : white */
+ { 0, 0xFFFF, 0xFFFF, 0xFFFF } /* COL_UNNAMED : white */
+
+};
+
/*
RUN+USER MODE green
RUN+SYSCALL
if(width < 0) return ;
if(height < 0) return ;
- if(drawing->gc == NULL) {
- drawing->gc = gdk_gc_new(drawing->drawing_area->window);
- gdk_gc_copy(drawing->gc, drawing->drawing_area->style->black_gc);
- }
-
-
Tab *tab = drawing->control_flow_data->tab;
TimeWindow time_window =
lttvwindow_get_time_window(tab);
nb_trace = lttv_traceset_number(traceset);
// FIXME : eventually request for more traces
// for(i = 0 ; i < nb_trace ; i++) {
- g_assert(TRACE_NUMBER < nb_trace);
- i = TRACE_NUMBER;
+ for(i = 0; i<MIN(TRACE_NUMBER+1, nb_trace);i++)
{
EventsRequest *events_request = g_new(EventsRequest, 1);
// Create the hooks
guint x = (guint)user_data;
hashed_process_data->x.over = x;
+ hashed_process_data->x.over_used = FALSE;
+ hashed_process_data->x.over_marked = FALSE;
hashed_process_data->x.middle = x;
+ hashed_process_data->x.middle_used = FALSE;
+ hashed_process_data->x.middle_marked = FALSE;
hashed_process_data->x.under = x;
+ hashed_process_data->x.under_used = FALSE;
+ hashed_process_data->x.under_marked = FALSE;
return;
}
(ControlFlowData*)g_object_get_data(
G_OBJECT(widget),
"control_flow_data");
+ if(drawing->gc == NULL) {
+ drawing->gc = gdk_gc_new(drawing->drawing_area->window);
+ gdk_gc_copy(drawing->gc, drawing->drawing_area->style->black_gc);
+ }
TimeWindow time_window =
lttvwindow_get_time_window(control_flow_data->tab);
/* Allocate the colors */
GdkColormap* colormap = gdk_colormap_get_system();
-
+ gboolean success[NUM_COLORS];
gdk_colormap_alloc_colors(colormap, drawing_colors, NUM_COLORS, FALSE,
- TRUE, NULL);
-
+ TRUE, success);
return drawing;
}
LttTime *time)
{
LttTime window_time_interval;
- guint64 time_ll;
+ double time_d;
window_time_interval = ltt_time_sub(window_time_end,
window_time_begin);
- time_ll = ltt_time_to_uint64(window_time_interval);
- time_ll = time_ll * x / width;
- *time = ltt_time_from_uint64(time_ll);
+ time_d = ltt_time_to_double(window_time_interval);
+ time_d = time_d / (double)width * (double)x;
+ *time = ltt_time_from_double(time_d);
*time = ltt_time_add(window_time_begin, *time);
}
guint *x)
{
LttTime window_time_interval;
- guint64 time_ll, interval_ll;
-
+ double time_d, interval_d;
+#ifdef EXTRA_CHECK
g_assert(ltt_time_compare(window_time_begin, time) <= 0 &&
ltt_time_compare(window_time_end, time) >= 0);
-
+#endif //EXTRA_CHECK
window_time_interval = ltt_time_sub(window_time_end,window_time_begin);
time = ltt_time_sub(time, window_time_begin);
- time_ll = ltt_time_to_uint64(time);
- interval_ll = ltt_time_to_uint64(window_time_interval);
-
- *x = (guint)(time_ll * width / interval_ll);
+ time_d = ltt_time_to_double(time);
+ interval_d = ltt_time_to_double(window_time_interval);
+
+ if(interval_d == 0.0) {
+ g_assert(time_d == 0.0);
+ *x = 0;
+ } else {
+ *x = (guint)(time_d / interval_d * (double)width);
+ }
}