make it compile
authorbdemsky <bdemsky>
Mon, 4 Jul 2011 08:48:05 +0000 (08:48 +0000)
committerbdemsky <bdemsky>
Mon, 4 Jul 2011 08:48:05 +0000 (08:48 +0000)
Robust/src/Runtime/bamboo/multicoreprofile.c
Robust/src/Runtime/bamboo/multicoreprofile.h

index f8306c2c0f619f47e4705d4a09cb51ccd60b5743..acde454a5e7855762ffa9ac1c946fe6b7c1e54ac 100644 (file)
@@ -3,13 +3,13 @@
 
 struct profiledata * eventdata;
 
-void startEvent(enum eventprofile event) {
+void startEvent(enum eventtypes event) {
   struct eventprofile *profile=&eventdata->cores[BAMBOO_NUM_OF_CORE].events[event];
   profile->totaltimestarts+=BAMBOO_GET_EXE_TIME();
   profile->numstarts++;
 }
 
-void stopEvent(enum eventprofile event) {
+void stopEvent(enum eventtypes event) {
   struct eventprofile *profile=&eventdata->cores[BAMBOO_NUM_OF_CORE].events[event];
   profile->totaltimestops+=BAMBOO_GET_EXE_TIME();
   profile->numstops++;
@@ -18,7 +18,7 @@ void stopEvent(enum eventprofile event) {
 void printResults() {
   for(int core=0;core<NUMCORES;core++) {
     printf("Core: %u", core);
-    for(int event=0;event<NUMEVENTS;event++) {
+    for(int event=0;event<EV_NUMEVENTS;event++) {
       printf("  Event:%s\n", eventnames[event]);
       struct eventprofile *profile=&eventdata->cores[core].events[event];
       if (profile->numstarts!=profile->numstops) {
index 4c0e0bac98849978dc259e3302b7e5cab49184c1..91522e0c286cb9a70911fb42eaf582ab362137fc 100644 (file)
@@ -1,12 +1,13 @@
 #ifndef MULTICOREPROFILE_H
 #define MULTICOREPROFILE_H
+#include "structdefs.h"
 
-enum profileevents {
-  GCTIME,
-  NUMEVENTS;
+enum eventtypes {
+  EV_GCTIME,
+  EV_NUMEVENTS
 };
 
-char ** eventnames={"gctime", "endmarker"};
+char eventnames[][30]={"gctime", "endmarker"};
 
 struct eventprofile {
   long long totaltimestarts;
@@ -16,7 +17,7 @@ struct eventprofile {
 };
 
 struct coreprofile {
-  struct eventprofile events[NUMEVENTS];
+  struct eventprofile events[EV_NUMEVENTS];
 };
 
 struct profiledata {
@@ -25,8 +26,8 @@ struct profiledata {
 
 extern struct profiledata * eventdata;
 
-void startEvent(enum eventprofile event);
-void stopEvent(enum eventprofile event);
+void startEvent(enum eventtypes event);
+void stopEvent(enum eventtypes event);
 void printResults();
 
 #endif