aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/parse-events.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r--tools/perf/util/parse-events.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index f6257fb4f08c..39b15968eab1 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -309,10 +309,11 @@ static char *get_config_name(struct list_head *head_terms)
309static struct perf_evsel * 309static struct perf_evsel *
310__add_event(struct list_head *list, int *idx, 310__add_event(struct list_head *list, int *idx,
311 struct perf_event_attr *attr, 311 struct perf_event_attr *attr,
312 char *name, struct cpu_map *cpus, 312 char *name, struct perf_pmu *pmu,
313 struct list_head *config_terms, bool auto_merge_stats) 313 struct list_head *config_terms, bool auto_merge_stats)
314{ 314{
315 struct perf_evsel *evsel; 315 struct perf_evsel *evsel;
316 struct cpu_map *cpus = pmu ? pmu->cpus : NULL;
316 317
317 event_attr_init(attr); 318 event_attr_init(attr);
318 319
@@ -323,7 +324,7 @@ __add_event(struct list_head *list, int *idx,
323 (*idx)++; 324 (*idx)++;
324 evsel->cpus = cpu_map__get(cpus); 325 evsel->cpus = cpu_map__get(cpus);
325 evsel->own_cpus = cpu_map__get(cpus); 326 evsel->own_cpus = cpu_map__get(cpus);
326 evsel->system_wide = !!cpus; 327 evsel->system_wide = pmu ? pmu->is_uncore : false;
327 evsel->auto_merge_stats = auto_merge_stats; 328 evsel->auto_merge_stats = auto_merge_stats;
328 329
329 if (name) 330 if (name)
@@ -1233,7 +1234,7 @@ static int __parse_events_add_pmu(struct parse_events_state *parse_state,
1233 1234
1234 if (!head_config) { 1235 if (!head_config) {
1235 attr.type = pmu->type; 1236 attr.type = pmu->type;
1236 evsel = __add_event(list, &parse_state->idx, &attr, NULL, pmu->cpus, NULL, auto_merge_stats); 1237 evsel = __add_event(list, &parse_state->idx, &attr, NULL, pmu, NULL, auto_merge_stats);
1237 return evsel ? 0 : -ENOMEM; 1238 return evsel ? 0 : -ENOMEM;
1238 } 1239 }
1239 1240
@@ -1254,7 +1255,7 @@ static int __parse_events_add_pmu(struct parse_events_state *parse_state,
1254 return -EINVAL; 1255 return -EINVAL;
1255 1256
1256 evsel = __add_event(list, &parse_state->idx, &attr, 1257 evsel = __add_event(list, &parse_state->idx, &attr,
1257 get_config_name(head_config), pmu->cpus, 1258 get_config_name(head_config), pmu,
1258 &config_terms, auto_merge_stats); 1259 &config_terms, auto_merge_stats);
1259 if (evsel) { 1260 if (evsel) {
1260 evsel->unit = info.unit; 1261 evsel->unit = info.unit;