3 ms·
The usage of the term execution trace really threw me off. I am more familiar with that term meaning a instruction execution trace or maybe just a function trac
by Veserv 3y ago
The usage of the term execution trace really threw me off. I am more familiar with that term meaning a instruction execution trace or maybe just a function trace, so it made no sense why stack unwinding would be a bottleneck. Turns out it is actually a goroutine event (with stack trace at time of event) trace [1]. I guess Go does not have a code execution trace package?
[1] https://pkg.go.dev/runtime/trace https://pkg.go.dev/runtime/trace
- Thaxll 3y agoTracing code is a way to see what's happening in your code which Go provides: https://www.infoq.com/articles/debugging-go-programs-pprof-trace/ https://www.infoq.com/articles/debugging-go-programs-pprof-t... Many other language use the same technique, see Python with: https://github.com/bloomberg/memray https://github.com/bloomberg/memray
- Veserv 3y agoI was talking about execution tracing, specifically, not tracing as a general concept. Tracing as a general concept just means a non-sampled time-series event stream and as commonly used these days generally also includes "stacking" to distinguish it from generic event streams or logging. When you add a additional term like "execution" you are specializing the term to mean a event stream of "execution". In areas I am familiar with, that would normally mean a trace of the complete execution of the program down to the instruction-level so you can trace the precise "execution" of the program through the code. What is described here would, in the terminology I am familiar with, be more like... a thread status and system event trace just applied to goroutines and the Go runtime, respectively, I guess? It does also include the stack trace at the time of the event, so it does have more data than that, but that is qualitatively different than a instruction execution trace that allows you to trace the exact sequence of execution of your program.
- felixge 3y agoGo doesn't have an instruction (execution) or function call tracer. Go's tracer is primarily tracing scheduler events. So maybe the term scheduler tracer should have been used? Anyway, using the term "execution tracer" in Go goes back to the initial design doc from 2014: https://docs.google.com/document/u/1/d/1FP5apqzBgr7ahCCgFO-yoVhk4YZrNIDNf9RybngBc14/pub https://docs.google.com/document/u/1/d/1FP5apqzBgr7ahCCgFO-y...