Source File
prune.go
Belonging Package
github.com/google/pprof/profile
package profile
import (
)
var (
reservedNames = []string{"(anonymous namespace)", "operator()"}
bracketRx = func() *regexp.Regexp {
var []string
for , := range append(reservedNames, "(") {
= append(, regexp.QuoteMeta())
}
return regexp.MustCompile(strings.Join(, "|"))
}()
)
for , := range bracketRx.FindAllStringSubmatchIndex(, -1) {
:= false
for , := range reservedNames {
if [[0]:[1]] == {
= true
break
}
}
if ! {
= [:[0]]
break
}
}
return
}
func ( *Profile) () error {
var , *regexp.Regexp
var error
if .DropFrames != "" {
if , = regexp.Compile("^(" + .DropFrames + ")$"); != nil {
return fmt.Errorf("failed to compile regexp %s: %v", .DropFrames, )
}
if .KeepFrames != "" {
if , = regexp.Compile("^(" + .KeepFrames + ")$"); != nil {
return fmt.Errorf("failed to compile regexp %s: %v", .KeepFrames, )
}
}
.Prune(, )
}
return nil
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |