diff options
author | Simon Marlow <simonmar@microsoft.com> | 2007-04-27 12:01:13 +0000 |
---|---|---|
committer | Simon Marlow <simonmar@microsoft.com> | 2007-04-27 12:01:13 +0000 |
commit | cbeb99efd4a117de5b028341dc41bc8f50717383 (patch) | |
tree | 718b3dab5c48e29f797210702cbc2dc4d2b732ea /rts/Proftimer.c | |
parent | 47e0b5e52240f8794b117e0dbde4e21f41ffe9ec (diff) | |
download | haskell-cbeb99efd4a117de5b028341dc41bc8f50717383.tar.gz |
Basic heap profile support without -prof
Now that constructor info tables contain the name of the constructor,
we can generate useful heap profiles without requiring the whole
program and libraries to be compiled with -prof. So now, "+RTS -hT"
generates a heap profile for any program, dividing the profile by
constructor. It wouldn't be hard to add support for grouping
constructors by module, or to restrict the profile to certain
constructors/modules/packages.
This means that for the first time we can get heap profiles for GHCi,
which was previously impossible because the byte-code
interpreter and linker don't work with -prof.
Diffstat (limited to 'rts/Proftimer.c')
-rw-r--r-- | rts/Proftimer.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/rts/Proftimer.c b/rts/Proftimer.c index ce20c491af..32e5c56073 100644 --- a/rts/Proftimer.c +++ b/rts/Proftimer.c @@ -6,8 +6,6 @@ * * ---------------------------------------------------------------------------*/ -#if defined (PROFILING) - #include "PosixSource.h" #include "Rts.h" @@ -66,9 +64,11 @@ initProfTimer( void ) void handleProfTick(void) { +#ifdef PROFILING if (do_prof_ticks) { CCCS->time_ticks++; } +#endif if (do_heap_prof_ticks) { ticks_to_heap_profile--; @@ -78,5 +78,3 @@ handleProfTick(void) } } } - -#endif /* PROFILING */ |