# HG changeset patch # User Nina Engelhardt # Date 1331832509 -3600 # Node ID 125f0f90a0d3b2cb640a605786740512932c50be # Parent 5c475c4b7b4997c8b817b9dbbd680c8b57306062 integrating holistic model in common ancestor - not finished yet diff -r 5c475c4b7b49 -r 125f0f90a0d3 Defines/VMS_defs__turn_on_and_off.h --- a/Defines/VMS_defs__turn_on_and_off.h Thu Mar 15 06:36:37 2012 -0700 +++ b/Defines/VMS_defs__turn_on_and_off.h Thu Mar 15 18:28:29 2012 +0100 @@ -60,6 +60,9 @@ /*turn on/off subtraction of create measurements from plugin meas*/ //#define MEAS__TURN_ON_EXCLUDE_CREATION_TIME +#define HOLISTIC__TURN_ON_PERF_COUNTERS +#define HOLISTIC__TURN_ON_OBSERVE_UCC +#define DETECT_LOOP_GRAPH //=================== Turn on or off system options ======================= // diff -r 5c475c4b7b49 -r 125f0f90a0d3 Services_Offered_by_VMS/Measurement_and_Stats/MEAS__macros.h --- a/Services_Offered_by_VMS/Measurement_and_Stats/MEAS__macros.h Thu Mar 15 06:36:37 2012 -0700 +++ b/Services_Offered_by_VMS/Measurement_and_Stats/MEAS__macros.h Thu Mar 15 18:28:29 2012 +0100 @@ -292,12 +292,43 @@ #define MEAS__Print_Hists_for_System_Meas #endif + #ifdef HOLISTIC__TURN_ON_PERF_COUNTERS + +#define MEAS__Insert_Counter_Handler \ + typedef void (*CounterHandler) (int,int,int,SlaveVP*,uint64,uint64); + + enum eventType { + DebugEvt = 0, + AppResponderInvocation_start, + AppResponder_start, + AppResponder_end, + AssignerInvocation_start, + NextAssigner_start, + Assigner_start, + Assigner_end, + Work_start, + Work_end, + HwResponderInvocation_start, + Timestamp_start, + Timestamp_end + }; + + + #define MEAS__Insert_Counter_Meas_Fields_into_MasterEnv \ + int cycles_counter_fd[NUM_CORES]; \ + int instrs_counter_fd[NUM_CORES]; \ + uint64 start_master_lock[NUM_CORES][2]; \ + CounterHandler counterHandler; +#else + #define MEAS__Insert_Counter_Handler + #define MEAS__Insert_Counter_Meas_Fields_into_MasterEnv +#endif //Experiment in two-step macros -- if doesn't work, insert each separately #define MEAS__Insert_Meas_Fields_into_Slave \ MEAS__Insert_Susp_Meas_Fields_into_Slave \ MEAS__Insert_Master_Meas_Fields_into_Slave \ - MEAS__Insert_System_Meas_Fields_into_Slave + MEAS__Insert_System_Meas_Fields_into_Slave //====================== Histogram Macros -- Create ======================== diff -r 5c475c4b7b49 -r 125f0f90a0d3 VMS.h --- a/VMS.h Thu Mar 15 06:36:37 2012 -0700 +++ b/VMS.h Thu Mar 15 18:28:29 2012 +0100 @@ -49,6 +49,9 @@ typedef void (*TopLevelFnPtr) ( void *, SlaveVP * ); //initData, animSlv typedef void TopLevelFn ( void *, SlaveVP * ); //initData, animSlv typedef void (*ResumeSlvFnPtr) ( SlaveVP *, void * ); + //=========== MEASUREMENT STUFF ========== + MEAS__Insert_Counter_Handler + //======================================== //============================ HW Dependent Fns ================================ @@ -105,6 +108,12 @@ }; //SchedSlot + enum VPtype { + Slave = 1, //default + Master, + Shutdown + }; + /*WARNING: re-arranging this data structure could cause Slv switching * assembly code to fail -- hard-codes offsets of fields */ @@ -130,7 +139,10 @@ MEAS__Insert_Meas_Fields_into_Slave; //======================================== - float64 createPtInSecs; //have space but don't use on some configs + enum VPtype type; + int numTimesAssigned; + + float64 createPtInSecs; //have space but don't use on some configs }; //SlaveVP @@ -177,6 +189,7 @@ MEAS__Insert_Malloc_Meas_Fields_into_MasterEnv; MEAS__Insert_Plugin_Meas_Fields_into_MasterEnv; MEAS__Insert_System_Meas_Fields_into_MasterEnv; + MEAS__Insert_Counter_Meas_Fields_into_MasterEnv; //========================================== } MasterEnv; @@ -238,6 +251,9 @@ void VMS_SS__start_the_work_then_wait_until_done(); +SlaveVP* +VMS_SS__create_shutdown_slave(); + void VMS_SS__shutdown(); diff -r 5c475c4b7b49 -r 125f0f90a0d3 VMS__int.c --- a/VMS__int.c Thu Mar 15 06:36:37 2012 -0700 +++ b/VMS__int.c Thu Mar 15 18:28:29 2012 +0100 @@ -166,6 +166,8 @@ newSlv->slaveID = _VMSMasterEnv->numSlavesCreated++; newSlv->requests = NULL; newSlv->schedSlot = NULL; + newSlv->type = Slave; + newSlv->numTimesAssigned = 0; VMS_int__point_slaveVP_to_Fn( newSlv, fnPtr, dataParam ); diff -r 5c475c4b7b49 -r 125f0f90a0d3 VMS__startup_and_shutdown.c --- a/VMS__startup_and_shutdown.c Thu Mar 15 06:36:37 2012 -0700 +++ b/VMS__startup_and_shutdown.c Thu Mar 15 18:28:29 2012 +0100 @@ -295,6 +295,7 @@ //Q: should give masterVP core-specific info as its init data? masterVPs[ coreIdx ] = VMS_int__create_slaveVP( (TopLevelFnPtr)&schedulingMaster, (void*)masterEnv ); masterVPs[ coreIdx ]->coreAnimatedBy = coreIdx; + masterVPs[ coreIdx ]->type = Master; allSchedSlots[ coreIdx ] = create_sched_slots(); //makes for one core _VMSMasterEnv->workStealingGates[ coreIdx ] = NULL; } @@ -440,6 +441,15 @@ } +SlaveVP* VMS_SS__create_shutdown_slave(){ + SlaveVP* shutdownVP; + + shutdownVP = VMS_int__create_slaveVP( &endOSThreadFn, NULL ); + shutdownVP->type = Shutdown; + + return shutdownVP; +} + //TODO: look at architecting cleanest separation between request handler // and master loop, for dissipate, create, shutdown, and other non-semantic // requests. Issue is chain: one removes requests from AppSlv, one dispatches @@ -481,7 +491,7 @@ // directly into the Q -- each core will die when gets one for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ ) { //Note, this is running in the master - shutDownSlv = VMS_int__create_slaveVP( &endOSThreadFn, NULL ); + shutDownSlv = VMS_SS__create_shutdown_slave(); //last slave has dissipated, so no more in slots, so write // shut down slave into first schedulng slot. schedSlots = _VMSMasterEnv->allSchedSlots[ coreIdx ];