-#ifdef MULTICORE_GC
-#ifdef GC_PROFILE
+#if defined(MULTICORE_GC)&&defined(GC_PROFILE)
#include "multicoregcprofile.h"
#include "structdefs.h"
#include "runtime_arch.h"
BAMBOO_PRINT(0xeeee);
#endif
}
-#endif // GC_PROFILE
+
+// output the profiling data
+void gc_outputProfileDataReadable() {
+ // output task related info
+ for(int i= 0; i < gc_infoIndex; i++) {
+ GCInfo * gcInfo = gc_infoArray[i];
+
+ unsigned long long starttime=gcInfo->time[0]; //0;
+
+ for(int j = 1; j < gcInfo->index - 7; j++) {
+ printf("Event %u time since start=%llu, time since last event=%llu\n",j, gcInfo->time[j]-starttime, gcInfo->time[j]-gcInfo->time[j-1]);
+ }
+ printf("Livespace %llu\n", gcInfo->time[gcInfo->index-7]);
+ printf("Freespace %llu\n", gcInfo->time[gcInfo->index-6]);
+ printf("# Lobj %llu\n", gcInfo->time[gcInfo->index-5]);
+ printf("Lobj space %llu\n", gcInfo->time[gcInfo->index-4]);
+ printf("# obj %llu\n", gcInfo->time[gcInfo->index-3]);
+ printf("# live obj %llu\n", gcInfo->time[gcInfo->index-2]);
+ printf("# forward obj %llu\n", gcInfo->time[gcInfo->index-1]);
+ }
+}
#endif // MULTICORE_GC
void initmulticoregcprofiledata(void);
void gc_outputProfileData();
+void gc_outputProfileDataReadable();
INLINE static void gc_profileInit() {
gc_num_livespace = 0;
+++ /dev/null
-#include "multicoreprofile.h"
-#include "runtime_arch.h"
-
-struct profiledata * eventdata;
-
-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 eventtypes event) {
- struct eventprofile *profile=&eventdata->cores[BAMBOO_NUM_OF_CORE].events[event];
- profile->totaltimestops+=BAMBOO_GET_EXE_TIME();
- profile->numstops++;
-}
-
-void printResults() {
- for(int core=0;core<NUMCORES;core++) {
- printf("Core: %u", core);
- 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) {
- printf(" Mismatched starts and stops\n");
- }
- long long totaltime=profile->totaltimestops-profile->totaltimestarts;
- printf(" Total time: %llu Total events: %u Average time:%f\n", totaltime, profile->numstarts, ((double)totaltime)/profile->numstarts);
- }
- }
-}
+++ /dev/null
-#ifndef MULTICOREPROFILE_H
-#define MULTICOREPROFILE_H
-#include "structdefs.h"
-
-enum eventtypes {
- EV_GCTIME,
- EV_NUMEVENTS
-};
-
-char eventnames[][30]={"gctime", "endmarker"};
-
-struct eventprofile {
- long long totaltimestarts;
- long long totaltimestops;
- int numstarts;
- int numstops;
-};
-
-struct coreprofile {
- struct eventprofile events[EV_NUMEVENTS];
-};
-
-struct profiledata {
- struct coreprofile cores[NUMCORES];
-};
-
-extern struct profiledata * eventdata;
-
-void startEvent(enum eventtypes event);
-void stopEvent(enum eventtypes event);
-void printResults();
-
-#endif
BAMBOO_PRINT(0xbbbbbbbb);
CACHEADAPT_DISABLE_TIMER();
GC_OUTPUT_PROFILE_DATA();
+ gc_outputProfileDataReadable();
}
#endif
BAMBOO_EXIT_APP(___status___);
getprofiledata_I();
CACHEADAPT_DISABLE_TIMER();
GC_OUTPUT_PROFILE_DATA();
+ gc_outputProfileDataReadable();
disruntimedata();
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
terminate(); // All done.