[Git][ghc/ghc][master] Document `-prof` and non `-prof` code being incompatible.

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Thu Dec 19 04:43:37 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
267098ad by Andreas Klebinger at 2024-12-18T23:43:13-05:00
Document `-prof` and non `-prof` code being incompatible.

Fixes #25518.

- - - - -


1 changed file:

- docs/users_guide/profiling.rst


Changes:

=====================================
docs/users_guide/profiling.rst
=====================================
@@ -193,6 +193,13 @@ call are aggregated into the caller [2]_.
 Inserting cost centres by hand
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+.. pragma:: SCC
+
+    :where: any expression
+
+    Instructs GHC to track runtime cost associated with the expression
+    when profiling is enabled.
+
 Cost centres are just program annotations. When you say ``-fprof-auto``
 to the compiler, it automatically inserts a cost centre annotation
 around every binding not marked INLINE in your program, but you are
@@ -361,12 +368,17 @@ Compiler options for profiling
     :category:
 
     To make use of the profiling system *all* modules must be compiled
-    and linked with the :ghc-flag:`-prof` option. Any ``SCC`` annotations you've
+    and linked with the :ghc-flag:`-prof` option. Any :pragma:`SCC` annotations you've
     put in your source will spring to life.
 
-    Without a :ghc-flag:`-prof` option, your ``SCC``\ s are ignored; so you can
+    Without a :ghc-flag:`-prof` option, :pragma:`SCC` annotations are ignored; so you can
     compile ``SCC``-laden code without changing it.
 
+    Since :ghc-flag:`-prof` affects not just code generation but also memory layout at runtime
+    code compiled with and without :ghc-flag:`-prof` is fundamentally incompatible.
+    To get a functional executable a project has to be built
+    either fully with or fully without :ghc-flag:`-prof`.
+
 .. ghc-flag:: -fno-prof-count-entries
     :shortdesc: Do not collect entry counts
     :type: dynamic



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/267098ad7ff183ae483555571f6f8b1c751456ba

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/267098ad7ff183ae483555571f6f8b1c751456ba
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241218/fb221af8/attachment-0001.html>


More information about the ghc-commits mailing list