summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/parse-events.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-08-17 19:22:50 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-08-17 21:39:15 +0200
commitd17d0878f456c8227345b6c76b918ec068fa0abd (patch)
tree99ac28dae00148f660b53d163a3b8ad9083fb3a3 /tools/perf/util/parse-events.h
parentperf events parse: Rename parsing state struct to clearer name (diff)
downloadlinux-d17d0878f456c8227345b6c76b918ec068fa0abd.tar.xz
linux-d17d0878f456c8227345b6c76b918ec068fa0abd.zip
perf events parse: Use just one parse events state struct
Andi reported problems when parse errors were detected with vendor events (json), because in the yyparse/parse_events_parse function we dereferenced the _data parameter to two different structs, with different layouts, which ended up making parse_events_evlist->error to point to random stack addresses. Fix it by making _data to always be struct parse_events_state, changing the only place where 'struct parse_events_term' was used in parse_events.y. Reported-by: Andi Kleen <ak@linux.intel.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-bc27lshz823hxl8n9nkelcgh@git.kernel.org Fixes: 90e2b22dee90 ("perf/tool: Add support to reuse event grammar to parse out terms") Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-events.h')
-rw-r--r--tools/perf/util/parse-events.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index 8fff8423469b..2a3617937894 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -114,10 +114,7 @@ struct parse_events_state {
int nr_groups;
struct parse_events_error *error;
struct perf_evlist *evlist;
-};
-
-struct parse_events_terms {
- struct list_head *terms;
+ struct list_head *terms;
};
void parse_events__shrink_config_terms(void);