Port histogram window to 2.x
authorYannick Brosseau <yannick.brosseau@gmail.com>
Wed, 11 Jul 2012 02:31:00 +0000 (22:31 -0400)
committerYannick Brosseau <yannick.brosseau@gmail.com>
Wed, 11 Jul 2012 02:31:00 +0000 (22:31 -0400)
Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
lttv/modules/gui/Makefile.am
lttv/modules/gui/histogram/histodrawing.c
lttv/modules/gui/histogram/histodrawing.h
lttv/modules/gui/histogram/histodrawitem.c
lttv/modules/gui/histogram/histoeventhooks.c
runlttv

index f88d7274f2e67f6cb190306cd4631161fbb30a0a..94f7887b832eb8922f93eaafe13ef3f7e1bcf967 100644 (file)
@@ -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
 
index 88287e1ccf5d685a5bfffeda93e51421004462cc..47829c6434119ae80c82b15b6beab71fedb00295 100644 (file)
@@ -27,7 +27,6 @@
 #include <ltt/trace.h>
 
 #include <lttv/lttv.h>
-#include <lttv/tracecontext.h>
 #include <lttvwindow/lttvwindow.h>
 #include <lttv/state.h>
 #include <lttv/hook.h>
@@ -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;
index 68fb211880e3d9ca63c793781acca616ee3e43e3..b2f17338faf28ec45bb6d065b04c7ef9e25f9b83 100644 (file)
@@ -24,8 +24,8 @@
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
 #include <ltt/ltt.h>
-#include <lttv/tracecontext.h>
-#include <lttv/state.h>
+//#include <lttv/tracecontext.h>
+#include <lttv/traceset.h>
 #include <lttvwindow/lttvwindow.h>
 #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
index d3c7d96130480d40011b85636a47f75caddb2d79..5e5d75549a50f74c0d110aa208fdbf529b7ddb37 100644 (file)
 #include <lttv/iattribute.h>
 #include <string.h>
 
-#include <lttv/tracecontext.h>
 #include <lttv/state.h>
 #include <lttv/lttv.h>
 
index d0d0557e0cc3b7d51fcd88491782c3c0c2f1de21..46aeca526a94bf6717ae7a074138ef2d999d08c1 100644 (file)
@@ -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; i<MIN(TRACE_NUMBER+1, nb_trace);i++) {
+  //TODO ybrosseau 2012-07-10: Just do one request
   for(i=0;i<nb_trace;i++) {
        //should be in the loop or before? 
        EventsRequest *histo_events_request = g_new(EventsRequest, 1);
@@ -216,7 +216,6 @@ void histo_request_event( HistoControlFlowData *histocontrol_flow_data, guint x,
        histo_events_request->before_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 9ba5fd63a9ee38b01ba7795d1a0f08b42bbb13e3..ebb968f48a20f388211a5f9327de75fe7f59127e 100755 (executable)
--- 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 () {
This page took 0.028549 seconds and 4 git commands to generate.