runtime: add GODEBUG=inittrace=1 support #41378
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Note: Like #38714 this is not a proposal for the proposal process.
This issue is to discuss and track the addition of support for init function tracing through GODEBUG for ad hoc debugging and profiling of init start times.
For the first minimal implementation (future iterations can expand functionality) I think that just showing the package name, start time of the init function, wall clock duration and total heap allocated bytes and number of allocs is sufficient. Later information like module version could be added.
Due to larger complexity and limited utility init tracing of plugins is not supported.
Having a more structured format like json output is omitted and likely needs a more holistic approach and decision in unison with adding support for gctrace in json format too.
Prototype CL: https://go-review.googlesource.com/c/go/+/254659
Example output:
/cc @mknyszek @aclements @randall77 @prattmic @josharian
The text was updated successfully, but these errors were encountered: