<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">Hi Ben,<br />
<br />
Thanks for your reply. I take that at least for the GHC part I can submit the diff to phab and ask for review. I’ll do it.<br />
<br />
<font color="#0133B1">> As far as adding a wrapper in `base`, I think we can just go ahead and<br />
do it.<br />
<br />
Note that the wrapper cannot live in base doe to the dependency on bytestring. I’m thinking to put it in my ghc-trace-events for now.</font></div>
<div name="messageSignatureSection"><br />
Regards,
<div>Mitsutoshi</div>
</div>
<div name="messageReplySection"><br />
2018年5月30日 5:33 +0900、Ben Gamari <ben@smart-cactus.org>のメール:<br />
<blockquote type="cite">Mitsutoshi Aoe <maoe@foldr.in> writes:<br />
<br />
<blockquote type="cite">Hi devs,<br />
<br />
I'm thinking to add a primop in GHC but not sure how I should proceed. The<br />
primop I have in mind is something like:<br />
<br />
traceEventBinary# :: Addr# -> Int# -> State# s -> State# s<br />
<br />
This function is similar to the existing traceEvent# but it takes a chunk<br />
of bytes rather than a null-terminated string. It is useful to trace custom<br />
user events (e.g. network packet arrival timestamps in an network<br />
application) in eventlogs. At library level, it is supposed to be used like<br />
the tracing functions in Debug.Trace but with ByteString argument:<br />
<br />
traceEventBinary :: ByteString -> a -> a<br />
traceEventBinaryIO :: ByteString -> IO ()<br />
<br />
Note that this can't live in base because of the dependency on bytestring.<br />
<br />
So how should I proceed from here? Am I supposed to submit a GHC proposal<br />
or should I ask on the libraries list? This is not a prominently visible<br />
change in GHC. It rather affects only ghc-prim and no effects in base.<br />
<br /></blockquote>
Hmm, that is a good question. I have also needed something like your<br />
traceEventBinary# in the past and I think adding the primop is rather<br />
non-controversial.<br />
<br />
As far as adding a wrapper in `base`, I think we can just go ahead and<br />
do it. `Debug.Trace` module isn't defined by the Haskell Report so I<br />
don't think there's a need to involve the CLC here.<br />
<br />
Cheers,<br />
<br />
- Ben<br />
<br /></blockquote>
</div>
</body>
</html>