[commit: ghc] master: Remove the DEBUG_<blah> variables, use RtsFlags directly (4dcbbd1)
git at git.haskell.org
git at git.haskell.org
Wed Aug 3 07:07:57 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/4dcbbd1db1dc18aa07b031fcbad2cf94c0334d3f/ghc
>---------------------------------------------------------------
commit 4dcbbd1db1dc18aa07b031fcbad2cf94c0334d3f
Author: Simon Marlow <marlowsd at gmail.com>
Date: Tue Aug 2 13:09:32 2016 +0100
Remove the DEBUG_<blah> variables, use RtsFlags directly
>---------------------------------------------------------------
4dcbbd1db1dc18aa07b031fcbad2cf94c0334d3f
rts/Trace.c | 41 -----------------------------------------
rts/Trace.h | 34 +++++++++++++++++-----------------
2 files changed, 17 insertions(+), 58 deletions(-)
diff --git a/rts/Trace.c b/rts/Trace.c
index 0dc05d5..4eee026 100644
--- a/rts/Trace.c
+++ b/rts/Trace.c
@@ -25,26 +25,6 @@
#include <unistd.h>
#endif
-#ifdef DEBUG
-// debugging flags, set with +RTS -D<something>
-int DEBUG_sched;
-int DEBUG_interp;
-int DEBUG_weak;
-int DEBUG_gccafs;
-int DEBUG_gc;
-int DEBUG_block_alloc;
-int DEBUG_sanity;
-int DEBUG_stable;
-int DEBUG_stm;
-int DEBUG_prof;
-int DEBUG_gran;
-int DEBUG_par;
-int DEBUG_linker;
-int DEBUG_squeeze;
-int DEBUG_hpc;
-int DEBUG_sparks;
-#endif
-
// events
int TRACE_sched;
int TRACE_gc;
@@ -69,27 +49,6 @@ void initTracing (void)
initMutex(&trace_utx);
#endif
-#ifdef DEBUG
-#define DEBUG_FLAG(name, class) \
- class = RtsFlags.DebugFlags.name ? 1 : 0;
-
- DEBUG_FLAG(scheduler, DEBUG_sched);
-
- DEBUG_FLAG(interpreter, DEBUG_interp);
- DEBUG_FLAG(weak, DEBUG_weak);
- DEBUG_FLAG(gccafs, DEBUG_gccafs);
- DEBUG_FLAG(gc, DEBUG_gc);
- DEBUG_FLAG(block_alloc, DEBUG_block_alloc);
- DEBUG_FLAG(sanity, DEBUG_sanity);
- DEBUG_FLAG(stable, DEBUG_stable);
- DEBUG_FLAG(stm, DEBUG_stm);
- DEBUG_FLAG(prof, DEBUG_prof);
- DEBUG_FLAG(linker, DEBUG_linker);
- DEBUG_FLAG(squeeze, DEBUG_squeeze);
- DEBUG_FLAG(hpc, DEBUG_hpc);
- DEBUG_FLAG(sparks, DEBUG_sparks);
-#endif
-
// -Ds turns on scheduler tracing too
TRACE_sched =
RtsFlags.TraceFlags.scheduler ||
diff --git a/rts/Trace.h b/rts/Trace.h
index 8b531f1..ccdad7a 100644
--- a/rts/Trace.h
+++ b/rts/Trace.h
@@ -45,23 +45,23 @@ enum CapsetType { CapsetTypeCustom = CAPSET_TYPE_CUSTOM,
// Message classes
// -----------------------------------------------------------------------------
-// debugging flags, set with +RTS -D<something>
-extern int DEBUG_sched;
-extern int DEBUG_interp;
-extern int DEBUG_weak;
-extern int DEBUG_gccafs;
-extern int DEBUG_gc;
-extern int DEBUG_block_alloc;
-extern int DEBUG_sanity;
-extern int DEBUG_stable;
-extern int DEBUG_stm;
-extern int DEBUG_prof;
-extern int DEBUG_gran;
-extern int DEBUG_par;
-extern int DEBUG_linker;
-extern int DEBUG_squeeze;
-extern int DEBUG_hpc;
-extern int DEBUG_sparks;
+// shorthand for RtsFlags.DebugFlags.<blah>, useful with debugTrace()
+#define DEBUG_sched RtsFlags.DebugFlags.scheduler
+#define DEBUG_interp RtsFlags.DebugFlags.interp
+#define DEBUG_weak RtsFlags.DebugFlags.weak
+#define DEBUG_gccafs RtsFlags.DebugFlags.gccafs
+#define DEBUG_gc RtsFlags.DebugFlags.gc
+#define DEBUG_block_alloc RtsFlags.DebugFlags.alloc
+#define DEBUG_sanity RtsFlags.DebugFlags.sanity
+#define DEBUG_stable RtsFlags.DebugFlags.stable
+#define DEBUG_stm RtsFlags.DebugFlags.stm
+#define DEBUG_prof RtsFlags.DebugFlags.prof
+#define DEBUG_gran RtsFlags.DebugFlags.gran
+#define DEBUG_par RtsFlags.DebugFlags.par
+#define DEBUG_linker RtsFlags.DebugFlags.linker
+#define DEBUG_squeeze RtsFlags.DebugFlags.squeeze
+#define DEBUG_hpc RtsFlags.DebugFlags.hpc
+#define DEBUG_sparks RtsFlags.DebugFlags.sparks
// events
extern int TRACE_sched;
More information about the ghc-commits
mailing list