# HG changeset patch # User Nina Engelhardt # Date 1326463400 -3600 # Node ID 5c59bfe62d92372158bf59d41996cbcb3a2ffe0d # Parent 70d24e2343bbe80d875a725ba3dc16b6f0664e7b handler interface for counters... not working diff -r 70d24e2343bb -r 5c59bfe62d92 SSR.h --- a/SSR.h Wed Jan 04 16:39:35 2012 +0100 +++ b/SSR.h Fri Jan 13 15:03:20 2012 +0100 @@ -115,7 +115,10 @@ Unit last_in_slot[NUM_CORES * NUM_SCHED_SLOTS]; ListOfArrays* hwArcs; #endif - + + #ifdef MEAS__PERF_COUNTERS + ListOfArrays* counterList; + #endif } SSRSemEnv; diff -r 70d24e2343bb -r 5c59bfe62d92 SSR_Counter_Recording.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SSR_Counter_Recording.c Fri Jan 13 15:03:20 2012 +0100 @@ -0,0 +1,24 @@ +#include "SSR_Counter_Recording.h" +#include "VMS/VMS.h" +#include "SSR.h" + +void SSR__init_counter_data_structs(){ + SSRSemEnv *semanticEnv = _VMSMasterEnv->semanticEnv; + semanticEnv->counterList = makeListOfArrays(sizeof(CounterEvent), 128); +} + +void SSR__counter_handler(int evt_type, int coreID, int slotID, VirtProcr* pr, uint64 cycles, uint64 instrs) +{ +/* + SSRSemEnv *semanticEnv = _VMSMasterEnv->semanticEnv; + + CounterEvent e; + e.event_type = evt_type; + e.coreID = coreID; + e.slotID = slotID; + e.cycles = cycles; + e.instrs = instrs; + + addToListOfArrays(CounterEvent,e,semanticEnv->counterList); +*/ +} \ No newline at end of file diff -r 70d24e2343bb -r 5c59bfe62d92 SSR_Counter_Recording.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SSR_Counter_Recording.h Fri Jan 13 15:03:20 2012 +0100 @@ -0,0 +1,26 @@ +/* + * File: SSR_Counter_Recording.h + * Author: nengel + * + * Created on January 11, 2012, 3:03 PM + */ + +#ifndef SSR_COUNTER_RECORDING_H +#define SSR_COUNTER_RECORDING_H + +#include "VMS/VMS.h" + +typedef struct { + int event_type; + int coreID; + int slotID; + uint64 cycles; + uint64 instrs; +} CounterEvent; + +void SSR__init_counter_data_structs(); + +void SSR__counter_handler(int evt_type, int coreID, int slotID, VirtProcr* pr, uint64 cycles, uint64 instrs); + +#endif /* SSR_COUNTER_RECORDING_H */ + diff -r 70d24e2343bb -r 5c59bfe62d92 SSR_PluginFns.c --- a/SSR_PluginFns.c Wed Jan 04 16:39:35 2012 +0100 +++ b/SSR_PluginFns.c Fri Jan 13 15:03:20 2012 +0100 @@ -249,9 +249,11 @@ resume_procr( VirtProcr *procr, SSRSemEnv *semEnv ) { #ifdef MEAS__PERF_COUNTERS +/* int lastRecordIdx = procr->counter_history_array_info->numInArray -1; CounterRecord* lastRecord = procr->counter_history[lastRecordIdx]; saveLowTimeStampCountInto(lastRecord->unblocked_timestamp); +*/ #endif #ifdef OBSERVE_UCC Unit newu; diff -r 70d24e2343bb -r 5c59bfe62d92 SSR_lib.c --- a/SSR_lib.c Wed Jan 04 16:39:35 2012 +0100 +++ b/SSR_lib.c Fri Jan 13 15:03:20 2012 +0100 @@ -13,7 +13,7 @@ #include "VMS/Queue_impl/PrivateQueue.h" #include "VMS/Hash_impl/PrivateHash.h" #include "SSR.h" - +#include "SSR_Counter_Recording.h" //========================================================================== @@ -203,12 +203,18 @@ //Hook up the semantic layer's plug-ins to the Master virt procr _VMSMasterEnv->requestHandler = &SSR__Request_Handler; _VMSMasterEnv->slaveScheduler = &SSR__schedule_virt_procr; + #ifdef MEAS__PERF_COUNTERS + _VMSMasterEnv->counterHandler = &SSR__counter_handler; + #endif //create the semantic layer's environment (all its data) and add to // the master environment semanticEnv = VMS__malloc( sizeof( SSRSemEnv ) ); _VMSMasterEnv->semanticEnv = semanticEnv; + #ifdef MEAS__PERF_COUNTERS + SSR__init_counter_data_structs(); + #endif #ifdef OBSERVE_UCC semanticEnv->unitList = makeListOfArrays(sizeof(Unit),128); semanticEnv->ctlDependenciesList = makeListOfArrays(sizeof(Dependency),128);