func aggregate(prof *profile.Profile, f *flags) error { switch { case f.isFormat("proto"), f.isFormat("raw"): // No aggregation for raw profiles. case f.isFormat("callgrind"): // Aggregate to file/line for callgrind. fallthrough case *f.flagLines: return prof.Aggregate(true, true, true, true, false) case *f.flagFiles: return prof.Aggregate(true, false, true, false, false) case *f.flagFunctions: return prof.Aggregate(true, true, false, false, false) case f.isFormat("weblist"), f.isFormat("disasm"): return prof.Aggregate(false, true, true, true, true) } return nil }