MCPcopy Create free account
hub / github.com/google/pprof / simplifyFunc

Function simplifyFunc

profile/prune.go:38–51  ·  view source on GitHub ↗

simplifyFunc does some primitive simplification of function names.

(f string)

Source from the content-addressed store, hash-verified

36
37// simplifyFunc does some primitive simplification of function names.
38func simplifyFunc(f string) string {
39 // Account for leading '.' on the PPC ELF v1 ABI.
40 funcName := strings.TrimPrefix(f, ".")
41 // Account for unsimplified names -- try to remove the argument list by trimming
42 // starting from the first '(', but skipping reserved names that have '('.
43 for _, ind := range bracketRx.FindAllStringSubmatchIndex(funcName, -1) {
44 foundReserved := slices.Contains(reservedNames, funcName[ind[0]:ind[1]])
45 if !foundReserved {
46 funcName = funcName[:ind[0]]
47 break
48 }
49 }
50 return funcName
51}
52
53// Prune removes all nodes beneath a node matching dropRx, and not
54// matching keepRx. If the root node of a Sample matches, the sample

Callers 2

PruneMethod · 0.85
PruneFromMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…