From 14aecf75cdcf156e9070f8ac054307290d72bbdb Mon Sep 17 00:00:00 2001 From: compudj Date: Wed, 31 Aug 2005 17:36:04 +0000 Subject: [PATCH] fix state computation so it put max time computed in seek to end of trace time value at the end git-svn-id: http://ltt.polymtl.ca/svn@1098 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/state.c | 26 +++++++++++++++++++++- ltt/branches/poly/lttv/lttv/tracecontext.c | 2 ++ ltt/branches/poly/lttv/lttv/tracecontext.h | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index c06ba340..5c1452cb 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -1597,6 +1597,15 @@ static gboolean state_save_event_hook(void *hook_data, void *call_data) return FALSE; } +static gboolean state_save_after_trace_hook(void *hook_data, void *call_data) +{ + LttvTraceState *tcs = (LttvTraceState *)(call_data); + + *(tcs->max_time_state_recomputed_in_seek) = tcs->parent.time_span.end_time; + + return FALSE; +} + #if 0 static gboolean block_start(void *hook_data, void *call_data) { @@ -1745,6 +1754,10 @@ void lttv_state_save_add_event_hooks(LttvTracesetState *self) } } + + lttv_process_traceset_begin(&self->parent, + NULL, NULL, NULL, NULL, NULL); + } gint lttv_state_save_hook_add_event_hooks(void *hook_data, void *call_data) @@ -1805,7 +1818,19 @@ void lttv_state_save_remove_event_hooks(LttvTracesetState *self) LttvTracefileState *tfs; + LttvHooks *after_trace = lttv_hooks_new(); + + lttv_hooks_add(after_trace, + state_save_after_trace_hook, + NULL, + LTTV_PRIO_STATE); + + + lttv_process_traceset_end(&self->parent, + NULL, after_trace, NULL, NULL, NULL); + lttv_hooks_destroy(after_trace); + nb_trace = lttv_traceset_number(traceset); for(i = 0 ; i < nb_trace ; i++) { @@ -1820,7 +1845,6 @@ void lttv_state_save_remove_event_hooks(LttvTracesetState *self) LttvTracefileContext*, j)); event_count = lttv_hooks_remove(tfs->parent.event, state_save_event_hook); - } g_free(event_count); } diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index 5e7ad282..7d560557 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -134,6 +134,8 @@ static void lttv_traceset_context_compute_time_span( trace = tc->t; ltt_trace_time_span_get(trace, &s, &e); + tc->time_span.start_time = s; + tc->time_span.end_time = e; if(i==0){ time_span->start_time = s; diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.h b/ltt/branches/poly/lttv/lttv/tracecontext.h index 714c0a18..c200ff51 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.h +++ b/ltt/branches/poly/lttv/lttv/tracecontext.h @@ -147,6 +147,7 @@ struct _LttvTraceContext { GArray *tracefiles; LttvAttribute *a; LttvAttribute *t_a; + TimeInterval time_span; }; struct _LttvTraceContextClass { -- 2.34.1