Source File
index.go
Belonging Package
github.com/google/pprof/profile
package profile
import (
)
func ( *Profile) ( string) (int, error) {
if == "" {
if := .DefaultSampleType; != "" {
for , := range sampleTypes() {
if == {
return , nil
}
}
return len(.SampleType) - 1, nil
}
if , := strconv.Atoi(); == nil {
if < 0 || >= len(.SampleType) {
return 0, fmt.Errorf("sample_index %s is outside the range [0..%d]", , len(.SampleType)-1)
}
return , nil
}
:= strings.TrimPrefix(, "inuse_")
for , := range .SampleType {
if .Type == || .Type == {
return , nil
}
}
return 0, fmt.Errorf("sample_index %q must be one of: %v", , sampleTypes())
}
func ( *Profile) []string {
:= make([]string, len(.SampleType))
for , := range .SampleType {
[] = .Type
}
return
![]() |
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. |