<div dir="ltr">I forgot to mention that I have prototype implementation:<div><br></div><div><span style="font-size:16.25px">* <a href="https://github.com/maoe/ghc/tree/traceEventBinary">https://github.com/maoe/ghc/tree/traceEventBinary</a></span><br></div><div><span style="font-size:16.25px">* <a href="https://github.com/maoe/ghc-trace-events/blob/feature/traceEventBinary/src/Debug/Trace/ByteString.hs#L46-L58">https://github.com/maoe/ghc-trace-events/blob/feature/traceEventBinary/src/Debug/Trace/ByteString.hs#L46-L58</a></span><br></div><div><br></div><div>Some details still need to be sorted out though.</div><div><br></div><div>Regards,</div><div>Mitsutoshi</div></div><br><div class="gmail_quote"><div dir="ltr">2018年5月28日(月) 16:23 Mitsutoshi Aoe <<a href="mailto:maoe@foldr.in">maoe@foldr.in</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi devs,<div><br></div><div>I'm thinking to add a primop in GHC but not sure how I should proceed. The primop I have in mind is something like:</div><div><br></div><div>  traceEventBinary# :: Addr# -> Int# -> State# s -> State# s<br></div><div><br></div><div>This function is similar to the existing traceEvent# but it takes a chunk of bytes rather than a null-terminated string. It is useful to trace custom user events (e.g. network packet arrival timestamps in an network application) in eventlogs. At library level, it is supposed to be used like the tracing functions in Debug.Trace but with ByteString argument:</div><div><br></div><div>  traceEventBinary :: ByteString -> a -> a</div><div>  traceEventBinaryIO :: ByteString -> IO ()</div><div><br></div><div>Note that this can't live in base because of the dependency on bytestring.</div><div><br></div><div>So how should I proceed from here? Am I supposed to submit a GHC proposal or should I ask on the libraries list? This is not a prominently visible change in GHC. It rather affects only ghc-prim and no effects in base.</div><div><br></div><div>Thanks,</div><div>Mitsutoshi</div><div><br></div><div><br></div></div></blockquote></div>