well-typed / ghc-events-analyze

BSD 3-Clause "New" or "Revised" License
67 stars 23 forks source link

User event questions #31

Open jberryman opened 5 years ago

jberryman commented 5 years ago

I hope this isn't spam but I have a few questions after reading the blog post and the README, and playing with this a little more:

  1. You write "[user START/STOP event] periods are completely independent of threads". Am I right that this means we can't just e.g. wrap a handler function HttpRequest -> IO JSON in traceEventIO "START/STOP mainHandlerFunc" and expect it to give sensible results (since STARTs and STOPs will be interleaved across threads, and ghc-events-analyze will pair a START from one thread with a STOP from a different one)?
  2. If so is this a usecase for "Event subscripts", where I could do above but hash the threadID and use that as a subscript, allowing us to correlate stops and starts?
  3. How should I understand how the tool behaves when there is nesting (START foo >> START bar >> STOP bar >> STOP foo)? It looks like that is supported but it's the users job to make note of when that's happening and what part of the time of an event should be attributed to a child event. I'm just interested in being able to use the same instrumentation to be able to get a more traditional profiling report as well, and I'm curious what you think about that (see also https://github.com/well-typed/ghc-events-analyze/issues/29)
jberryman commented 3 years ago

To belatedly answer some of my own questions: