[commit: ghc] master: Add getGCStatsEnabled function. (5490e71)
Paolo Capriotti
p.capriotti at gmail.com
Tue Jun 19 16:54:46 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/5490e71be49131108d849ffe02867acf189a9e19
>---------------------------------------------------------------
commit 5490e71be49131108d849ffe02867acf189a9e19
Author: Paolo Capriotti <p.capriotti at gmail.com>
Date: Fri Jun 15 17:12:24 2012 +0100
Add getGCStatsEnabled function.
>---------------------------------------------------------------
includes/rts/storage/GC.h | 1 +
rts/Linker.c | 1 +
rts/Stats.c | 5 +++++
3 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/includes/rts/storage/GC.h b/includes/rts/storage/GC.h
index ab3af17..5de8b2b 100644
--- a/includes/rts/storage/GC.h
+++ b/includes/rts/storage/GC.h
@@ -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;
diff --git a/rts/Linker.c b/rts/Linker.c
index 7d10300..703bc5f 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -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) \
diff --git a/rts/Stats.c b/rts/Stats.c
index 5605810..b12cb76 100644
--- a/rts/Stats.c
+++ b/rts/Stats.c
@@ -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;
More information about the Cvs-ghc
mailing list