Commit 9d0dba23 authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

perf parse-events: Handle PE_TERM_HW in name_or_raw

Avoid duplicate logic for name_or_raw and PE_TERM_HW by having a rule
to turn PE_TERM_HW into a name_or_raw.
Signed-off-by: default avatarIan Rogers <irogers@google.com>
Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
Tested-by: default avatarAtish Patra <atishp@rivosinc.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Beeman Strong <beeman@rivosinc.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240416061533.921723-8-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 62593394
......@@ -603,6 +603,11 @@ event_term
}
name_or_raw: PE_RAW | PE_NAME | PE_LEGACY_CACHE
|
PE_TERM_HW
{
$$ = $1.str;
}
event_term:
PE_RAW
......@@ -644,20 +649,6 @@ name_or_raw '=' PE_VALUE
$$ = term;
}
|
name_or_raw '=' PE_TERM_HW
{
struct parse_events_term *term;
int err = parse_events_term__str(&term, PARSE_EVENTS__TERM_TYPE_USER,
$1, $3.str, &@1, &@3);
if (err) {
free($1);
free($3.str);
PE_ABORT(err);
}
$$ = term;
}
|
PE_LEGACY_CACHE
{
struct parse_events_term *term;
......@@ -710,18 +701,6 @@ PE_TERM '=' name_or_raw
$$ = term;
}
|
PE_TERM '=' PE_TERM_HW
{
struct parse_events_term *term;
int err = parse_events_term__str(&term, $1, /*config=*/NULL, $3.str, &@1, &@3);
if (err) {
free($3.str);
PE_ABORT(err);
}
$$ = term;
}
|
PE_TERM '=' PE_TERM
{
struct parse_events_term *term;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment