Author: benm
Date: 2005-04-01 15:40:02 -0500 (Fri, 01 Apr 2005)
New Revision: 42479

Modified:
   trunk/heap-prof/src/viewer/common/ChangeLog
   trunk/heap-prof/src/viewer/common/TypeGraphPlotter.cs
   trunk/heap-prof/src/viewer/common/TypeTabulator.cs
Log:
2005-04-01  Ben Maurer  <[EMAIL PROTECTED]>

        * TypeGraphPlotter.cs: Use a unified threshold level. Partially
        fixes an issue with the graph not being the right size.

        * TypeTabulator.cs: Ditto.



Modified: trunk/heap-prof/src/viewer/common/ChangeLog
===================================================================
--- trunk/heap-prof/src/viewer/common/ChangeLog 2005-04-01 20:30:51 UTC (rev 
42478)
+++ trunk/heap-prof/src/viewer/common/ChangeLog 2005-04-01 20:40:02 UTC (rev 
42479)
@@ -1,3 +1,10 @@
+2005-04-01  Ben Maurer  <[EMAIL PROTECTED]>
+
+       * TypeGraphPlotter.cs: Use a unified threshold level. Partially
+       fixes an issue with the graph not being the right size.
+
+       * TypeTabulator.cs: Ditto.
+
 2005-03-28  Ben Maurer  <[EMAIL PROTECTED]>
 
        * ProfileReader.cs: Read summarized data.

Modified: trunk/heap-prof/src/viewer/common/TypeGraphPlotter.cs
===================================================================
--- trunk/heap-prof/src/viewer/common/TypeGraphPlotter.cs       2005-04-01 
20:30:51 UTC (rev 42478)
+++ trunk/heap-prof/src/viewer/common/TypeGraphPlotter.cs       2005-04-01 
20:40:02 UTC (rev 42479)
@@ -121,6 +121,24 @@
                        
                        g.DrawLines (Pens.Black, line);
                }
+
+#if DEBUG_GRAPH_SIZE
+               {
+                       Point [] line = new Point [data.Count];
+                       
+                       int j = 0;
+                       foreach (TimePoint tp in data) {
+                               
+                               
+                               int psize = tp.Data.TotalSize;
+                               line [j].X = tp.X;
+                               line [j].Y = ysize - checked ((int)((long)psize 
* (long) ysize / (long)Profile.MaxSize));
+                               j ++;
+                       }
+                       
+                       g.DrawLines (Pens.Black, line);
+               }
+#endif
        }
 
 }
@@ -210,10 +228,10 @@
        {
                int num = 0;
                
-               long threshold = p.MaxSize / 100;
+               int cutoff = (int) (p.MaxSize * TypeTabulator.Threshold);
                
                foreach (long l in p.Metadata.TypeMax)
-                       if (l > threshold)
+                       if (l >= cutoff)
                                num ++;
                        
                Sizes = new long [num];
@@ -223,7 +241,7 @@
                        
                num = 0;
                for (int i = 0; i < p.Metadata.TypeMax.Length; i ++) {
-                       if (p.Metadata.TypeMax [i] > threshold) {
+                       if (p.Metadata.TypeMax [i] >= cutoff) {
                                Sizes [num] = p.Metadata.TypeMax [i];
                                TypeIndexes [num] = i;
                                num ++;

Modified: trunk/heap-prof/src/viewer/common/TypeTabulator.cs
===================================================================
--- trunk/heap-prof/src/viewer/common/TypeTabulator.cs  2005-04-01 20:30:51 UTC 
(rev 42478)
+++ trunk/heap-prof/src/viewer/common/TypeTabulator.cs  2005-04-01 20:40:02 UTC 
(rev 42479)
@@ -13,10 +13,9 @@
 class TypeTabulator : ProfileReader {
        
        const int DeltaT = 50;
-       const double Threshold = .005;
+       public const double Threshold = .01;
 
        public ArrayList Data = new ArrayList ();
-       public long [] TotalTypeSizes;
        public bool [] IsSizeLongEnough;
        
        int [] current_type_data;
@@ -113,8 +112,9 @@
        
        public void Dump ()
        {
-               long [] sizes = (long []) TotalTypeSizes.Clone ();
+               long [] sizes = (long []) Profile.Metadata.TypeMax.Clone ();
                int [] indexes = new int [sizes.Length];
+               int cutoff = (int) (Profile.MaxSize * Threshold);
                
                for (int i = 0; i < indexes.Length; i ++)
                        indexes [i] = i;
@@ -134,7 +134,7 @@
                        Console.WriteLine ("Total heap size {0}", d.TotalSize);
                        
                        foreach (int ty in indexes) {
-                               if (!IsSizeLongEnough [ty])
+                               if (Profile.Metadata.TypeMax [ty] < cutoff)
                                        continue;
                                
                                Console.WriteLine ("{0} ({2:p}) -- {1}", 
d.TypeData [ty], GetTypeName (ty), (double) d.TypeData [ty] / (double) 
d.TotalSize);
@@ -150,21 +150,9 @@
                Split (end_t);
                int cutoff = (int) (Profile.MaxSize * Threshold);
                
-               TotalTypeSizes = new long [TypeTableSize];
-               IsSizeLongEnough = new bool [TypeTableSize];
-               
                foreach (TimeData d in Data) {
                        for (int i = 0; i < d.TypeData.Length; i ++) {
-                               TotalTypeSizes [i] += d.TypeData [i];
-                               
-                               if (d.TypeData [i] > cutoff)
-                                       IsSizeLongEnough [i] = true;
-                       }
-               }
-               
-               foreach (TimeData d in Data) {
-                       for (int i = 0; i < d.TypeData.Length; i ++) {
-                               if (! IsSizeLongEnough [i]) {
+                               if (Profile.Metadata.TypeMax [i] < cutoff) {
                                        d.OtherSize += d.TypeData [i];
                                        d.TypeData [i] = 0;
                                }

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

Reply via email to