diff options
Diffstat (limited to 'tools/perf/util/stat-display.c')
-rw-r--r-- | tools/perf/util/stat-display.c | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index f5b4ee79568c..4c53bae5644b 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c | |||
@@ -88,9 +88,17 @@ static void aggr_printout(struct perf_stat_config *config, | |||
88 | config->csv_sep); | 88 | config->csv_sep); |
89 | break; | 89 | break; |
90 | case AGGR_NONE: | 90 | case AGGR_NONE: |
91 | fprintf(config->output, "CPU%*d%s", | 91 | if (evsel->percore) { |
92 | config->csv_output ? 0 : -4, | 92 | fprintf(config->output, "S%d-C%*d%s", |
93 | perf_evsel__cpus(evsel)->map[id], config->csv_sep); | 93 | cpu_map__id_to_socket(id), |
94 | config->csv_output ? 0 : -5, | ||
95 | cpu_map__id_to_cpu(id), config->csv_sep); | ||
96 | } else { | ||
97 | fprintf(config->output, "CPU%*d%s ", | ||
98 | config->csv_output ? 0 : -5, | ||
99 | perf_evsel__cpus(evsel)->map[id], | ||
100 | config->csv_sep); | ||
101 | } | ||
94 | break; | 102 | break; |
95 | case AGGR_THREAD: | 103 | case AGGR_THREAD: |
96 | fprintf(config->output, "%*s-%*d%s", | 104 | fprintf(config->output, "%*s-%*d%s", |
@@ -1103,6 +1111,30 @@ static void print_footer(struct perf_stat_config *config) | |||
1103 | "the same PMU. Try reorganizing the group.\n"); | 1111 | "the same PMU. Try reorganizing the group.\n"); |
1104 | } | 1112 | } |
1105 | 1113 | ||
1114 | static void print_percore(struct perf_stat_config *config, | ||
1115 | struct perf_evsel *counter, char *prefix) | ||
1116 | { | ||
1117 | bool metric_only = config->metric_only; | ||
1118 | FILE *output = config->output; | ||
1119 | int s; | ||
1120 | bool first = true; | ||
1121 | |||
1122 | if (!(config->aggr_map || config->aggr_get_id)) | ||
1123 | return; | ||
1124 | |||
1125 | for (s = 0; s < config->aggr_map->nr; s++) { | ||
1126 | if (prefix && metric_only) | ||
1127 | fprintf(output, "%s", prefix); | ||
1128 | |||
1129 | print_counter_aggrdata(config, counter, s, | ||
1130 | prefix, metric_only, | ||
1131 | &first); | ||
1132 | } | ||
1133 | |||
1134 | if (metric_only) | ||
1135 | fputc('\n', output); | ||
1136 | } | ||
1137 | |||
1106 | void | 1138 | void |
1107 | perf_evlist__print_counters(struct perf_evlist *evlist, | 1139 | perf_evlist__print_counters(struct perf_evlist *evlist, |
1108 | struct perf_stat_config *config, | 1140 | struct perf_stat_config *config, |
@@ -1153,7 +1185,10 @@ perf_evlist__print_counters(struct perf_evlist *evlist, | |||
1153 | print_no_aggr_metric(config, evlist, prefix); | 1185 | print_no_aggr_metric(config, evlist, prefix); |
1154 | else { | 1186 | else { |
1155 | evlist__for_each_entry(evlist, counter) { | 1187 | evlist__for_each_entry(evlist, counter) { |
1156 | print_counter(config, counter, prefix); | 1188 | if (counter->percore) |
1189 | print_percore(config, counter, prefix); | ||
1190 | else | ||
1191 | print_counter(config, counter, prefix); | ||
1157 | } | 1192 | } |
1158 | } | 1193 | } |
1159 | break; | 1194 | break; |