X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fcontrolflow%2Fdrawing.c;h=3fdfdcc163307481ec9973365840fb983464250c;hb=e8d11122b46e7e2922e65825623c760f84a4d34f;hp=3a15130c9cccd404cc27e579bb52e41a57605659;hpb=20640e7057725a118fcca68e8675946561293a75;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c index 3a15130c..3fdfdcc1 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -28,7 +29,6 @@ #include "drawing.h" #include "eventhooks.h" #include "cfv.h" -#include "cfv-private.h" #define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format) #define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format) @@ -138,16 +138,14 @@ void drawing_data_request(Drawing_t *drawing, g_debug("x is : %i, x+width is : %i", x, x+width); convert_pixels_to_time(drawing->width, x, - time_window.start_time, - time_window.time_width, - window_end, + time_window, &start); convert_pixels_to_time(drawing->width, x+width, - time_window.start_time, - time_window.time_width, - window_end, + time_window, &time_end); + time_end = ltt_time_add(time_end, ltt_time_one); // because main window + // doesn't deliver end time. lttvwindow_events_request_remove_all(tab, control_flow_data); @@ -211,7 +209,7 @@ void drawing_data_request(Drawing_t *drawing, associated by id hooks. */ hooks = g_array_new(FALSE, FALSE, sizeof(LttvTraceHook)); - g_array_set_size(hooks, 16); + g_array_set_size(hooks, 15); /* before hooks */ @@ -253,29 +251,31 @@ void drawing_data_request(Drawing_t *drawing, lttv_trace_find_hook(ts->parent.t, "core","syscall_entry","syscall_id", NULL, NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 8)); - +#if 0 + /**** DESACTIVATED ****/ lttv_trace_find_hook(ts->parent.t, "core", "syscall_exit", NULL, NULL, NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 9)); +#endif //0 lttv_trace_find_hook(ts->parent.t, "core", "trap_entry", "trap_id", - NULL, NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 10)); + NULL, NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 9)); lttv_trace_find_hook(ts->parent.t, "core", "trap_exit", NULL, NULL, NULL, - after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 11)); + after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 10)); lttv_trace_find_hook(ts->parent.t, "core", "irq_entry", "irq_id", NULL, - NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 12)); + NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 11)); lttv_trace_find_hook(ts->parent.t, "core", "irq_exit", NULL, NULL, NULL, - after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 13)); + after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 12)); lttv_trace_find_hook(ts->parent.t, "core", "schedchange", "in", "out", "out_state", after_schedchange_hook, - &g_array_index(hooks, LttvTraceHook, 14)); + &g_array_index(hooks, LttvTraceHook, 13)); lttv_trace_find_hook(ts->parent.t, "core", "process", "event_sub_id", "event_data1", "event_data2", after_process_hook, - &g_array_index(hooks, LttvTraceHook, 15)); + &g_array_index(hooks, LttvTraceHook, 14)); #if 0 lttv_trace_find_hook(ts->parent.t, "core", "process_fork", "child_pid", @@ -387,6 +387,7 @@ static void set_last_start(gpointer key, gpointer value, gpointer user_data) hashed_process_data->x.under = x; hashed_process_data->x.under_used = FALSE; hashed_process_data->x.under_marked = FALSE; + hashed_process_data->next_good_time = ltt_time_zero; return; } @@ -406,15 +407,14 @@ void drawing_data_request_begin(EventsRequest *events_request, LttvTracesetState cfd->drawing->last_start = events_request->start_time; convert_time_to_pixels( - time_window.start_time, - time_window.time_width, - end_time, + time_window, events_request->start_time, width, &x); g_hash_table_foreach(cfd->process_list->process_hash, set_last_start, (gpointer)x); + } void drawing_chunk_begin(EventsRequest *events_request, LttvTracesetState *tss) @@ -423,7 +423,12 @@ void drawing_chunk_begin(EventsRequest *events_request, LttvTracesetState *tss) ControlFlowData *cfd = events_request->viewer_data; LttvTracesetContext *tsc = LTTV_TRACESET_CONTEXT(tss); LttTime current_time = lttv_traceset_context_get_current_tfc(tsc)->timestamp; + guint num_cpu = + ltt_trace_per_cpu_tracefile_number(tss->parent.traces[TRACE_NUMBER]->t); + cfd->process_list->current_hash_data = g_new(HashedProcessData*,num_cpu); + memset(cfd->process_list->current_hash_data, 0, + sizeof(HashedProcessData*)*num_cpu); //cfd->drawing->last_start = LTT_TIME_MIN(current_time, // events_request->end_time); } @@ -448,18 +453,14 @@ void drawing_request_expose(EventsRequest *events_request, #if 0 convert_time_to_pixels( - time_window.start_time, - time_window.time_width, - window_end, + time_window, cfd->drawing->last_start, drawing->width, &x); #endif //0 convert_time_to_pixels( - time_window.start_time, - time_window.time_width, - window_end, + time_window, end_time, drawing->width, &x_end); @@ -614,9 +615,7 @@ expose_event( GtkWidget *widget, GdkEventExpose *event, gpointer user_data ) { /* Draw the dotted lines */ convert_time_to_pixels( - time_window.start_time, - time_window.time_width, - window_end, + time_window, current_time, drawing->width, &cursor_x); @@ -704,9 +703,7 @@ button_press_event( GtkWidget *widget, GdkEventButton *event, gpointer user_data g_debug("x click is : %f", event->x); convert_pixels_to_time(drawing->width, (guint)event->x, - time_window.start_time, - time_window.time_width, - window_end, + time_window, &time); lttvwindow_report_current_time(control_flow_data->tab, time); @@ -926,55 +923,6 @@ GtkWidget *drawing_get_widget(Drawing_t *drawing) return drawing->vbox; } -/* convert_pixels_to_time - * - * Convert from window pixel and time interval to an absolute time. - */ -__inline void convert_pixels_to_time( - gint width, - guint x, - LttTime window_time_begin, - LttTime window_time_interval, - LttTime window_time_end, - LttTime *time) -{ - double time_d; - - 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); -} - - -__inline void convert_time_to_pixels( - LttTime window_time_begin, - LttTime window_time_interval, - LttTime window_time_end, - LttTime time, - int width, - guint *x) -{ - 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 - - time = ltt_time_sub(time, window_time_begin); - - 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); - } - -} - void drawing_draw_line( Drawing_t *drawing, GdkPixmap *pixmap, guint x1, guint y1,