1 #include "multicoreprofile.h"
2 #include "runtime_arch.h"
4 struct profiledata * eventdata;
6 void startEvent(enum eventprofile event) {
7 struct eventprofile *profile=&eventdata->cores[BAMBOO_NUM_OF_CORE].events[event];
8 profile->totaltimestarts+=BAMBOO_GET_EXE_TIME();
12 void stopEvent(enum eventprofile event) {
13 struct eventprofile *profile=&eventdata->cores[BAMBOO_NUM_OF_CORE].events[event];
14 profile->totaltimestops+=BAMBOO_GET_EXE_TIME();
19 for(int core=0;core<NUMCORES;core++) {
20 printf("Core: %u", core);
21 for(int event=0;event<NUMEVENTS;event++) {
22 printf(" Event:%s\n", eventnames[event]);
23 struct eventprofile *profile=&eventdata->cores[core].events[event];
24 if (profile->numstarts!=profile->numstops) {
25 printf(" Mismatched starts and stops\n");
27 long long totaltime=profile->totaltimestops-profile->totaltimestarts;
28 printf(" Total time: %llu Total events: %u Average time:%f\n", totaltime, profile->numstarts, ((double)totaltime)/profile->numstarts);