profile
Package profile provides a representation of github.com/google/pprof/proto/profile.proto and methods to encode/decode/merge profiles in this format.
常量
This section is empty.
变量
|
|
函数
This section is empty.
类型
type Demangler
|
|
Demangler maps symbol names to a human-readable form. This may include C++ demangling and additional simplification. Names that are not demangled may be missing from the resulting map.
type Function
|
|
Function corresponds to Profile.Function
type Label
|
|
Label corresponds to Profile.Label
type Line
|
|
Line corresponds to Profile.Line
type Location
|
|
Location corresponds to Profile.Location
type Mapping
|
|
Mapping corresponds to Profile.Mapping
type Profile
|
|
Profile is an in-memory representation of profile.proto.
func Merge
|
|
Merge merges all the profiles in profs into a single Profile. Returns a new profile independent of the input profiles. The merged profile is compacted to eliminate unused samples, locations, functions and mappings. Profiles must have identical profile sample and period types or the merge will fail. profile.Period of the resulting profile will be the maximum of all profiles, and profile.TimeNanos will be the earliest nonzero one.
func Parse
|
|
Parse parses a profile and checks for its validity. The input may be a gzip-compressed encoded protobuf or one of many legacy profile formats which may be unsupported in the future.
func ParseTracebacks
|
|
ParseTracebacks parses a set of tracebacks and returns a newly populated profile. It will accept any text file and generate a Profile out of it with any hex addresses it can identify, including a process map if it can recognize one. Each sample will include a tag “source” with the addresses recognized in string format.
(*Profile) Aggregate
|
|
Aggregate merges the locations in the profile into equivalence classes preserving the request attributes. It also updates the samples to point to the merged locations.
(*Profile) CheckValid
|
|
CheckValid tests whether the profile is valid. Checks include, but are not limited to:
- len(Profile.Sample[n].value) == len(Profile.value_unit)
- Sample.id has a corresponding Profile.Location
(*Profile) Compatible
|
|
Compatible determines if two profiles can be compared/merged. returns nil if the profiles are compatible; otherwise an error with details on the incompatibility.
(*Profile) Copy
|
|
Copy makes a fully independent copy of a profile.
(*Profile) Demangle
|
|
Demangle attempts to demangle and optionally simplify any function names referenced in the profile. It works on a best-effort basis: it will silently preserve the original names in case of any errors.
(*Profile) Empty
|
|
Empty reports whether the profile contains no samples.
(*Profile) FilterSamplesByName
|
|
FilterSamplesByName filters the samples in a profile and only keeps samples where at least one frame matches focus but none match ignore. Returns true is the corresponding regexp matched at least one sample.
(*Profile) FilterSamplesByTag
|
|
FilterSamplesByTag removes all samples from the profile, except those that match focus and do not match the ignore regular expression.
(*Profile) HasFileLines
|
|
HasFileLines determines if all locations in this profile have symbolized file and line number information.
(*Profile) HasFunctions
|
|
HasFunctions determines if all locations in this profile have symbolized function information.
(*Profile) Merge
|
|
Merge adds profile p adjusted by ratio r into profile p. Profiles must be compatible (same Type and SampleType). TODO(rsilvera): consider normalizing the profiles based on the total samples collected.
(*Profile) Normalize
|
|
Normalize normalizes the source profile by multiplying each value in profile by the ratio of the sum of the base profile’s values of that sample type to the sum of the source profile’s value of that sample type.
(*Profile) ParseMemoryMap
|
|
ParseMemoryMap parses a memory map in the format of /proc/self/maps, and overrides the mappings in the current profile. It renumbers the samples and locations in the profile correspondingly.
(*Profile) Prune
|
|
Prune removes all nodes beneath a node matching dropRx, and not matching keepRx. If the root node of a Sample matches, the sample will have an empty stack.
(*Profile) RemoveUninteresting
|
|
RemoveUninteresting prunes and elides profiles using built-in tables of uninteresting function names.
(*Profile) Scale
|
|
Scale multiplies all sample values in a profile by a constant.
(*Profile) ScaleN
|
|
ScaleN multiplies each sample values in a sample by a different amount.
(*Profile) String
|
|
Print dumps a text representation of a profile. Intended mainly for debugging purposes.
(*Profile) Write
|
|
Write writes the profile as a gzip-compressed marshaled protobuf.
type Sample
|
|
Sample corresponds to Profile.Sample
type TagMatch
|
|
TagMatch selects tags for filtering
type ValueType
|
|
ValueType corresponds to Profile.ValueType