From 021eeb4103ade4c06dc3c1d7475187483d86009a Mon Sep 17 00:00:00 2001 From: compudj Date: Mon, 22 Aug 2005 20:20:31 +0000 Subject: [PATCH] state hooks bug fixed git-svn-id: http://ltt.polymtl.ca/svn@1049 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/batchtest.c | 12 +++++------ ltt/branches/poly/lttv/lttv/state.c | 24 +++++++++++----------- ltt/branches/poly/lttv/lttv/stats.c | 4 ++-- ltt/branches/poly/lttv/lttv/tracecontext.c | 4 +--- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/ltt/branches/poly/lttv/lttv/batchtest.c b/ltt/branches/poly/lttv/lttv/batchtest.c index 1db159c5..bacca9ba 100644 --- a/ltt/branches/poly/lttv/lttv/batchtest.c +++ b/ltt/branches/poly/lttv/lttv/batchtest.c @@ -426,7 +426,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, lttv_hooks_add(event_hook, count_event, &count, LTTV_PRIO_DEFAULT); t = run_one_test(ts, ltt_time_zero, max_time); lttv_hooks_remove_data(event_hook, count_event, &count); - g_warning( + g_message( "Processing trace while counting events (%u events in %g seconds)", count, t); } @@ -437,7 +437,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, lttv_state_add_event_hooks(ts); t = run_one_test(ts, ltt_time_zero, max_time); lttv_state_remove_event_hooks(ts); - g_warning("Processing trace while updating state (%g seconds)", t); + g_message("Processing trace while updating state (%g seconds)", t); } /* Run through all events computing the state and writing it out @@ -477,7 +477,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, lttv_stats_add_event_hooks(tscs); t = run_one_test(ts, ltt_time_zero, max_time); lttv_stats_remove_event_hooks(tscs); - g_warning("Processing trace while counting stats (%g seconds)", t); + g_message("Processing trace while counting stats (%g seconds)", t); if(lttv_profile_memory) { g_message("Memory summary after computing stats"); @@ -513,7 +513,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, t = run_one_test(ts, ltt_time_zero, max_time); lttv_state_remove_event_hooks(ts); lttv_stats_remove_event_hooks(tscs); - g_warning( + g_message( "Processing trace while counting state and stats (%g seconds)", t); if(lttv_profile_memory) { @@ -552,7 +552,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, if(a_save_state_copy) lttv_hooks_remove_data(event_hook,save_state_copy_event, &save_state); - g_warning("Processing trace while updating/saving state (%g seconds)", t); + g_message("Processing trace while updating/saving state (%g seconds)", t); if(lttv_profile_memory) { g_message("Memory summary after computing/saving state"); @@ -572,7 +572,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, t = run_one_test(ts, save_state.write_time[j], save_state.write_time[j]); lttv_state_remove_event_hooks(ts); - g_warning("Seeking to %lu.%lu (%g seconds)", + g_message("Seeking to %lu.%lu (%g seconds)", save_state.write_time[j].tv_sec, save_state.write_time[j].tv_nsec, t); diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index 4e34eb42..969f556a 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -204,7 +204,7 @@ init(LttvTracesetState *self, LttvTraceset *ts) nb_trace = lttv_traceset_number(ts); for(i = 0 ; i < nb_trace ; i++) { tc = self->parent.traces[i]; - tcs = (LttvTraceState *)tc; + tcs = LTTV_TRACE_STATE(tc); tcs->save_interval = LTTV_STATE_SAVE_INTERVAL; lttv_attribute_find(tcs->parent.t_a, LTTV_STATE_TRACE_STATE_USE_COUNT, LTTV_UINT, &v); @@ -648,7 +648,7 @@ create_name_tables(LttvTraceState *tcs) GQuark f_name, e_name; - LttvTraceHook *h; + LttvTraceHook h; LttvTraceHookByFacility *thf; @@ -681,15 +681,15 @@ create_name_tables(LttvTraceState *tcs) if(lttv_trace_find_hook(tcs->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_SYSCALL_ENTRY, LTT_FIELD_SYSCALL_ID, 0, 0, - NULL, h)) + NULL, &h)) return; - thf = lttv_trace_hook_get_first(h); + thf = lttv_trace_hook_get_first(&h); t = ltt_field_type(thf->f1); nb = ltt_type_element_number(t); - lttv_trace_hook_destroy(h); + lttv_trace_hook_destroy(&h); /* CHECK syscalls should be an enum but currently are not! name_tables->syscall_names = g_new(GQuark, nb); @@ -709,15 +709,15 @@ create_name_tables(LttvTraceState *tcs) if(lttv_trace_find_hook(tcs->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_TRAP_ENTRY, LTT_FIELD_TRAP_ID, 0, 0, - NULL, h)) + NULL, &h)) return; - thf = lttv_trace_hook_get_first(h); + thf = lttv_trace_hook_get_first(&h); t = ltt_field_type(thf->f1); nb = ltt_type_element_number(t); - lttv_trace_hook_destroy(h); + lttv_trace_hook_destroy(&h); /* name_tables->trap_names = g_new(GQuark, nb); @@ -736,15 +736,15 @@ create_name_tables(LttvTraceState *tcs) if(lttv_trace_find_hook(tcs->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_IRQ_ENTRY, LTT_FIELD_IRQ_ID, 0, 0, - NULL, h)) + NULL, &h)) return; - thf = lttv_trace_hook_get_first(h); + thf = lttv_trace_hook_get_first(&h); t = ltt_field_type(thf->f1); nb = ltt_type_element_number(t); - lttv_trace_hook_destroy(h); + lttv_trace_hook_destroy(&h); /* name_tables->irq_names = g_new(GQuark, nb); @@ -1330,7 +1330,7 @@ void lttv_state_remove_event_hooks(LttvTracesetState *self) nb_trace = lttv_traceset_number(traceset); for(i = 0 ; i < nb_trace ; i++) { - ts = (LttvTraceState*)self->parent.traces[i]; + ts = LTTV_TRACE_STATE(self->parent.traces[i]); lttv_attribute_find(self->parent.a, LTTV_STATE_HOOKS, LTTV_POINTER, &val); hooks = *(val.v_pointer); diff --git a/ltt/branches/poly/lttv/lttv/stats.c b/ltt/branches/poly/lttv/lttv/stats.c index e604fea3..261b5676 100644 --- a/ltt/branches/poly/lttv/lttv/stats.c +++ b/ltt/branches/poly/lttv/lttv/stats.c @@ -97,8 +97,8 @@ init(LttvTracesetStats *self, LttvTraceset *ts) nb_trace = lttv_traceset_number(ts); for(i = 0 ; i < nb_trace ; i++) { - tc = (LTTV_TRACESET_CONTEXT(self)->traces[i]); - tcs = (LttvTraceStats *)tc; + tc = self->parent.parent.traces[i]; + tcs = LTTV_TRACE_STATS(tc); tcs->stats = lttv_attribute_find_subdir(tcs->parent.parent.t_a,LTTV_STATS); tracefiles_stats = lttv_attribute_find_subdir(tcs->parent.parent.t_a, diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index 4dd8e3a1..970da064 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -247,8 +247,6 @@ void fini(LttvTracesetContext *self) LttvTraceset *ts = self->ts; - //FIXME : segfault - g_tree_destroy(self->pqueue); g_object_unref(self->a); @@ -903,7 +901,7 @@ lttv_trace_find_hook(LttTrace *t, GQuark facility, GQuark event, LttvTraceHookByFacility *thf, *first_thf; facilities = ltt_trace_facility_get_by_name(t, facility); - + if(unlikely(facilities == NULL)) goto facility_error; th->fac_index = g_array_sized_new(FALSE, TRUE, -- 2.34.1