summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-11-25 17:03:08 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-03-02 01:14:59 -0500
commit75caafaafca5a1941c276f95017c34f68da8d679 (patch)
tree58113d937239965d60a3221c99a82b3739ebec58 /compiler/GHC/Driver
parent7aeb6d29313b23cd8d4da5d42cd9e740cca5c1df (diff)
downloadhaskell-75caafaafca5a1941c276f95017c34f68da8d679.tar.gz
Ticky profiling improvements.
This adds a number of changes to ticky-ticky profiling. When an executable is profiled with IPE profiling it's now possible to associate id-related ticky counters to their source location. This works by emitting the info table address as part of the counter which can be looked up in the IPE table. Add a `-ticky-ap-thunk` flag. This flag prevents the use of some standard thunks which are precompiled into the RTS. This means reduced cache locality and increased code size. But it allows better attribution of execution cost to specific source locations instead of simple attributing it to the standard thunk. ticky-ticky now uses the `arg` field to emit additional information about counters in json format. When ticky-ticky is used in combination with the eventlog eventlog2html can be used to generate a html table from the eventlog similar to the old text output for ticky-ticky.
Diffstat (limited to 'compiler/GHC/Driver')
-rw-r--r--compiler/GHC/Driver/Config/StgToCmm.hs1
-rw-r--r--compiler/GHC/Driver/Flags.hs1
-rw-r--r--compiler/GHC/Driver/Session.hs2
3 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/Driver/Config/StgToCmm.hs b/compiler/GHC/Driver/Config/StgToCmm.hs
index 4b0e126f98..9896fed3bc 100644
--- a/compiler/GHC/Driver/Config/StgToCmm.hs
+++ b/compiler/GHC/Driver/Config/StgToCmm.hs
@@ -57,6 +57,7 @@ initStgToCmmConfig dflags mod = StgToCmmConfig
, stgToCmmAvx = isAvxEnabled dflags
, stgToCmmAvx2 = isAvx2Enabled dflags
, stgToCmmAvx512f = isAvx512fEnabled dflags
+ , stgToCmmTickyAP = gopt Opt_Ticky_AP dflags
} where profile = targetProfile dflags
platform = profilePlatform profile
bk_end = backend dflags
diff --git a/compiler/GHC/Driver/Flags.hs b/compiler/GHC/Driver/Flags.hs
index b8abc2f9a2..21530048f2 100644
--- a/compiler/GHC/Driver/Flags.hs
+++ b/compiler/GHC/Driver/Flags.hs
@@ -296,6 +296,7 @@ data GeneralFlag
| Opt_Ticky_LNE
| Opt_Ticky_Dyn_Thunk
| Opt_Ticky_Tag
+ | Opt_Ticky_AP -- ^ Use regular thunks even when we could use std ap thunks in order to get entry counts
| Opt_RPath
| Opt_RelativeDynlibPaths
| Opt_CompactUnwind -- ^ @-fcompact-unwind@
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index bf4eaae513..d4d41accf6 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -2332,6 +2332,8 @@ dynamic_flags_deps = [
(NoArg (setGeneralFlag Opt_Ticky_Allocd))
, make_ord_flag defGhcFlag "ticky-LNE"
(NoArg (setGeneralFlag Opt_Ticky_LNE))
+ , make_ord_flag defGhcFlag "ticky-ap-thunk"
+ (NoArg (setGeneralFlag Opt_Ticky_AP))
, make_ord_flag defGhcFlag "ticky-dyn-thunk"
(NoArg (setGeneralFlag Opt_Ticky_Dyn_Thunk))
, make_ord_flag defGhcFlag "ticky-tag-checks"