[Git][ghc/ghc][wip/eras-profiling-clean] 10 commits: rts: eras profiling mode

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Thu Feb 8 20:09:12 UTC 2024



Matthew Pickering pushed to branch wip/eras-profiling-clean at Glasgow Haskell Compiler / GHC


Commits:
53008080 by Matthew Pickering at 2024-01-12T11:50:20+00:00
rts: eras profiling mode

The eras profiling mode is useful for tracking the life-time of
closures. When a closure is written, the current era is recorded in the
profiling header. This records the era in which the closure was created.

* Enable with -he
* User mode: Use functions in GHC.Profiling.Eras to modify the era
* Automatically: --automatic-era-increment, increases the user era on major
  collections
* The first era is era 1
* -he<era> can be used with other profiling modes to select a specific
  era

If you just want to record the era but not to perform heap profiling you
can use `-he --no-automatic-heap-samples`.

Fixes #24332

- - - - -
74923d2c by Zubin Duggal at 2024-01-12T11:54:16+00:00
Fix profiling for C++ and allow ghc-debug to be loaded into ghci

- - - - -
ae3efc9b by Ben Gamari at 2024-01-12T11:54:16+00:00
rts/EventLog: Place eliminate duplicate strlens

Previously many of the `post*` implementations would first compute the
length of the event's strings in order to determine the event length.
Later we would then end up computing the length yet again in
`postString`. Now we instead pass the string length to `postStringLen`,
avoiding the repeated work.

- - - - -
ccd411d0 by Ben Gamari at 2024-01-12T11:54:16+00:00
rts/eventlog: Place upper bound on IPE string field lengths

The strings in IPE events may be of unbounded length. Limit the lengths
of these fields to 64k characters to ensure that we don't exceed the
maximum event length.

- - - - -
1265cfbc by Zubin Duggal at 2024-01-12T11:54:16+00:00
rts: drop unused postString function

- - - - -
2b4dc505 by Matthew Pickering at 2024-01-12T11:54:16+00:00
eventlog: Fix off-by-one error in postIPE

We were missing the extra_comma from the calculation of the size of the
payload of postIPE. This was causing assertion failures when the event
would overflow the buffer by one byte, as ensureRoomForVariable event
would report there was enough space for `n` bytes but then we would
write `n + 1` bytes into the buffer.

Fixes #24287

- - - - -
6fde6808 by Matthew Pickering at 2024-01-12T11:54:16+00:00
Add support for ghc-debug to ghc executable

- - - - -
51dddb72 by Matthew Pickering at 2024-01-12T11:54:16+00:00
Update ghc-debug commit

- - - - -
19fae1ab by Matthew Pickering at 2024-01-12T11:54:16+00:00
Stop retaining old ModGuts throughout subsequent simplifier phases

- - - - -
7f481878 by Matthew Pickering at 2024-01-12T11:54:16+00:00
Avoid retaining environments between simplifier phases

- - - - -


30 changed files:

- .gitmodules
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Core/Opt/CSE.hs
- compiler/GHC/Core/Opt/Pipeline.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/StgToCmm/Prof.hs
- docs/users_guide/profiling.rst
- + ghc-debug
- ghc/Main.hs
- ghc/ghc-bin.cabal.in
- hadrian/src/Packages.hs
- hadrian/src/Settings/Default.hs
- hadrian/src/Settings/Packages.hs
- + instructions.md
- libraries/base/base.cabal
- libraries/base/src/GHC/Profiling.hs
- + libraries/base/src/GHC/Profiling/Eras.hs
- libraries/base/src/GHC/RTS/Flags.hsc
- rts/CloneStack.c
- rts/Continuation.c
- rts/Heap.c
- rts/Interpreter.c
- rts/LdvProfile.h
- rts/Messages.c
- rts/PrimOps.cmm
- rts/ProfHeap.c
- rts/ProfHeap.h
- rts/Profiling.c
- rts/RaiseAsync.c


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5456e73515fa2495bf5721a78faadb7823d345a7...7f48187806db37b02a84fd68a19085e7edebfe5c

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5456e73515fa2495bf5721a78faadb7823d345a7...7f48187806db37b02a84fd68a19085e7edebfe5c
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/20240208/128e0187/attachment.html>


More information about the ghc-commits mailing list