summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/parse-events.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2017-10-20 13:27:55 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-02-25 11:07:54 +0100
commitbfb3906919d12aabc9d1974bb12c01902f7d2506 (patch)
tree2e6fc16c574775a7a46cdd38723a15b379a1ce05 /tools/perf/util/parse-events.c
parent76103695459665e6f1cc19097a619b57766d2798 (diff)
downloadlinux-stable-bfb3906919d12aabc9d1974bb12c01902f7d2506.tar.gz
linux-stable-bfb3906919d12aabc9d1974bb12c01902f7d2506.tar.bz2
linux-stable-bfb3906919d12aabc9d1974bb12c01902f7d2506.zip
perf record: Fix -c/-F options for cpu event aliases
[ Upstream commit 59622fd496a3175c7bf549046e091d81c303ecff ] The Intel PMU event aliases have a implicit period= specifier to set the default period. Unfortunately this breaks overriding these periods with -c or -F, because the alias terms look like they are user specified to the internal parser, and user specified event qualifiers override the command line options. Track that they are coming from aliases by adding a "weak" state to the term. Any weak terms don't override command line options. I only did it for -c/-F for now, I think that's the only case that's broken currently. Before: $ perf record -c 1000 -vv -e uops_issued.any ... { sample_period, sample_freq } 2000003 After: $ perf record -c 1000 -vv -e uops_issued.any ... { sample_period, sample_freq } 1000 Signed-off-by: Andi Kleen <ak@linux.intel.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Link: http://lkml.kernel.org/r/20171020202755.21410-2-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r--tools/perf/util/parse-events.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 56694e3409ea..b25635e945f3 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1115,6 +1115,7 @@ do { \
INIT_LIST_HEAD(&__t->list); \
__t->type = PERF_EVSEL__CONFIG_TERM_ ## __type; \
__t->val.__name = __val; \
+ __t->weak = term->weak; \
list_add_tail(&__t->list, head_terms); \
} while (0)
@@ -2395,6 +2396,7 @@ static int new_term(struct parse_events_term **_term,
*term = *temp;
INIT_LIST_HEAD(&term->list);
+ term->weak = false;
switch (term->type_val) {
case PARSE_EVENTS__TERM_TYPE_NUM: