summaryrefslogtreecommitdiff
path: root/tools/perf/util/parse-events.y
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2023-06-13 11:26:29 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-06-13 23:40:33 -0300
commit6ec9503f45740b6ae4cb7f3e7441b1539c6d51d6 (patch)
tree8781cdf44224fa99129cc8b68bc6a8d88aff0a3f /tools/perf/util/parse-events.y
parente4c4e8a538a0db071d291bc2dca487e1882a7d4f (diff)
perf parse-events: Avoid string for PE_BP_COLON, PE_BP_SLASH
There's no need to read the string ':' or '/' for PE_BP_COLON or PE_BP_SLASH and doing so causes parse-events.y to leak memory. The original patch has a committer note about not using these tokens presumably as yacc spotted they were a memory leak because no %destructor could be run. Remove the unused token workaround as there is now no value associated with these tokens. Fixes: f0617f526cb0c482 ("perf parse: Allow config terms with breakpoints") Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.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/20230613182629.1500317-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-events.y')
-rw-r--r--tools/perf/util/parse-events.y9
1 files changed, 0 insertions, 9 deletions
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 0c3d086cc22a..9f28d4b5502f 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -80,8 +80,6 @@ static void free_list_evsel(struct list_head* list_evsel)
%type <str> PE_LEGACY_CACHE
%type <str> PE_MODIFIER_EVENT
%type <str> PE_MODIFIER_BP
-%type <str> PE_BP_COLON
-%type <str> PE_BP_SLASH
%type <str> PE_EVENT_NAME
%type <str> PE_KERNEL_PMU_EVENT PE_PMU_EVENT_FAKE
%type <str> PE_DRV_CFG_TERM
@@ -510,9 +508,6 @@ PE_PREFIX_MEM PE_VALUE PE_BP_SLASH PE_VALUE PE_BP_COLON PE_MODIFIER_BP opt_event
struct list_head *list;
int err;
- parse_events_unused_value(&$3);
- parse_events_unused_value(&$5);
-
list = alloc_list();
ABORT_ON(!list);
err = parse_events_add_breakpoint(_parse_state, list,
@@ -531,8 +526,6 @@ PE_PREFIX_MEM PE_VALUE PE_BP_SLASH PE_VALUE opt_event_config
struct list_head *list;
int err;
- parse_events_unused_value(&$3);
-
list = alloc_list();
ABORT_ON(!list);
err = parse_events_add_breakpoint(_parse_state, list,
@@ -550,8 +543,6 @@ PE_PREFIX_MEM PE_VALUE PE_BP_COLON PE_MODIFIER_BP opt_event_config
struct list_head *list;
int err;
- parse_events_unused_value(&$3);
-
list = alloc_list();
ABORT_ON(!list);
err = parse_events_add_breakpoint(_parse_state, list,