Imports #
"io"
"net/http"
"regexp"
"time"
"github.com/google/pprof/profile"
"io"
"net/http"
"regexp"
"time"
"github.com/google/pprof/profile"
MappingSources map each profile.Mapping to the source of the profile. The key is either Mapping.File or Mapping.BuildId.
type MappingSources map[string][]struct{...}
A Fetcher reads and returns the profile named by src. src can be a local file path or a URL. duration and timeout are units specified by the end user, or 0 by default. duration refers to the length of the profile collection, if applicable, and timeout is the amount of time to wait for a profile before returning an error. Returns the fetched profile, the URL of the actual source of the profile, or an error.
type Fetcher interface {
Fetch(src string, duration time.Duration, timeout time.Duration) (*profile.Profile, string, error)
}
A FlagSet creates and parses command-line flags. It is similar to the standard flag.FlagSet.
type FlagSet interface {
Bool(name string, def bool, usage string) *bool
Int(name string, def int, usage string) *int
Float64(name string, def float64, usage string) *float64
String(name string, def string, usage string) *string
StringList(name string, def string, usage string) *[]*string
ExtraUsage() string
AddExtraUsage(eu string)
Parse(usage func()) []string
}
An ObjFile is a single object file: a shared library or executable.
type ObjFile interface {
Name() string
ObjAddr(addr uint64) (uint64, error)
BuildID() string
SourceLine(addr uint64) ([]Frame, error)
Symbols(r *regexp.Regexp, addr uint64) ([]*Sym, error)
Close() error
}
An ObjTool inspects shared libraries and executable files.
type ObjTool interface {
Open(file string, start uint64, limit uint64, offset uint64, relocationSymbol string) (ObjFile, error)
Disasm(file string, start uint64, end uint64, intelSyntax bool) ([]Inst, error)
}
A Symbolizer introduces symbol information into a profile.
type Symbolizer interface {
Symbolize(mode string, srcs MappingSources, prof *profile.Profile) error
}
A UI manages user interactions.
type UI interface {
ReadLine(prompt string) (string, error)
Print(...interface{})
PrintErr(...interface{})
IsTerminal() bool
WantBrowser() bool
SetAutoComplete(complete func(string) string)
}
Writer provides a mechanism to write data under a certain name, typically a filename.
type Writer interface {
Open(name string) (io.WriteCloser, error)
}
A Frame describes a location in a single line in a source file.
type Frame struct {
Func string
File string
Line int
Column int
StartLine int
}
HTTPServerArgs contains arguments needed by an HTTP server that is exporting a pprof web interface.
type HTTPServerArgs struct {
Hostport string
Host string
Port int
Handlers map[string]http.Handler
}
An Inst is a single instruction in an assembly listing.
type Inst struct {
Addr uint64
Text string
Function string
File string
Line int
}
Options groups all the optional plugins into pprof.
type Options struct {
Writer Writer
Flagset FlagSet
Fetch Fetcher
Sym Symbolizer
Obj ObjTool
UI UI
HTTPServer func(args *HTTPServerArgs) error
HTTPTransport http.RoundTripper
}
A Sym describes a single symbol in an object file.
type Sym struct {
Name []string
File string
Start uint64
End uint64
}
Generated with Arrow