From 0f32f51da578005952e2d235fed2b5a1c4c7a95e Mon Sep 17 00:00:00 2001 From: bdemsky Date: Mon, 11 Jul 2011 10:32:28 +0000 Subject: [PATCH] performance counter tweaks... --- Robust/src/Runtime/bamboo/multicoremsg.c | 22 ++++++++++++++++++++ Robust/src/Runtime/bamboo/multicoremsg.h | 4 ++++ Robust/src/Runtime/bamboo/multicoreruntime.c | 7 ++++++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/Robust/src/Runtime/bamboo/multicoremsg.c b/Robust/src/Runtime/bamboo/multicoremsg.c index 64b5aae1..e30e96c4 100644 --- a/Robust/src/Runtime/bamboo/multicoremsg.c +++ b/Robust/src/Runtime/bamboo/multicoremsg.c @@ -9,6 +9,9 @@ #include "gcqueue.h" #include "markbit.h" #endif +#ifdef PERFCOUNT +#include "bme_perf_counter.h" +#endif int msgsizearray[] = { 0, //MSGSTART, @@ -31,6 +34,10 @@ int msgsizearray[] = { 1, //TERMINATE, // 0xDf 3, //MEMREQUEST, // 0xE0 3, //MEMRESPONSE, // 0xE1 +#ifdef PERFCOUNT + 1, + 1, +#endif #if defined(MULTICORE_GC)||defined(PMC_GC) 1, //GCINVOKE 1, //GCSTARTPRE, // 0xE2 @@ -921,6 +928,21 @@ processmsg: break; } #endif +#ifdef PERFCOUNT + case MSGPERFCOUNT: { + profile_stop(); + if(BAMBOO_CHECK_SEND_MODE()) { + cache_msg_1_I(STARTUPCORE, MSGPERFRESPONSE); + } else { + send_msg_1_I(STARTUPCORE, MSGPERFRESPONSE); + } + break; + } + case MSGPERFRESPONSE: { + coreperfcount--; + break; + } +#endif #if defined(MULTICORE_GC)||defined(PMC_GC) // GC msgs case GCINVOKE: { diff --git a/Robust/src/Runtime/bamboo/multicoremsg.h b/Robust/src/Runtime/bamboo/multicoremsg.h index c64f8b2e..70e0e6a3 100644 --- a/Robust/src/Runtime/bamboo/multicoremsg.h +++ b/Robust/src/Runtime/bamboo/multicoremsg.h @@ -172,6 +172,10 @@ typedef enum { TERMINATE, // 0xDf MEMREQUEST, // 0xE0 MEMRESPONSE, // 0xE1 +#ifdef PERFCOUNT + MSGPERFCOUNT, + MSGPERFRESPONSE, +#endif #if defined(MULTICORE_GC)||defined(PMC_GC) GCINVOKE, // 0xE2 GCSTARTPRE, // 0xE3 diff --git a/Robust/src/Runtime/bamboo/multicoreruntime.c b/Robust/src/Runtime/bamboo/multicoreruntime.c index c4f8918f..1751a7a3 100644 --- a/Robust/src/Runtime/bamboo/multicoreruntime.c +++ b/Robust/src/Runtime/bamboo/multicoreruntime.c @@ -797,7 +797,12 @@ void run(int argc, char** argv) { pmc_onceInit(); #endif #ifdef PERFCOUNT - profile_init(_LOCAL_DRD_CNT,_LOCAL_WR_CNT, _REMOTE_DRD_CNT, _REMOTE_WR_CNT); + if (BAMBOO_NUM_OF_CORE==STARTUPCORE) + profile_init(_LOCAL_DRD_CNT,_LOCAL_WR_CNT, _REMOTE_DRD_CNT, _REMOTE_WR_CNT); + else { + int offcore=4*(BAMBOO_NUM_OF_CORE-1); + profile_init(validevents[(offcore)%87], validevents[(offcore+1)%87], validevents[(offcore+2)%87], validevents[(offcore+3)%87]); + } #endif if (BAMBOO_NUM_OF_CORE==STARTUPCORE) { numconfirm=NUMCORES-1; -- 2.34.1