From 64242d134638369e81510c880ae66a88beba9c1b Mon Sep 17 00:00:00 2001 From: Yannick Brosseau Date: Tue, 10 Jul 2012 22:31:00 -0400 Subject: [PATCH] Port histogram window to 2.x Signed-off-by: Yannick Brosseau --- lttv/modules/gui/Makefile.am | 4 +- lttv/modules/gui/histogram/histodrawing.c | 7 ++-- lttv/modules/gui/histogram/histodrawing.h | 10 ++--- lttv/modules/gui/histogram/histodrawitem.c | 1 - lttv/modules/gui/histogram/histoeventhooks.c | 41 ++++++++++---------- runlttv | 7 ++-- 6 files changed, 34 insertions(+), 36 deletions(-) diff --git a/lttv/modules/gui/Makefile.am b/lttv/modules/gui/Makefile.am index f88d7274..94f7887b 100644 --- a/lttv/modules/gui/Makefile.am +++ b/lttv/modules/gui/Makefile.am @@ -6,8 +6,8 @@ # WARNING : subdirs order is important : mainWin depends on API -SUBDIRS = lttvwindow detailedevents -# controlflow statistics filter tracecontrol histogram interrupts resourceview +SUBDIRS = lttvwindow detailedevents histogram +# controlflow statistics filter tracecontrol interrupts resourceview # TODO: PORT for 0.10 #diskperformance tutorial diff --git a/lttv/modules/gui/histogram/histodrawing.c b/lttv/modules/gui/histogram/histodrawing.c index 88287e1c..47829c64 100644 --- a/lttv/modules/gui/histogram/histodrawing.c +++ b/lttv/modules/gui/histogram/histodrawing.c @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -132,7 +131,7 @@ void histo_drawing_data_request(histoDrawing_t *drawing, } -void histo_drawing_data_request_begin(EventsRequest *events_request, LttvTracesetState *tss) +void histo_drawing_data_request_begin(EventsRequest *events_request, LttvTraceset *traceset) { g_debug("Begin of data request"); HistoControlFlowData *cfd = events_request->viewer_data; @@ -152,7 +151,7 @@ void histo_drawing_data_request_begin(EventsRequest *events_request, LttvTracese } -void histo_drawing_chunk_begin(EventsRequest *events_request, LttvTracesetState *tss) +void histo_drawing_chunk_begin(EventsRequest *events_request, LttvTraceset *traceset) { g_debug("Begin of chunk"); HistoControlFlowData *cfd = events_request->viewer_data; @@ -164,7 +163,7 @@ void histo_drawing_chunk_begin(EventsRequest *events_request, LttvTracesetState void histo_drawing_request_expose(EventsRequest *events_request, - LttvTracesetState *tss, + LttvTraceset *traceset, LttTime end_time) { HistoControlFlowData *cfd = events_request->viewer_data; diff --git a/lttv/modules/gui/histogram/histodrawing.h b/lttv/modules/gui/histogram/histodrawing.h index 68fb2118..b2f17338 100644 --- a/lttv/modules/gui/histogram/histodrawing.h +++ b/lttv/modules/gui/histogram/histodrawing.h @@ -24,8 +24,8 @@ #include #include #include -#include -#include +//#include +#include #include #include "histocfv.h" #include "histodrawitem.h" @@ -151,12 +151,12 @@ void histo_drawing_update_ruler(histoDrawing_t *drawing, TimeWindow *time_window void histo_drawing_update_vertical_ruler(histoDrawing_t *drawing);//, TimeWindow *time_window); void histo_drawing_request_expose(EventsRequest *events_request, - LttvTracesetState *tss, + LttvTraceset *traceset, LttTime end_time); void histo_drawing_data_request_begin(EventsRequest *events_request, - LttvTracesetState *tss); -void histo_drawing_chunk_begin(EventsRequest *events_request, LttvTracesetState *tss); + LttvTraceset *traceset); +void histo_drawing_chunk_begin(EventsRequest *events_request, LttvTraceset *traceset); /* histo_convert_pixels_to_time diff --git a/lttv/modules/gui/histogram/histodrawitem.c b/lttv/modules/gui/histogram/histodrawitem.c index d3c7d961..5e5d7554 100644 --- a/lttv/modules/gui/histogram/histodrawitem.c +++ b/lttv/modules/gui/histogram/histodrawitem.c @@ -106,7 +106,6 @@ #include #include -#include #include #include diff --git a/lttv/modules/gui/histogram/histoeventhooks.c b/lttv/modules/gui/histogram/histoeventhooks.c index d0d0557e..46aeca52 100644 --- a/lttv/modules/gui/histogram/histoeventhooks.c +++ b/lttv/modules/gui/histogram/histoeventhooks.c @@ -147,9 +147,8 @@ void histo_request_event( HistoControlFlowData *histocontrol_flow_data, guint x, LttTime time_start, time_end; //find the tracehooks - LttvTracesetContext *tsc = lttvwindow_get_traceset_context(tab); + LttvTraceset *traceset = lttvwindow_get_traceset(tab); - LttvTraceset *traceset = tsc->ts; nb_trace = lttv_traceset_number(traceset); guint drawing_width= histocontrol_flow_data->drawing->width; //start time for chunk. @@ -169,6 +168,7 @@ void histo_request_event( HistoControlFlowData *histocontrol_flow_data, guint x, // LttvHooksById *histo_event_by_id = lttv_hooks_by_id_new();//if necessary for filter! // FIXME : eventually request for more traces // fixed for(i = 0; ibefore_chunk_trace = NULL; histo_events_request->before_chunk_tracefile= NULL; histo_events_request->event = histo_count_event_hooks; - histo_events_request->event_by_id_channel = NULL;//histo_event_by_id;//NULL; histo_events_request->after_chunk_tracefile = NULL; histo_events_request->after_chunk_trace = NULL; histo_events_request->after_chunk_traceset = histo_after_chunk_traceset;//NULL; @@ -233,7 +232,7 @@ int histo_count_event(void *hook_data, void *call_data){ guint x;//time to pixel LttTime event_time; - LttEvent *e; + LttvEvent *e; guint *element; EventsRequest *events_request = (EventsRequest*)hook_data; @@ -244,19 +243,16 @@ int histo_count_event(void *hook_data, void *call_data){ g_info("Histogram: count_event() \n"); - - LttvTracefileContext *tfc = (LttvTracefileContext *)call_data; - - e = ltt_tracefile_get_event(tfc->tf); - + e = (LttvEvent *)call_data; +#ifdef BABEL_CLEANUP LttvFilter *histo_filter = histocontrol_flow_data->histo_main_win_filter; if(histo_filter != NULL && histo_filter->head != NULL) if(!lttv_filter_tree_parse(histo_filter->head,e,tfc->tf, tfc->t_context->t,tfc,NULL,NULL)) return FALSE; - +#endif TimeWindow time_window = lttvwindow_get_time_window(histocontrol_flow_data->tab); - event_time = ltt_event_time(e); + event_time = lttv_event_get_timestamp(e); histo_convert_time_to_pixels( time_window, @@ -636,11 +632,12 @@ gint histo_update_current_time_hook(void *hook_data, void *call_data) } LttTime time_end = ltt_time_add(time_begin, width); - LttvTracesetContext * tsc = - lttvwindow_get_traceset_context(histocontrol_flow_data->tab); - - LttTime trace_start = tsc->time_span.start_time; - LttTime trace_end = tsc->time_span.end_time; + LttvTraceset *traceset = + lttvwindow_get_traceset(histocontrol_flow_data->tab); + TimeInterval time_span = lttv_traceset_get_time_span(traceset); + + LttTime trace_start = time_span.start_time; + LttTime trace_end = time_span.end_time; g_info("Histogram: New current time HOOK : %lu, %lu", current_time.tv_sec, current_time.tv_nsec); @@ -731,7 +728,7 @@ gboolean histo_filter_changed(void * hook_data, void * call_data) typedef struct _histo_ClosureData { EventsRequest *events_request; - LttvTracesetState *tss; + LttvTraceset *traceset; LttTime end_time; guint x_end; } histo_ClosureData; @@ -741,7 +738,7 @@ typedef struct _histo_ClosureData { int histo_before_chunk(void *hook_data, void *call_data) { EventsRequest *histo_events_request = (EventsRequest*)hook_data; - LttvTracesetState *histo_tss = (LttvTracesetState*)call_data; + LttvTraceset *histo_traceset = (LttvTraceset*)call_data; #if 0 /* Desactivate sort */ gtk_tree_sortable_set_sort_column_id( @@ -749,7 +746,7 @@ int histo_before_chunk(void *hook_data, void *call_data) TRACE_COLUMN, GTK_SORT_ASCENDING); #endif //0 - histo_drawing_chunk_begin(histo_events_request, histo_tss); + histo_drawing_chunk_begin(histo_events_request, histo_traceset); return 0; } @@ -790,8 +787,8 @@ int histo_after_chunk(void *hook_data, void *call_data) { EventsRequest *events_request = (EventsRequest*)hook_data; HistoControlFlowData *histocontrol_flow_data = events_request->viewer_data; - LttvTracesetContext *tsc = (LttvTracesetContext*)call_data; - LttvTracefileContext *tfc = lttv_traceset_context_get_current_tfc(tsc); + LttvTraceset *traceset = (LttvTraceset*)call_data; + LttTime end_time; histoDrawing_t *drawing = histocontrol_flow_data->drawing; @@ -801,9 +798,11 @@ int histo_after_chunk(void *hook_data, void *call_data) histocontrol_flow_data->chunk_has_begun = TRUE; +#ifdef BABEL_CLEANUP if(tfc != NULL) end_time = LTT_TIME_MIN(tfc->timestamp, events_request->end_time); else /* end of traceset, or position now out of request : end */ +#endif end_time = events_request->end_time; guint x, x_end, width; diff --git a/runlttv b/runlttv index 9ba5fd63..ebb968f4 100755 --- a/runlttv +++ b/runlttv @@ -16,14 +16,15 @@ RCFILE="$(dirname $0)/.runlttvrc" TEXTLIBS="-L ${BUILDPATH}/lttv/modules/text/.libs -m textDump" EVALLIBS="-L ${BUILDPATH}/lttv/modules/text/.libs -m sync_chain_batch" GRAPHLIBS="-L ${BUILDPATH}/lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow "\ -"-L ${BUILDPATH}/lttv/modules/gui/detailedevents/.libs -m guievents" +"-L ${BUILDPATH}/lttv/modules/gui/detailedevents/.libs -m guievents "\ +"-L ${BUILDPATH}/lttv/modules/gui/histogram/.libs -m guihistogram" #"-L ${BUILDPATH}/lttv/modules/gui/controlflow/.libs -m guicontrolflow "\ #"-L ${BUILDPATH}/lttv/modules/gui/tracecontrol/.libs -m guitracecontrol "\ #"-L ${BUILDPATH}/lttv/modules/gui/statistics/.libs -m guistatistics "\ #"-L ${BUILDPATH}/lttv/modules/gui/resourceview/.libs -m resourceview "\ #"-L ${BUILDPATH}/lttv/modules/gui/filter/.libs -m guifilter "\ -#"-L ${BUILDPATH}/lttv/modules/gui/interrupts/.libs -m interrupts "\ -#"-L ${BUILDPATH}/lttv/modules/gui/histogram/.libs -m guihistogram" +#"-L ${BUILDPATH}/lttv/modules/gui/interrupts/.libs -m interrupts " + DEFAULTMODE="gui" usage () { -- 2.34.1