state hooks bug fixed
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 22 Aug 2005 20:20:31 +0000 (20:20 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 22 Aug 2005 20:20:31 +0000 (20:20 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1049 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/lttv/batchtest.c
ltt/branches/poly/lttv/lttv/state.c
ltt/branches/poly/lttv/lttv/stats.c
ltt/branches/poly/lttv/lttv/tracecontext.c

index 1db159c5280e280844303ea8e10ee9f44b894966..bacca9ba31a804146a5f4e407b4f1091c556782c 100644 (file)
@@ -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);
 
index 4e34eb424f3c09f4a006847a1d8a297351ddc6a8..969f556a834aecf4441ad4e98ab1173dfdcbdca1 100644 (file)
@@ -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);
 
index e604fea307d5608bd643dc96ca6cbdcad0edac2b..261b5676cf643f5555bc75f41f911667ce789d88 100644 (file)
@@ -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, 
index 4dd8e3a18de3bb8590b41fb6ae6e08ad99a06849..970da06454407f05b1bea32c6f0b9c5ffc3c5084 100644 (file)
@@ -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,
This page took 0.041324 seconds and 4 git commands to generate.