From 27dc8653ba53fedc8db1a45dcb5e2ae477c72c2b Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 27 Aug 2009 03:22:07 -0400 Subject: [PATCH] Edit Debugging/TickyTicky --- debugging/ticky-ticky.md | 39 ++++++++++++++++++++++++++++++++++++++ debugging/ticky-ticky.trac | 34 +++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 debugging/ticky-ticky.md create mode 100644 debugging/ticky-ticky.trac diff --git a/debugging/ticky-ticky.md b/debugging/ticky-ticky.md new file mode 100644 index 000000000..3a44aeec2 --- /dev/null +++ b/debugging/ticky-ticky.md @@ -0,0 +1,39 @@ +# Ticky-ticky profiling + + +Ticky-ticky profiling adds counters to every STG function. It's very low-level, but it really tells you what is going on: + +- Add the `-ticky` flag when compiling a Haskell module to enable "ticky-ticky" profiling of that module. This makes GHC emit performance-counting instructions in every STG function. + +- Add `-ticky` to the command line when linking, so that you link against a version of the runtime system that allows you to display the results. + +- Add `+RTS -rfoo.ticky` to the run-time command line, to put the ticky-ticky profile in the file `foo.ticky`. + + +It's very low level stuff. You need to use `-ddump-simpl -ddump-prep` when compiling the source files to see the functions that correspond to the performance counter report. + + +You can mix modules compiled with `-ticky` and modules compiled without. + + +To really see everything you need to compile all the libraries with `-ticky`. To do that in a standard build tree, here are some flag settings in `build.mk` that work: + +```wiki +# Build all libraries with -ticky +GhcLibOpts += -ticky + +# Build the RTS in the ticky way +GhcRTSWays += t + +# Currently ticky is incompatible with threading +GhcThreaded = NO + +# When linking stage2 you need -ticky, else you get unresolved symols +GhcStage2HcOpts += -ticky + +# Ditto Haddock +utils/haddock_dist_EXTRA_HC_OPTS += -ticky +``` + + +But see [\#3439](https://gitlab.haskell.org//ghc/ghc/issues/3439), which would allow you to drop the last two. diff --git a/debugging/ticky-ticky.trac b/debugging/ticky-ticky.trac new file mode 100644 index 000000000..97fdd26b2 --- /dev/null +++ b/debugging/ticky-ticky.trac @@ -0,0 +1,34 @@ + + += Ticky-ticky profiling = + +Ticky-ticky profiling adds counters to every STG function. It's very low-level, but it really tells you what is going on: + + * Add the `-ticky` flag when compiling a Haskell module to enable "ticky-ticky" profiling of that module. This makes GHC emit performance-counting instructions in every STG function. + + * Add `-ticky` to the command line when linking, so that you link against a version of the runtime system that allows you to display the results. + + * Add `+RTS -rfoo.ticky` to the run-time command line, to put the ticky-ticky profile in the file `foo.ticky`. + +It's very low level stuff. You need to use `-ddump-simpl -ddump-prep` when compiling the source files to see the functions that correspond to the performance counter report. + +You can mix modules compiled with `-ticky` and modules compiled without. + +To really see everything you need to compile all the libraries with `-ticky`. To do that in a standard build tree, here are some flag settings in `build.mk` that work: +{{{ +# Build all libraries with -ticky +GhcLibOpts += -ticky + +# Build the RTS in the ticky way +GhcRTSWays += t + +# Currently ticky is incompatible with threading +GhcThreaded = NO + +# When linking stage2 you need -ticky, else you get unresolved symols +GhcStage2HcOpts += -ticky + +# Ditto Haddock +utils/haddock_dist_EXTRA_HC_OPTS += -ticky +}}} +But see #3439, which would allow you to drop the last two. \ No newline at end of file -- GitLab