diff options
author | Mitsutoshi Aoe <maoe@foldr.in> | 2018-08-21 16:08:17 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-08-21 18:56:12 -0400 |
commit | 21f0f56164f50844c2150c62f950983b2376f8b6 (patch) | |
tree | 998c56ef1553695f0134d4797767503576fe8132 /rts/PrimOps.cmm | |
parent | 8546afc502306de16b62c6386fe419753393cb12 (diff) | |
download | haskell-21f0f56164f50844c2150c62f950983b2376f8b6.tar.gz |
Add traceBinaryEvent# primop
This adds a new primop called traceBinaryEvent# that takes the length
of binary data and a pointer to the data, then emits it to the eventlog.
There is some example code that uses this primop and the new event:
* [traceBinaryEventIO][1] that calls `traceBinaryEvent#`
* [A patch to ghc-events][2] that parses the new `EVENT_USER_BINARY_MSG`
There's no corresponding issue on Trac but it was discussed at
ghc-devs [3].
[1] https://github.com/maoe/ghc-trace-events/blob
/fb226011ef1f85a97b4da7cc9d5f98f9fe6316ae/src/Debug/Trace/Binary.hs#L29)
[2] https://github.com/maoe/ghc-events/commit
/239ca77c24d18cdd10d6d85a0aef98e4a7c56ae6)
[3] https://mail.haskell.org/pipermail/ghc-devs/2018-May/015791.html
Reviewers: bgamari, erikd, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D5007
Diffstat (limited to 'rts/PrimOps.cmm')
-rw-r--r-- | rts/PrimOps.cmm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 4e4c6a6947..a5d8553e94 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -2405,6 +2405,14 @@ stg_traceEventzh ( W_ msg ) return (); } +stg_traceBinaryEventzh ( W_ msg, W_ len ) +{ +#if defined(TRACING) || defined(DEBUG) + ccall traceUserBinaryMsg(MyCapability() "ptr", msg "ptr", len); +#endif + return (); +} + // Same code as stg_traceEventzh above but a different kind of event // Before changing this code, read the comments in the impl above stg_traceMarkerzh ( W_ msg ) |