diff options
author | Jiri Olsa <jolsa@kernel.org> | 2017-02-17 15:00:56 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-02-17 17:28:22 -0300 |
commit | 99e7138eb7897aa0ccc6661173ae2d7e79721e05 (patch) | |
tree | 6d603e00226f5a25356c0315827701ea6bc96ff8 /tools/perf/util/parse-events.c | |
parent | 67b49b38f7bd6f34319b540ce824d5697241b3a8 (diff) | |
download | lwn-99e7138eb7897aa0ccc6661173ae2d7e79721e05.tar.gz lwn-99e7138eb7897aa0ccc6661173ae2d7e79721e05.zip |
perf tools: Fail on using multiple bits long terms without value
Currently we allow not to specify value for numeric terms and we set
them to value 1. This was originaly meant just for single bit terms to
allow user to type:
$ perf record -e 'cpu/cpu-cycles,any'
instead of:
$ perf record -e 'cpu/cpu-cycles,any=1'
However it works also for multi bits terms like:
$ perf record -e 'cpu/event/' ls
...
$ perf evlist -v
..., config: 0x1, ...
After discussion with Peter we decided making such term usage to fail,
like:
$ perf record -e 'cpu/event/' ls
event syntax error: 'cpu/event/'
\___ no value assigned for term
...
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1487340058-10496-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r-- | tools/perf/util/parse-events.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 984d99a8fdc5..67a8aebc67ab 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -2349,6 +2349,7 @@ static int new_term(struct parse_events_term **_term, int parse_events_term__num(struct parse_events_term **term, int type_term, char *config, u64 num, + bool no_value, void *loc_term_, void *loc_val_) { YYLTYPE *loc_term = loc_term_; @@ -2358,6 +2359,7 @@ int parse_events_term__num(struct parse_events_term **term, .type_val = PARSE_EVENTS__TERM_TYPE_NUM, .type_term = type_term, .config = config, + .no_value = no_value, .err_term = loc_term ? loc_term->first_column : 0, .err_val = loc_val ? loc_val->first_column : 0, }; |