...

Package driver

import "cmd/vendor/github.com/google/pprof/internal/driver"
Overview
Index

Overview ▾

Package driver implements the core pprof functionality. It can be parameterized with a flag implementation, fetch and symbolize mechanisms.

func AddCommand

func AddCommand(cmd string, format int, post PostProcessor, desc, usage string)

AddCommand adds an additional command to the set of commands accepted by pprof. This enables extensions to add new commands for specialized visualization formats. If the command specified already exists, it is overwritten.

func PProf

func PProf(eo *plugin.Options) error

PProf acquires a profile, and symbolizes it using a profile manager. Then it generates a report formatted according to the options selected through the flags package.

func SetVariableDefault

func SetVariableDefault(variable, value string)

SetVariableDefault sets the default value for a pprof variable. This enables extensions to set their own defaults.

type GoFlags

GoFlags implements the plugin.FlagSet interface.

type GoFlags struct {
    UsageMsgs []string
}

func (*GoFlags) AddExtraUsage

func (f *GoFlags) AddExtraUsage(eu string)

AddExtraUsage implements the plugin.FlagSet interface.

func (*GoFlags) Bool

func (*GoFlags) Bool(o string, d bool, c string) *bool

Bool implements the plugin.FlagSet interface.

func (*GoFlags) ExtraUsage

func (f *GoFlags) ExtraUsage() string

ExtraUsage implements the plugin.FlagSet interface.

func (*GoFlags) Float64

func (*GoFlags) Float64(o string, d float64, c string) *float64

Float64 implements the plugin.FlagSet interface.

func (*GoFlags) Int

func (*GoFlags) Int(o string, d int, c string) *int

Int implements the plugin.FlagSet interface.

func (*GoFlags) Parse

func (*GoFlags) Parse(usage func()) []string

Parse implements the plugin.FlagSet interface.

func (*GoFlags) String

func (*GoFlags) String(o, d, c string) *string

String implements the plugin.FlagSet interface.

func (*GoFlags) StringList

func (*GoFlags) StringList(o, d, c string) *[]*string

StringList implements the plugin.FlagSet interface.

type PostProcessor

PostProcessor is a function that applies post-processing to the report output

type PostProcessor func(input io.Reader, output io.Writer, ui plugin.UI) error