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

Function generateRawReport

internal/driver/driver.go:64–111  ·  view source on GitHub ↗

generateRawReport is allowed to modify p.

(p *profile.Profile, cmd []string, cfg config, o *plugin.Options)

Source from the content-addressed store, hash-verified

62
63// generateRawReport is allowed to modify p.
64func generateRawReport(p *profile.Profile, cmd []string, cfg config, o *plugin.Options) (*command, *report.Report, error) {
65 // Identify units of numeric tags in profile.
66 numLabelUnits := identifyNumLabelUnits(p, o.UI)
67
68 // Get report output format
69 c := pprofCommands[cmd[0]]
70 if c == nil {
71 panic("unexpected nil command")
72 }
73
74 cfg = applyCommandOverrides(cmd[0], c.format, cfg)
75
76 // Create label pseudo nodes before filtering, in case the filters use
77 // the generated nodes.
78 generateTagRootsLeaves(p, cfg, o.UI)
79
80 // Delay focus after configuring report to get percentages on all samples.
81 relative := cfg.RelativePercentages
82 if relative {
83 if err := applyFocus(p, numLabelUnits, cfg, o.UI); err != nil {
84 return nil, nil, err
85 }
86 }
87 ropt, err := reportOptions(p, numLabelUnits, cfg)
88 if err != nil {
89 return nil, nil, err
90 }
91 ropt.OutputFormat = c.format
92 if len(cmd) == 2 {
93 s, err := regexp.Compile(cmd[1])
94 if err != nil {
95 return nil, nil, fmt.Errorf("parsing argument regexp %s: %v", cmd[1], err)
96 }
97 ropt.Symbol = s
98 }
99
100 rpt := report.New(p, ropt)
101 if !relative {
102 if err := applyFocus(p, numLabelUnits, cfg, o.UI); err != nil {
103 return nil, nil, err
104 }
105 }
106 if err := aggregate(p, cfg); err != nil {
107 return nil, nil, err
108 }
109
110 return c, rpt, nil
111}
112
113// generateReport is allowed to modify p.
114func generateReport(p *profile.Profile, cmd []string, cfg config, o *plugin.Options) error {

Callers 2

makeReportMethod · 0.85
generateReportFunction · 0.85

Calls 7

NewFunction · 0.92
identifyNumLabelUnitsFunction · 0.85
applyCommandOverridesFunction · 0.85
generateTagRootsLeavesFunction · 0.85
applyFocusFunction · 0.85
reportOptionsFunction · 0.85
aggregateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…