#ifndef BAMBOO_MULTICORE_GC_PROFILE_H
#define BAMBOO_MULTICORE_GC_PROFILE_H
-#ifdef MULTICORE_GC
+#if defined(MULTICORE_GC)||defined(PMC_GC)
#include "multicore.h"
#include "runtime_arch.h"
#include "structdefs.h"
void initmulticoregcprofiledata(void);
void gc_outputProfileData();
+void gc_outputProfileDataReadable();
INLINE static void gc_profileInit() {
gc_num_livespace = 0;
#define GCPROFILE_RECORD_SPACE() \
{ \
if(gc_profile_flag) { \
- gc_num_livespace = 0; \
- for(int tmpi = 0; tmpi < GCNUMBLOCK; tmpi++) { \
- gc_num_livespace += bamboo_smemtbl[tmpi]; \
+ gc_num_freespace = 0; \
+ block_t lowestblock=allocationinfo.lowestfreeblock; \
+ for(block_t searchblock=lowestblock;searchblock<GCNUMBLOCK;searchblock++) { \
+ struct blockrecord * block=&allocationinfo.blocktable[searchblock]; \
+ if (block->status==BS_FREE) { \
+ gc_num_freespace+=block->freespace&~BAMBOO_CACHE_LINE_MASK; \
+ } \
} \
- gc_num_freespace = (BAMBOO_SHARED_MEM_SIZE) - gc_num_livespace; \
+ gc_num_livespace = (BAMBOO_SHARED_MEM_SIZE) - gc_num_freespace; \
} \
}
// record forward obj info