plugin

Imports

Imports #

"io"
"net/http"
"regexp"
"time"
"github.com/google/pprof/profile"

Type Aliases

MappingSources type #

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{...}

Interfaces

Fetcher interface #

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)
}

FlagSet interface #

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
}

ObjFile interface #

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
}

ObjTool interface #

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)
}

Symbolizer interface #

A Symbolizer introduces symbol information into a profile.

type Symbolizer interface {
Symbolize(mode string, srcs MappingSources, prof *profile.Profile) error
}

UI interface #

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 interface #

Writer provides a mechanism to write data under a certain name, typically a filename.

type Writer interface {
Open(name string) (io.WriteCloser, error)
}

Structs

Frame struct #

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 struct #

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
}

Inst struct #

An Inst is a single instruction in an assembly listing.

type Inst struct {
Addr uint64
Text string
Function string
File string
Line int
}

Options struct #

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
}

Sym struct #

A Sym describes a single symbol in an object file.

type Sym struct {
Name []string
File string
Start uint64
End uint64
}

Generated with Arrow