A common source of bad traces is user error, specifically not calling trace.Stop
, or not waiting for the call to finish before exiting the process. Such traces already lead to parse errors, but it's difficult to tell if a parse error is due to a bug in the trace writer, the parser, or said user error. If we had a marker or footer of sorts at the very end of the trace, its absence would be a strong indicator of user error.
On Slack, @mknyszek told me that the flight recorder added an "end of generation" event, but that this is currently not exposed in the final file or the parser, and that it could be used for this purpose.
Comment From: mknyszek
CC @cagedmantis
Comment From: gopherbot
Change https://go.dev/cl/693398 mentions this issue: internal/trace: add end-of-generation signal to trace