changes to support profiling
authorbdemsky <bdemsky>
Sun, 10 Jul 2011 09:21:53 +0000 (09:21 +0000)
committerbdemsky <bdemsky>
Sun, 10 Jul 2011 09:21:53 +0000 (09:21 +0000)
Robust/src/Runtime/bamboo/multicoremsg.c
Robust/src/Runtime/bamboo/multicoreruntime.c
Robust/src/Runtime/bamboo/pmc_garbage.c

index 8ce1acf44b7269d35122765c6f0540dc34157d51..64b5aae155daa2f71a07d85adfc3dc593fa0fadd 100644 (file)
@@ -297,8 +297,7 @@ void processmsg_profileoutput_I() {
   stall = true;
   totalexetime = msgdata[msgdataindex];
   MSG_INDEXINC_I();
-#ifdef RT_TEST
-#else
+#if !defined(RT_TEST)
   outputProfileData();
 #endif
   // cache the msg first
index dbad8e8c3eb7cdf239091b59d69866bd8fb6a5c0..fcee5d9bcaaa34a1913b2dd7dbcd033673e14b64 100644 (file)
@@ -10,6 +10,9 @@
 #endif
 #include "multicore_arch.h"
 #include <stdio.h>
+#ifdef PERFCOUNT
+#include "bme_perf_counter.h"
+#endif
 
 extern int classsize[];
 extern int typearray[];
@@ -291,6 +294,9 @@ void CALL11(___System______exit____I,
     BAMBOO_PRINT(0xbbbbbbbb);
     CACHEADAPT_DISABLE_TIMER();
     GC_OUTPUT_PROFILE_DATA();
+#ifdef PERFCOUNT
+    print_statistics();
+#endif
     gc_outputProfileDataReadable();
   }
 #endif 
@@ -638,9 +644,6 @@ void initruntimedata() {
   outmsgleft = 0;
   isMsgHanging = false;
   
-
-
-
   smemflag = true;
   bamboo_cur_msp = NULL;
   bamboo_smem_size = 0;
@@ -757,6 +760,9 @@ void checkCoreStatus() {
           getprofiledata_I();
           CACHEADAPT_DISABLE_TIMER();
           GC_OUTPUT_PROFILE_DATA();
+#ifdef PERFCOUNT
+         print_statistics();
+#endif
          gc_outputProfileDataReadable();
           disruntimedata();
           BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
@@ -789,6 +795,9 @@ void run(int argc, char** argv) {
   initCommunication();
 #ifdef PMC_GC
   pmc_onceInit();
+#endif
+#ifdef PERFCOUNT
+  profile_init(_LOCAL_DRD_CNT,_LOCAL_WR_CNT, _REMOTE_DRD_CNT, _REMOTE_WR_CNT);
 #endif
   if (BAMBOO_NUM_OF_CORE==STARTUPCORE) {
     numconfirm=NUMCORES-1;
@@ -805,6 +814,9 @@ void run(int argc, char** argv) {
     while(!startflag)
       ;
   }
+#ifdef PERFCOUNT
+  bme_performance_counter_start();
+#endif
 
   CACHEADAPT_ENABLE_TIMER();
 
@@ -832,6 +844,9 @@ void run(int argc, char** argv) {
     }
 #endif
     
+#ifdef PERFCOUNT
+      profile_start(APP_REGION);
+#endif
     if(STARTUPCORE == BAMBOO_NUM_OF_CORE) {
 #ifdef TASK
       // run the initStaticAndGlobal method to initialize the static blocks and
index c0cde4adfb6e921a915a6d69644cd3fc72e57851..0a769c3b5d84c9d50b80d3565c85285576764ff4 100644 (file)
@@ -5,6 +5,9 @@
 #include "pmc_mark.h"
 #include "pmc_forward.h"
 #include "pmc_refupdate.h"
+#ifdef PERFCOUNT
+#include "bme_perf_counter.h"
+#endif
 
 struct pmc_heap * pmc_heapptr;
 struct pmc_queue * pmc_localqueue;
@@ -84,6 +87,9 @@ void pmc_init() {
 }
 
 void gc(struct garbagelist *gl) {
+#ifdef PERFCOUNT
+  profile_start(GC_REGION);
+#endif
   if (BAMBOO_NUM_OF_CORE==STARTUPCORE)
     tprintf("start GC\n");
   pmc_init();
@@ -129,6 +135,9 @@ void gc(struct garbagelist *gl) {
   gcflag=false;
   tmc_spin_barrier_wait(&pmc_heapptr->barrier);
 
+#ifdef PERFCOUNT
+  profile_start(APP_REGION);
+#endif
   //tprintf("exit GC\n");
 }