traceset stats fixed
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sat, 11 Mar 2006 00:32:28 +0000 (00:32 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sat, 11 Mar 2006 00:32:28 +0000 (00:32 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1680 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/lttv/stats.c
ltt/branches/poly/lttv/lttv/stats.h

index 3e3543eb84999ae6211e827ce4eb1b37b8b7af8e..36b4b3831c65b1d15bb0be151b481326ebd38485 100644 (file)
@@ -701,7 +701,7 @@ gboolean every_event(void *hook_data, void *call_data)
 
 
 void
-lttv_stats_sum_trace(LttvTraceStats *self)
+lttv_stats_sum_trace(LttvTraceStats *self, LttvAttribute *ts_stats)
 {
   LttvAttribute *sum_container = self->stats;
 
@@ -715,6 +715,8 @@ lttv_stats_sum_trace(LttvTraceStats *self)
 
   unsigned sum;
 
+       int trace_is_summed;
+
   int i, j, k, l, m, nb_process, nb_cpu, nb_mode_type, nb_submode,
       nb_event_type, nf, nb_functions;
 
@@ -731,7 +733,7 @@ lttv_stats_sum_trace(LttvTraceStats *self)
   lttv_attribute_find(sum_container,
                       LTTV_STATS_SUMMED, 
                       LTTV_UINT, &value);
-  if(*(value.v_uint) != 0) return;
+       trace_is_summed = *(value.v_uint);
   *(value.v_uint) = 1;
 
   processes_tree = lttv_attribute_find_subdir(main_tree, 
@@ -798,16 +800,23 @@ lttv_stats_sum_trace(LttvTraceStats *self)
                                                type = lttv_attribute_get(submodes_tree, l, &name, &value,
                                                                &is_named);
                                                submode_tree = LTTV_ATTRIBUTE(*(value.v_gobject));
-                                               lttv_attribute_recursive_add(mode_events_tree, event_types_tree);
-                                               lttv_attribute_recursive_add(mode_types_tree, submode_tree);
+                                               if(!trace_is_summed) {
+                                                       lttv_attribute_recursive_add(mode_events_tree, event_types_tree);
+                                                       lttv_attribute_recursive_add(mode_types_tree, submode_tree);
+                                               }
                                        }
-                                       lttv_attribute_recursive_add(main_tree, mode_types_tree);
-                                       lttv_attribute_recursive_add(trace_cpu_tree, mode_types_tree);
-                                       lttv_attribute_recursive_add(process_tree, mode_types_tree);
-                                       lttv_attribute_recursive_add(function_tree, mode_types_tree);
+                                       if(!trace_is_summed) {
+                                               lttv_attribute_recursive_add(main_tree, mode_types_tree);
+                                               lttv_attribute_recursive_add(trace_cpu_tree, mode_types_tree);
+                                               lttv_attribute_recursive_add(process_tree, mode_types_tree);
+                                               lttv_attribute_recursive_add(function_tree, mode_types_tree);
+                                       }
+                                       lttv_attribute_recursive_add(ts_stats, mode_types_tree);
                                }
                        }
-      lttv_attribute_recursive_add(process_tree, cpu_tree);
+                       if(!trace_is_summed) {
+       lttv_attribute_recursive_add(process_tree, cpu_tree);
+                       }
     }
   }
 }
@@ -842,9 +851,8 @@ lttv_stats_sum_traceset(LttvTracesetStats *self)
 
   for(i = 0 ; i < nb_trace ; i++) {
     tcs = (LttvTraceStats *)(self->parent.parent.traces[i]);
-    lttv_stats_sum_trace(tcs);
-    main_tree = tcs->stats;
-    lttv_attribute_recursive_add(sum_container, main_tree);
+    lttv_stats_sum_trace(tcs, self->stats);
+       //                              lttv_attribute_recursive_add(sum_container, tcs->stats);
   }
 }
 
index ab13872e70adba2f2dc57e788baaf1f8b2fe50b3..e9939f2e61094fa28c09ded5f941499eabe555dc 100644 (file)
@@ -179,7 +179,7 @@ void lttv_stats_remove_event_hooks(LttvTracesetStats *self);
 gboolean lttv_stats_sum_traceset_hook(void *hook_data, void *call_data);
 void lttv_stats_sum_traceset(LttvTracesetStats *self);
 
-void lttv_stats_sum_trace(LttvTraceStats *self);
+void lttv_stats_sum_trace(LttvTraceStats *self, LttvAttribute *ts_stats);
 
 /* Reset all statistics containers */
 void lttv_stats_reset(LttvTracesetStats *self);
This page took 0.030107 seconds and 4 git commands to generate.