mpickering/eventlog2html

Use of `traceEvent` should be `traceMarker`

dcoutts opened this issue · 2 comments

Quoth http://hackage.haskell.org/package/base-4.12.0.0/docs/Debug-Trace.html#g:3

Execution phase markers

When looking at a profile for the execution of a program we often want to be able to mark certain points or phases in the execution and see that visually in the profile.

Yes! This is exactly the purpose of these functions (traceMarker and traceMarkerIO).

The traceEvent is for high frequency events. The example with GHC being all black lines is correct since GHC is using traceEvent. That's why we have traceMarker for the low frequency ones to be used in profile visuals.

Lets change the tool to use the right one before this all sets in stone.

#93

Yes, that's because it was the wrong event.

I think the part of the documentation which is unclear is the explanation of traceEvent which explains that it is like trace.

The traceEvent function behaves like trace with the difference that the message is emitted to the eventlog

You typically use trace in the same manner that you should use traceMarker, in order to display a small number of markers about where you are in the program's execution. If you used trace like traceEvent, to emit a large number of events, then the output would be unreadable by a human.