mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 03:53:37 +02:00
perf pmu: Make pmu_alias_terms weak again
The terms for a json event should be weak so they don't override
command line options.
Before:
```
$ perf record -vv -c 1000 -e uops_issued.any -o /dev/null true 2>&1
|grep "{ sample_period, sample_freq }"
{ sample_period, sample_freq } 200003
{ sample_period, sample_freq } 2000003
{ sample_period, sample_freq } 1000
```
After:
```
$ perf record -vv -c 1000 -e uops_issued.any -o /dev/null true 2>&1
|grep "{ sample_period, sample_freq }"
{ sample_period, sample_freq } 1000
{ sample_period, sample_freq } 1000
{ sample_period, sample_freq } 1000
```
Fixes: 84bae3af20 ("perf pmu: Don't eagerly parse event terms")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
6331b26693
commit
0e9b51a432
|
|
@ -802,6 +802,7 @@ static int pmu_aliases_parse_eager(struct perf_pmu *pmu, int sysfs_fd)
|
|||
static int pmu_alias_terms(struct perf_pmu_alias *alias, struct list_head *terms)
|
||||
{
|
||||
struct parse_events_terms alias_terms;
|
||||
struct parse_events_term *term;
|
||||
int ret;
|
||||
|
||||
parse_events_terms__init(&alias_terms);
|
||||
|
|
@ -812,6 +813,13 @@ static int pmu_alias_terms(struct perf_pmu_alias *alias, struct list_head *terms
|
|||
parse_events_terms__exit(&alias_terms);
|
||||
return ret;
|
||||
}
|
||||
list_for_each_entry(term, &alias_terms.terms, list) {
|
||||
/*
|
||||
* Weak terms don't override command line options,
|
||||
* which we don't want for implicit terms in aliases.
|
||||
*/
|
||||
term->weak = true;
|
||||
}
|
||||
list_splice_init(&alias_terms.terms, terms);
|
||||
parse_events_terms__exit(&alias_terms);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user