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

Function aggregate

internal/driver/driver.go:253–282  ·  view source on GitHub ↗
(prof *profile.Profile, cfg config)

Source from the content-addressed store, hash-verified

251}
252
253func aggregate(prof *profile.Profile, cfg config) error {
254 var function, filename, linenumber, address bool
255 inlines := !cfg.NoInlines
256 switch cfg.Granularity {
257 case "":
258 function = true // Default granularity is "functions"
259 case "addresses":
260 if inlines {
261 return nil
262 }
263 function = true
264 filename = true
265 linenumber = true
266 address = true
267 case "lines":
268 function = true
269 filename = true
270 linenumber = true
271 case "files":
272 filename = true
273 case "functions":
274 function = true
275 case "filefunctions":
276 function = true
277 filename = true
278 default:
279 return fmt.Errorf("unexpected granularity")
280 }
281 return prof.Aggregate(inlines, function, filename, linenumber, cfg.ShowColumns, address)
282}
283
284func reportOptions(p *profile.Profile, numLabelUnits map[string]string, cfg config) (*report.Options, error) {
285 si, mean := cfg.SampleIndex, cfg.Mean

Callers 1

generateRawReportFunction · 0.85

Calls 1

AggregateMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…