type StackCounter … type stack … func NewStack(name string, depth int) *StackCounter { … } // Inc increments a stack counter. It computes the caller's stack and // looks up the corresponding counter. It then increments that counter, // creating it if necessary. func (c *StackCounter) Inc() { … } // EncodeStack returns the name of the counter to // use for the given stack of program counters. // The name encodes the stack. func EncodeStack(pcs []uintptr, prefix string) string { … } // DecodeStack expands the (compressed) stack encoded in the counter name. func DecodeStack(ename string) string { … } // input is <import path>.<function name> // output is (import path, function name) func cutLastDot(x string) (before, after string) { … } // Names reports all the counter names associated with a StackCounter. func (c *StackCounter) Names() []string { … } // Counters returns the known Counters for a StackCounter. // There may be more in the count file. func (c *StackCounter) Counters() []*Counter { … } func eq(a, b []uintptr) bool { … } // ReadStack reads the given stack counter. // This is the implementation of // golang.org/x/telemetry/counter/countertest.ReadStackCounter. func ReadStack(c *StackCounter) (map[string]uint64, error) { … } // IsStackCounter reports whether the counter name is for a stack counter. func IsStackCounter(name string) bool { … }