MCPcopy Create free account
hub / github.com/dispatchrun/wzprof / makeStackTrace

Function makeStackTrace

wzprof.go:384–394  ·  view source on GitHub ↗
(st stackTrace, si experimental.StackIterator)

Source from the content-addressed store, hash-verified

382}
383
384func makeStackTrace(st stackTrace, si experimental.StackIterator) stackTrace {
385 st.fns = st.fns[:0]
386 st.pcs = st.pcs[:0]
387
388 for si.Next() {
389 st.fns = append(st.fns, si.Function())
390 st.pcs = append(st.pcs, si.ProgramCounter())
391 }
392 st.key = maphash.Bytes(stackTraceHashSeed, st.bytes())
393 return st
394}
395
396func (st stackTrace) host() bool {
397 return len(st.fns) > 0 && st.fns[0].Definition().GoFunction() != nil

Callers 6

BeforeMethod · 0.85
makeStackTraceFromFramesFunction · 0.85
BeforeMethod · 0.85
BeforeMethod · 0.85
BeforeMethod · 0.85
BeforeMethod · 0.85

Calls 4

bytesMethod · 0.80
NextMethod · 0.45
FunctionMethod · 0.45
ProgramCounterMethod · 0.45

Tested by 1

makeStackTraceFromFramesFunction · 0.68