-
Notifications
You must be signed in to change notification settings - Fork 19k
runtime/pprof: better generic type information in pprof stack traces #68196
Copy link
Copy link
Open
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.gabywins
Milestone
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.gabywins
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
Todo
Proposal Details
tl;dr: Can we show something more descriptive than
go.shape.*uint8for generic methods invoked on a struct pointer Maybego.shape.uintptror the element type?While profiling is primarily seen as a performance tool, we often see it used for understanding the control flow of Go applications at runtime. In particular, profiling can be very useful to reveal which concrete types are being invoked behind an interface or a generic function call.
In one particular case @g-talbot recently tried to figure out the concrete type parameter for a generic function call, and to our surprise we saw the type being called
go.shape.*uint8which was confusing since it doesn't correspond to any of the types satisfying the type constraints of the generic functions. We would have expected to see something more like*SomeStructinstead.After a bit of digging, my colleague @nsrip-dd discovered that this output is probably intentional (source), but we're wondering if it could be made more user-friendly. Either by clarifying that the type is an unknown pointer type (
go.shape.uintptr) or by showing the actual type.Below is a minimal example that shows how to end up with a
go.shape.*uint8inside of a CPU profile:We understand that the current displayed type probably makes a lot of sense from the compiler's perspective, but seeing a
uint8type as a placeholder for a pointer type on a 64 bit system was confusing to us.