From d2a03e9dccafdab513865aaf1f8667290fac32a2 Mon Sep 17 00:00:00 2001 From: compudj Date: Thu, 6 Jul 2006 17:49:49 +0000 Subject: [PATCH] support multiple traces in histo git-svn-id: http://ltt.polymtl.ca/svn@1976 04897980-b3bd-0310-b5e0-8ef037075253 --- .../poly/lttv/modules/gui/histogram/histocfv.h | 3 ++- .../lttv/modules/gui/histogram/histodrawing.c | 18 ++++++------------ .../modules/gui/histogram/histoeventhooks.c | 9 ++++++--- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/ltt/branches/poly/lttv/modules/gui/histogram/histocfv.h b/ltt/branches/poly/lttv/modules/gui/histogram/histocfv.h index d897f77d..6f6ba95b 100644 --- a/ltt/branches/poly/lttv/modules/gui/histogram/histocfv.h +++ b/ltt/branches/poly/lttv/modules/gui/histogram/histocfv.h @@ -70,7 +70,8 @@ struct _HistoControlFlowData { // For histogram guint max_height; - LttvFilter *histo_main_win_filter; + LttvFilter *histo_main_win_filter; + gboolean chunk_has_begun; } ; /* Control Flow Data constructor */ diff --git a/ltt/branches/poly/lttv/modules/gui/histogram/histodrawing.c b/ltt/branches/poly/lttv/modules/gui/histogram/histodrawing.c index 173276f2..53addbce 100644 --- a/ltt/branches/poly/lttv/modules/gui/histogram/histodrawing.c +++ b/ltt/branches/poly/lttv/modules/gui/histogram/histodrawing.c @@ -40,7 +40,7 @@ #define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format) //FIXME -#define TRACE_NUMBER 0 +// fixed #define TRACE_NUMBER 0 #define EXTRA_ALLOC 1024 // pixels #define padding_width 50 @@ -149,21 +149,15 @@ 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, LttvTracesetState *tss) { g_debug("Begin of chunk"); HistoControlFlowData *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_get_num_cpu(tss->parent.traces[TRACE_NUMBER]->t); - - /* //disabled for histogram - 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); + + if(cfd->chunk_has_begun) return; + + cfd->chunk_has_begun = TRUE; } diff --git a/ltt/branches/poly/lttv/modules/gui/histogram/histoeventhooks.c b/ltt/branches/poly/lttv/modules/gui/histogram/histoeventhooks.c index dc37164c..96382c87 100644 --- a/ltt/branches/poly/lttv/modules/gui/histogram/histoeventhooks.c +++ b/ltt/branches/poly/lttv/modules/gui/histogram/histoeventhooks.c @@ -81,7 +81,7 @@ #define MAX_PATH_LEN 256 #define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format) //FIXME -#define TRACE_NUMBER 0 +// fixed #define TRACE_NUMBER 0 #define EXTRA_ALLOC 1024 // pixels /* Action to do when background computation completed. @@ -251,8 +251,8 @@ 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 - for(i = 0; idrawing; + if(!histocontrol_flow_data->chunk_has_begun) return; + histocontrol_flow_data->chunk_has_begun = TRUE; + 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 */ -- 2.34.1