summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/9.2.1-notes.rst6
-rw-r--r--docs/users_guide/profiling.rst32
2 files changed, 37 insertions, 1 deletions
diff --git a/docs/users_guide/9.2.1-notes.rst b/docs/users_guide/9.2.1-notes.rst
index 4ba4fc911f..da0461f982 100644
--- a/docs/users_guide/9.2.1-notes.rst
+++ b/docs/users_guide/9.2.1-notes.rst
@@ -40,6 +40,10 @@ Compiler
- GHCi's ``:kind!`` command now expands through type synonyms in addition to type
families. See :ghci-cmd:`:kind`.
+- GHC now supports a flag, :ghc-flag:`-fprof-callers=⟨name⟩`, for requesting
+ that the compiler automatically insert cost-centres on all call-sites of
+ the named function.
+
``ghc-prim`` library
~~~~~~~~~~~~~~~~~~~~
@@ -47,7 +51,7 @@ Compiler
Code using ``Void#`` now has to enable :extension:`UnboxedTuples`.
``ghc`` library
-~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~
- The ``con_args`` field of ``ConDeclGADT`` has been renamed to ``con_g_args``.
This is because the type of ``con_g_args`` is now different from the type of
diff --git a/docs/users_guide/profiling.rst b/docs/users_guide/profiling.rst
index 77e00bbbe4..0b075429b5 100644
--- a/docs/users_guide/profiling.rst
+++ b/docs/users_guide/profiling.rst
@@ -358,6 +358,38 @@ Automatically placing cost-centres
GHC has a number of flags for automatically inserting cost-centres into the
compiled program.
+.. ghc-flag:: -fprof-callers=⟨name⟩
+ :shortdesc: Auto-add ``SCC``\\ s to all call-sites of the named function.
+ :type: dynamic
+ :category:
+
+ Automatically enclose all occurrences of the named function in an ``SCC``.
+ Note that these cost-centres are added late in compilation (after
+ simplification) and consequently the names may be slightly different than
+ they appear in the source program (e.g. a call to ``f`` may inlined with
+ its wrapper, resulting in an occurrence of its worker, ``$wf``).
+
+ In addition to plain module-qualified names (e.g. ``Data.List.map``),
+ ⟨name⟩ also accepts a small globbing language using ``*`` as a wildcard
+ symbol:
+
+ .. code-block:: none
+
+ pattern := <module> '.' <identifier>
+ module := '*'
+ | <Haskell module name>
+ identifier := <ident_char>
+ ident
+
+ For instance, the following are all valid patterns:
+
+ * ``Data.List.map``
+ * ``*.map``
+ * ``*.parse*``
+ * ``*.<\\*>``
+
+ The ``*`` character can be used literally by escaping (e.g. ``\\*``).
+
.. ghc-flag:: -fprof-auto
:shortdesc: Auto-add ``SCC``\\ s to all bindings not marked INLINE
:type: dynamic