MCPcopy Create free account
hub / github.com/google/pprof / PProf

Function PProf

internal/driver/driver.go:37–61  ·  view source on GitHub ↗

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.

(eo *plugin.Options)

Source from the content-addressed store, hash-verified

35// manager. Then it generates a report formatted according to the
36// options selected through the flags package.
37func PProf(eo *plugin.Options) error {
38 // Remove any temporary files created during pprof processing.
39 defer cleanupTempFiles()
40
41 o := setDefaults(eo)
42
43 src, cmd, err := parseFlags(o)
44 if err != nil {
45 return err
46 }
47
48 p, err := fetchProfiles(src, o)
49 if err != nil {
50 return err
51 }
52
53 if cmd != nil {
54 return generateReport(p, cmd, currentConfig(), o)
55 }
56
57 if src.HTTPHostport != "" {
58 return serveWebInterface(src.HTTPHostport, p, o, src.HTTPDisableBrowser)
59 }
60 return interactive(p, o)
61}
62
63// generateRawReport is allowed to modify p.
64func generateRawReport(p *profile.Profile, cmd []string, cfg config, o *plugin.Options) (*command, *report.Report, error) {

Callers 1

TestParseFunction · 0.70

Calls 8

cleanupTempFilesFunction · 0.85
setDefaultsFunction · 0.85
parseFlagsFunction · 0.85
fetchProfilesFunction · 0.85
generateReportFunction · 0.85
currentConfigFunction · 0.85
serveWebInterfaceFunction · 0.85
interactiveFunction · 0.85

Tested by 1

TestParseFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…