From: bdemsky Date: Sun, 10 Jul 2011 09:21:53 +0000 (+0000) Subject: changes to support profiling X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f567ebb1426c14a97b1683864f32da46aa21c18f;hp=0e36448813213d72e7558088f5efd584ca5da036;p=IRC.git changes to support profiling --- diff --git a/Robust/src/Runtime/bamboo/multicoremsg.c b/Robust/src/Runtime/bamboo/multicoremsg.c index 8ce1acf4..64b5aae1 100644 --- a/Robust/src/Runtime/bamboo/multicoremsg.c +++ b/Robust/src/Runtime/bamboo/multicoremsg.c @@ -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 diff --git a/Robust/src/Runtime/bamboo/multicoreruntime.c b/Robust/src/Runtime/bamboo/multicoreruntime.c index dbad8e8c..fcee5d9b 100644 --- a/Robust/src/Runtime/bamboo/multicoreruntime.c +++ b/Robust/src/Runtime/bamboo/multicoreruntime.c @@ -10,6 +10,9 @@ #endif #include "multicore_arch.h" #include +#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 diff --git a/Robust/src/Runtime/bamboo/pmc_garbage.c b/Robust/src/Runtime/bamboo/pmc_garbage.c index c0cde4ad..0a769c3b 100644 --- a/Robust/src/Runtime/bamboo/pmc_garbage.c +++ b/Robust/src/Runtime/bamboo/pmc_garbage.c @@ -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"); }