summaryrefslogtreecommitdiff
path: root/tools/perf/util/parse-events.c
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2023-09-01 16:39:44 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-09-02 08:12:15 -0300
commit9ea150a8d073c2f2987d7e9ea4c35856449c9cb2 (patch)
tree99d6db8374463af7d5166be2d9608b3746cce673 /tools/perf/util/parse-events.c
parent64199ae4b8a36038dd5b69904a29bd48ef11ca8b (diff)
perf parse-events: Fixes relating to no_value terms
A term may have no value in which case it is assumed to have a value of 1. It doesn't just apply to alias/event terms so change the parse_events_term__to_strbuf assert. Commit 99e7138eb7897aa0 ("perf tools: Fail on using multiple bits long terms without value") made it so that no_value terms could only be for a single bit. Prior to commit 64199ae4b8a3 ("perf parse-events: Fix propagation of term's no_value when cloning") this missed a test case where config1 had no_value. Fixes: 64199ae4b8a36038 ("perf parse-events: Fix propagation of term's no_value when cloning") Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@arm.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230901233949.2930562-1-irogers@google.com 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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 68fe2c4ff49f..65608a3cba81 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -2607,7 +2607,7 @@ int parse_events_term__to_strbuf(struct list_head *term_list, struct strbuf *sb)
if (term->type_val == PARSE_EVENTS__TERM_TYPE_NUM)
if (term->no_value) {
- assert(term->type_term == PARSE_EVENTS__TERM_TYPE_USER);
+ assert(term->val.num == 1);
ret = strbuf_addf(sb, "%s", term->config);
} else
ret = strbuf_addf(sb, "%s=%#"PRIx64, term->config, term->val.num);