diff options
Diffstat (limited to 'tools/perf')
| -rw-r--r-- | tools/perf/builtin-stat.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index a168e726756b..dff63733dfb7 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
| @@ -1316,6 +1316,14 @@ static int aggr_header_lens[] = { | |||
| 1316 | [AGGR_GLOBAL] = 0, | 1316 | [AGGR_GLOBAL] = 0, |
| 1317 | }; | 1317 | }; |
| 1318 | 1318 | ||
| 1319 | static const char *aggr_header_csv[] = { | ||
| 1320 | [AGGR_CORE] = "core,cpus,", | ||
| 1321 | [AGGR_SOCKET] = "socket,cpus", | ||
| 1322 | [AGGR_NONE] = "cpu,", | ||
| 1323 | [AGGR_THREAD] = "comm-pid,", | ||
| 1324 | [AGGR_GLOBAL] = "" | ||
| 1325 | }; | ||
| 1326 | |||
| 1319 | static void print_metric_headers(const char *prefix, bool no_indent) | 1327 | static void print_metric_headers(const char *prefix, bool no_indent) |
| 1320 | { | 1328 | { |
| 1321 | struct perf_stat_output_ctx out; | 1329 | struct perf_stat_output_ctx out; |
| @@ -1330,6 +1338,12 @@ static void print_metric_headers(const char *prefix, bool no_indent) | |||
| 1330 | if (!csv_output && !no_indent) | 1338 | if (!csv_output && !no_indent) |
| 1331 | fprintf(stat_config.output, "%*s", | 1339 | fprintf(stat_config.output, "%*s", |
| 1332 | aggr_header_lens[stat_config.aggr_mode], ""); | 1340 | aggr_header_lens[stat_config.aggr_mode], ""); |
| 1341 | if (csv_output) { | ||
| 1342 | if (stat_config.interval) | ||
| 1343 | fputs("time,", stat_config.output); | ||
| 1344 | fputs(aggr_header_csv[stat_config.aggr_mode], | ||
| 1345 | stat_config.output); | ||
| 1346 | } | ||
| 1333 | 1347 | ||
| 1334 | /* Print metrics headers only */ | 1348 | /* Print metrics headers only */ |
| 1335 | evlist__for_each(evsel_list, counter) { | 1349 | evlist__for_each(evsel_list, counter) { |
