Add getGCStatsEnabled function.
authorPaolo Capriotti <p.capriotti@gmail.com>
Fri, 15 Jun 2012 16:12:24 +0000 (17:12 +0100)
committerPaolo Capriotti <p.capriotti@gmail.com>
Tue, 19 Jun 2012 13:36:08 +0000 (14:36 +0100)
includes/rts/storage/GC.h
rts/Linker.c
rts/Stats.c

index ab3af17..5de8b2b 100644 (file)
@@ -202,6 +202,7 @@ typedef struct _GCStats {
   StgDouble wall_seconds;
 } GCStats;
 void getGCStats (GCStats *s);
+rtsBool getGCStatsEnabled (void);
 
 // These don't change over execution, so do them elsewhere
 //  StgDouble init_cpu_seconds;
index 7d10300..703bc5f 100644 (file)
@@ -1072,6 +1072,7 @@ typedef struct _RtsSymbolVal {
       SymI_HasProto(getOrSetSystemEventThreadEventManagerStore)         \
       SymI_HasProto(getOrSetSystemEventThreadIOManagerThreadStore)      \
       SymI_HasProto(getGCStats)                         \
+      SymI_HasProto(getGCStatsEnabled)                  \
       SymI_HasProto(genSymZh)                           \
       SymI_HasProto(genericRaise)                       \
       SymI_HasProto(getProgArgv)                        \
index 5605810..b12cb76 100644 (file)
@@ -922,6 +922,11 @@ extern HsInt64 getAllocations( void )
 
 /* EZY: I'm not convinced I got all the casting right. */
 
+extern rtsBool getGCStatsEnabled( void )
+{
+    return RtsFlags.GcFlags.giveStats != NO_GC_STATS;
+}
+
 extern void getGCStats( GCStats *s )
 {
     nat total_collections = 0;