sdk/golang/Standard Library/GoRuntimePprof
Standard Library

GoRuntimePprof

Go stdlib package — runtime/pprof. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

Other Methods

.Do()Neutral
#
Signature
Do(ctx context.Context, labels LabelSet, f func(context.Context))

Do calls f with a copy of the parent context with the

.ForLabels()Neutral
#
Signature
ForLabels(ctx context.Context, f func(key, value string) bool)

ForLabels invokes f with each label set on the context.

.Label()Neutral
#
Signature
Label(ctx context.Context, key string) (string, bool)

Label returns the value of the label with the given key on ctx, and a boolean indicating

.Labels()Neutral
#
Signature
Labels(args string) LabelSet

Labels takes an even number of strings representing key-value pairs

.Lookup()Neutral
#
Signature
Lookup(name string) *Profile

Lookup returns the profile with the given name, or nil if no such profile exists.

.NewProfile()Neutral
#
Signature
NewProfile(name string) *Profile

NewProfile creates a new profile with the given name.

.Profile.Add()Neutral
#
Signature
Profile.Add(value any, skip int)

Add adds the current execution stack to the profile, associated with value.

.Profile.Count()Neutral
#
Signature
Profile.Count() int

Count returns the number of execution stacks currently in the profile.

.Profile.Name()Neutral
#
Signature
Profile.Name() string

Name returns this profile's name, which can be passed to Lookup to reobtain the profile.

.Profile.Remove()Neutral
#
Signature
Profile.Remove(value any)

Remove removes the execution stack associated with value from the profile.

Fully-Qualified Names

FQNField
runtime/pproffqns[0]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

go.mod
// standard library — no go.mod entry required
rule.py
from codepathfinder.go_rule import ...  # runtime/pprof