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)
| 35 | // manager. Then it generates a report formatted according to the |
| 36 | // options selected through the flags package. |
| 37 | func 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. |
| 64 | func generateRawReport(p *profile.Profile, cmd []string, cfg config, o *plugin.Options) (*command, *report.Report, error) { |
searching dependent graphs…