compute average processor ticks per event in parsed output
[IRC.git] / Robust / CoreProf / Trace.java
index 40ca7f607330862924ce23a9e9453ba2f690bf24..0d69195e7ed5919c96238fe04af5d5c154475442 100644 (file)
@@ -15,6 +15,7 @@ public class Trace {
   public static final int CP_EVENTID_MAIN             = 0x04;
   public static final int CP_EVENTID_RUNMALLOC        = 0x10;
   public static final int CP_EVENTID_RUNFREE          = 0x11;
+  public static final int CP_EVENTID_POOLALLOC        = 0x14;
   public static final int CP_EVENTID_COUNT_POOLALLOC  = 0x15;
   public static final int CP_EVENTID_COUNT_POOLREUSE  = 0x16;
   public static final int CP_EVENTID_WORKSCHEDGRAB    = 0x20;
@@ -41,8 +42,9 @@ public class Trace {
     eid2name.put( CP_EVENTID_MAIN,              "MAIN         " );
     eid2name.put( CP_EVENTID_RUNMALLOC,         "RUNMALLOC    " );
     eid2name.put( CP_EVENTID_RUNFREE,           "RUNFREE      " );
-    eid2name.put( CP_EVENTID_RUNFREE,           "POOLALLOC    " );
-    eid2name.put( CP_EVENTID_RUNFREE,           "POOLREUSE    " );
+    eid2name.put( CP_EVENTID_POOLALLOC,         "POOLALLOC    " );
+    eid2name.put( CP_EVENTID_COUNT_POOLALLOC,   "POOLALLOC CNT" );
+    eid2name.put( CP_EVENTID_COUNT_POOLREUSE,   "POOLREUSE CNT" );
     eid2name.put( CP_EVENTID_WORKSCHEDGRAB,     "WORKSCHEDGRAB" );
     eid2name.put( CP_EVENTID_TASKDISPATCH,      "TASKDISPATCH " );
     eid2name.put( CP_EVENTID_PREPAREMEMQ,       "PREPAREMEMQ  " );
@@ -511,10 +513,11 @@ public class Trace {
       new Long( es.totalTime_ticks ).floatValue();      
 
     String strSelfStats =
-      String.format( " total(ticks)=%12dK, %%self=%5.1f, count=%d",
+      String.format( " total(ticks)=%12dK, %%self=%5.1f, count=%d, avgTicks=%d",
                      es.totalTime_ticks/1000,
                      tSelf_perc,
-                     es.instanceCount );
+                     es.instanceCount,
+                     (int)((float)es.totalTime_ticks/(float)es.instanceCount) );
 
     bw.write( strIndent+
               strEventName+