Author: benm
Date: 2005-03-31 16:20:58 -0500 (Thu, 31 Mar 2005)
New Revision: 42447

Modified:
   trunk/heap-prof/src/runtime-profiler/gc-profiler.c
   trunk/heap-prof/src/viewer/common/ProfileReader.cs
   trunk/heap-prof/src/viewer/common/TypeGraphPlotter.cs
Log:
fixup

Modified: trunk/heap-prof/src/runtime-profiler/gc-profiler.c
===================================================================
--- trunk/heap-prof/src/runtime-profiler/gc-profiler.c  2005-03-31 20:48:38 UTC 
(rev 42446)
+++ trunk/heap-prof/src/runtime-profiler/gc-profiler.c  2005-03-31 21:20:58 UTC 
(rev 42447)
@@ -66,8 +66,8 @@
        int type_live_data_size;
        int* type_live_data;
        
-       int type_total_allocs_size;
-       guint64* type_total_allocs;
+       int type_max_size;
+       guint64* type_max;
        
        int total_live_bytes;
        
@@ -219,7 +219,7 @@
                
                if (idx_plus_one > p->type_live_data_size) {
                        resize_array (p->type_live_data, 
p->type_live_data_size, MAX (p->type_live_data_size << 1, idx_plus_one));
-                       resize_array (p->type_total_allocs, 
p->type_total_allocs_size, MAX (p->type_total_allocs_size << 1, idx_plus_one));
+                       resize_array (p->type_max, p->type_max_size, MAX 
(p->type_max_size << 1, idx_plus_one));
                }
        }
        
@@ -292,7 +292,7 @@
                p->type_live_data [tidx] += size;
                p->context_live_objects [cidx] ++;
                
-               p->type_total_allocs [tidx] ++;
+               p->type_max [tidx] = MAX (p->type_max [tidx], p->type_live_data 
[tidx]);
        } else {
                p->total_live_bytes -= size;
                p->type_live_data [tidx] -= size;
@@ -548,7 +548,7 @@
 }
 
 static void
-write_total_allocs_table (MonoProfiler* p)
+write_type_max_table (MonoProfiler* p)
 {
        guint32 size = p->klass_table->len;
        int i;
@@ -556,9 +556,9 @@
        prof_write (p, &encs, sizeof (encs));
        
        for (i = 0; i < size; i ++)
-               p->type_total_allocs [i] = leu64 (p->type_total_allocs [i]);
+               p->type_max [i] = leu64 (p->type_max [i]);
        
-       prof_write (p, p->type_total_allocs, size * sizeof 
(*p->type_total_allocs));
+       prof_write (p, p->type_max, size * sizeof (*p->type_max));
 }
 
 static void
@@ -571,7 +571,7 @@
        write_data_table (p, p->bt_table, sizeof (IdxBacktrace));
        write_data_table (p, p->ctx_table, sizeof (IdxAllocationCtx));
        write_data_table (p, p->timeline, sizeof (HeapProfTimelineRec));
-       write_total_allocs_table (p);
+       write_type_max_table (p);
 }
 
 

Modified: trunk/heap-prof/src/viewer/common/ProfileReader.cs
===================================================================
--- trunk/heap-prof/src/viewer/common/ProfileReader.cs  2005-03-31 20:48:38 UTC 
(rev 42446)
+++ trunk/heap-prof/src/viewer/common/ProfileReader.cs  2005-03-31 21:20:58 UTC 
(rev 42447)
@@ -172,12 +172,12 @@
        int [][] backtraceTable;
        Context [] contextTable;
        Timeline [] timeline;
-       long [] type_total_allocs;
+       long [] type_max;
        
        public int TypeTableSize { get { return typeTable.Length; } }
        public int ContextTableSize { get { return contextTable.Length; } }
        public Timeline [] Timeline { get { return timeline; } }
-       public long [] TypeTotalAllocs { get { return type_total_allocs; } }
+       public long [] TypeMax { get { return type_max; } }
        
        public string GetTypeName (int idx)
        {
@@ -233,7 +233,7 @@
                        backtraceTable = ReadBacktraceTable (br);
                        contextTable = ReadContextTable (br);
                        timeline = ReadTimeline (br);
-                       type_total_allocs = ReadTypeTotalAllocationsTable (br);
+                       type_max = ReadTypeMaxTable (br);
                }
        }
        
@@ -247,7 +247,7 @@
                }
        }
        
-       long [] ReadTypeTotalAllocationsTable (BinaryReader br)
+       long [] ReadTypeMaxTable (BinaryReader br)
        {
                int sz = br.ReadInt32 ();
                

Modified: trunk/heap-prof/src/viewer/common/TypeGraphPlotter.cs
===================================================================
--- trunk/heap-prof/src/viewer/common/TypeGraphPlotter.cs       2005-03-31 
20:48:38 UTC (rev 42446)
+++ trunk/heap-prof/src/viewer/common/TypeGraphPlotter.cs       2005-03-31 
21:20:58 UTC (rev 42447)
@@ -210,14 +210,9 @@
        {
                int num = 0;
                
-               long total_size = 0;
+               long threshold = p.MaxSize / 100;
                
-               foreach (long l in p.Metadata.TypeTotalAllocs)
-                       total_size += l;
-               
-               long threshold = total_size / 1000;
-               
-               foreach (long l in p.Metadata.TypeTotalAllocs)
+               foreach (long l in p.Metadata.TypeMax)
                        if (l > threshold)
                                num ++;
                        
@@ -227,9 +222,9 @@
                TypeBrushes = new Brush [num];
                        
                num = 0;
-               for (int i = 0; i < p.Metadata.TypeTotalAllocs.Length; i ++) {
-                       if (p.Metadata.TypeTotalAllocs [i] > threshold) {
-                               Sizes [num] = p.Metadata.TypeTotalAllocs [i];
+               for (int i = 0; i < p.Metadata.TypeMax.Length; i ++) {
+                       if (p.Metadata.TypeMax [i] > threshold) {
+                               Sizes [num] = p.Metadata.TypeMax [i];
                                TypeIndexes [num] = i;
                                num ++;
                        }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to