minor fix for trace projection summary
authorYanhuaSun <sun51@illinois.edu>
Fri, 12 Apr 2013 22:34:16 +0000 (17:34 -0500)
committerYanhuaSun <sun51@illinois.edu>
Fri, 12 Apr 2013 22:34:16 +0000 (17:34 -0500)
src/ck-perf/trace-projections.C
src/ck-perf/trace-projections.h

index 918e24c3feaa8521570ce0f2cb1d839d453eb02d..42f17a86132d45ce441ee7f06d2ec6df45ae4839 100644 (file)
@@ -288,7 +288,10 @@ LogPool::LogPool(char *pgm) {
   strcpy(pgmname, pgm);
 
   //statistic init
-  statisLastTimer = 0;
+  statisLastProcessTimer = 0;
+  statisLastIdleTimer = 0;
+  statisLastPackTimer = 0;
+  statisLastUnpackTimer = 0;
   statisTotalExecutionTime  = 0;
   statisTotalIdleTime = 0;
   statisTotalPackTime = 0;
@@ -670,8 +673,8 @@ void LogPool::writeStatis(void)
   double totaltime = endComputationTime - beginComputationTime;
   fprintf(statisfp, "time(sec) percentage\n");
   fprintf(statisfp, "Time:    \t%f\n", totaltime);
-  fprintf(statisfp, "Overhead:\t%f\t %.1f\n", statisTotalIdleTime, statisTotalIdleTime/totaltime * 100); 
-  fprintf(statisfp, "Idle:    \t%f\t %.1f\n", totaltime - statisTotalIdleTime - statisTotalExecutionTime , (totaltime - statisTotalIdleTime - statisTotalExecutionTime)/totaltime * 100); 
+  fprintf(statisfp, "Idle :\t%f\t %.1f\n", statisTotalIdleTime, statisTotalIdleTime/totaltime * 100); 
+  fprintf(statisfp, "Overhead:    \t%f\t %.1f\n", totaltime - statisTotalIdleTime - statisTotalExecutionTime , (totaltime - statisTotalIdleTime - statisTotalExecutionTime)/totaltime * 100); 
   fprintf(statisfp, "Exeuction:\t%f\t %.1f\n", statisTotalExecutionTime, statisTotalExecutionTime/totaltime*100); 
   fprintf(statisfp, "Pack:     \t%f\t %.2f\n", statisTotalPackTime, statisTotalPackTime/totaltime*100); 
   fprintf(statisfp, "Unpack:   \t%f\t %.2f\n", statisTotalUnpackTime, statisTotalUnpackTime/totaltime*100); 
@@ -749,22 +752,28 @@ void LogPool::add(UChar type, UShort mIdx, UShort eIdx,
             statisTotalMemFree++;
             break;
         case BEGIN_PROCESSING:
+            statisLastProcessTimer = time;
+            break;
         case BEGIN_UNPACK:
+            statisLastUnpackTimer = time;
+            break;
         case BEGIN_PACK:
+            statisLastPackTimer = time;
+            break;
         case BEGIN_IDLE:
-            statisLastTimer = time;
+            statisLastIdleTimer = time;
             break;
         case END_PROCESSING:
-            statisTotalExecutionTime += (time - statisLastTimer);
+            statisTotalExecutionTime += (time - statisLastProcessTimer);
             break;
         case END_UNPACK:
-            statisTotalUnpackTime += (time - statisLastTimer);
+            statisTotalUnpackTime += (time - statisLastUnpackTimer);
             break;
         case END_PACK:
-            statisTotalPackTime += (time - statisLastTimer);
+            statisTotalPackTime += (time - statisLastPackTimer);
             break;
         case END_IDLE:
-            statisTotalIdleTime += (time - statisLastTimer);
+            statisTotalIdleTime += (time - statisLastIdleTimer);
             break;
         default:
             break;
index 718acdf594e56bc786ef33496757c05aca2d0573..ca022e9b9040adbc0513a557e2d0944c47b1d0d0 100644 (file)
@@ -299,6 +299,10 @@ class LogPool {
     double beginComputationTime;
     double endComputationTime;
     double statisLastTimer;
+    double statisLastProcessTimer;
+    double statisLastIdleTimer;
+    double statisLastPackTimer;
+    double statisLastUnpackTimer;
     double statisTotalExecutionTime;
     double statisTotalIdleTime;
     double statisTotalPackTime;