//#include <pango/pango.h>
-#include <ltt/event.h>
-#include <ltt/time.h>
-#include <ltt/trace.h>
-
#include <lttv/lttv.h>
#include <lttv/hook.h>
#include <lttv/state.h>
TimeWindow time_window = lttvwindow_get_time_window( tab );
LttTime time_start, time_end;
- LttvTraceState *ts;
-
//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.
// 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);
histo_after_chunk,
histo_events_request,
LTTV_PRIO_DEFAULT);
- ts = (LttvTraceState *)tsc->traces[i];
// Fill the events request
histo_events_request->owner = histocontrol_flow_data;
histo_events_request->viewer_data = histocontrol_flow_data;
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;
guint x;//time to pixel
LttTime event_time;
- LttEvent *e;
+ LttvEvent *e;
guint *element;
EventsRequest *events_request = (EventsRequest*)hook_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,
return 0;
}
-
+/* TODO ybrosseau 2012-03-15: Cleanup line_src */
void histogram_show(HistoControlFlowData *histocontrol_flow_data,guint draw_begin,
guint draw_end)
{
guint val, h_val;
- guint i, line_src;
+ guint i/*, line_src*/;
guint end_chunk=MIN(draw_end,(histocontrol_flow_data->number_of_process)->len);
for (i=draw_begin/*0*/;i<end_chunk/* (histocontrol_flow_data->number_of_process)->len*/;i++){
histo_convert_pixels_to_time(width, i+1,
time_window,
&t2);
- line_src=i;
+ /* line_src=i; */
//check if zoom in is used and more than 1 pixel correspond to each 1nsec
//used for drawing point (not line) on the screen.
}
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_real(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);
typedef struct _histo_ClosureData {
EventsRequest *events_request;
- LttvTracesetState *tss;
+ LttvTraceset *traceset;
LttTime end_time;
guint x_end;
} 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(
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;
}
{
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);
LttTime end_time;
histoDrawing_t *drawing = histocontrol_flow_data->drawing;
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;