From 8fe3c6b699e245cf9a5263e687778dc10d501f4b Mon Sep 17 00:00:00 2001 From: compudj Date: Wed, 24 Aug 2005 15:23:41 +0000 Subject: [PATCH] fix back textcontree tree compare function : was allright before git-svn-id: http://ltt.polymtl.ca/svn@1071 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/batchtest.c | 26 ++++++++++++++++++++++ ltt/branches/poly/lttv/lttv/tracecontext.c | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/ltt/branches/poly/lttv/lttv/batchtest.c b/ltt/branches/poly/lttv/lttv/batchtest.c index bacca9ba..a7de1fd7 100644 --- a/ltt/branches/poly/lttv/lttv/batchtest.c +++ b/ltt/branches/poly/lttv/lttv/batchtest.c @@ -176,12 +176,38 @@ gboolean trace_event(void __UNUSED__ *hook_data, void *call_data) return FALSE; } +static LttTime count_previous_time = { 0, 0 }; gboolean count_event(void *hook_data, void __UNUSED__ *call_data) { + LttvTracefileState *tfs = (LttvTracefileState *)call_data; + LttTracefile *tracefile = tfs->parent.tf; + guint nb_block, offset; + LttTracefile *tf_pos; + guint64 tsc; + LttEvent * event = ltt_tracefile_get_event(tracefile); + LttTime time; guint *pcount = (guint *)hook_data; (*pcount)++; + + time = ltt_event_time(event); + ltt_event_position(event, a_event_position); + ltt_event_position_get(a_event_position, &tf_pos, &nb_block, &offset, &tsc); + + if(ltt_time_compare(time, count_previous_time) < 0) { + g_warning("Time decreasing trace %s tracefile %s cpu %u position %u/%u", + g_quark_to_string(ltt_trace_name(ltt_tracefile_get_trace(tracefile))), + g_quark_to_string(ltt_tracefile_name(tracefile)), + ltt_tracefile_num(tracefile), nb_block, offset); + g_warning("last time %lu.%lu vs current %lu.%lu", + count_previous_time.tv_sec, count_previous_time.tv_nsec, + time.tv_sec, time.tv_nsec); + } + count_previous_time = time; + + + return FALSE; } diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index 5c2a17cb..03cee2cc 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -39,7 +39,7 @@ gint compare_tracefile(gconstpointer a, gconstpointer b) const LttvTracefileContext *trace_b = (const LttvTracefileContext *)b; if(likely(trace_a != trace_b)) { - comparison = ltt_time_compare(trace_b->timestamp, trace_a->timestamp); + comparison = ltt_time_compare(trace_a->timestamp, trace_b->timestamp); if(unlikely(comparison == 0)) { if(trace_a->index < trace_b->index) comparison = -1; else if(trace_a->index > trace_b->index) comparison = 1; -- 2.34.1