[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YD43EnqkAKmN0Q4f@kernel.org>
Date: Tue, 2 Mar 2021 10:01:06 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Jiri Olsa <jolsa@...nel.org>
Cc: Chris Wilson <chris@...is-wilson.co.uk>,
Jin Yao <yao.jin@...ux.intel.com>,
lkml <linux-kernel@...r.kernel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Michael Petlan <mpetlan@...hat.com>,
Ian Rogers <irogers@...gle.com>
Subject: Re: [PATCH] perf tools: Fix event's pmu name parsing
Em Mon, Mar 01, 2021 at 01:23:15PM +0100, Jiri Olsa escreveu:
> Jin Yao reported parser error for software event:
>
> # perf stat -e software/r1a/ -a -- sleep 1
> event syntax error: 'software/r1a/'
> \___ parser error
>
> This happens after commit 8c3b1ba0e7ea, where new
> software-gt-awake-time event's non-pmu-event-style
> makes event parser conflict with software pmu.
>
> If we allow PE_PMU_EVENT_PRE to be parsed as pmu name,
> we fix the conflict and the following character '/' for
> pmu or '-' for non-pmu-event-style event allows parser
> to decide what even is specified.
Thanks, applied.
- Arnaldo
> Cc: Chris Wilson <chris@...is-wilson.co.uk>
> Fixes: 8c3b1ba0e7ea ("drm/i915/gt: Track the overall awake/busy time") # 1
> Reported-by: Jin Yao <yao.jin@...ux.intel.com>
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> ---
> tools/perf/util/parse-events.y | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
> index d5b6aff82f21..d57ac86ce7ca 100644
> --- a/tools/perf/util/parse-events.y
> +++ b/tools/perf/util/parse-events.y
> @@ -89,6 +89,7 @@ static void inc_group_count(struct list_head *list,
> %type <str> PE_EVENT_NAME
> %type <str> PE_PMU_EVENT_PRE PE_PMU_EVENT_SUF PE_KERNEL_PMU_EVENT PE_PMU_EVENT_FAKE
> %type <str> PE_DRV_CFG_TERM
> +%type <str> event_pmu_name
> %destructor { free ($$); } <str>
> %type <term> event_term
> %destructor { parse_events_term__delete ($$); } <term>
> @@ -272,8 +273,11 @@ event_def: event_pmu |
> event_legacy_raw sep_dc |
> event_bpf_file
>
> +event_pmu_name:
> +PE_NAME | PE_PMU_EVENT_PRE
> +
> event_pmu:
> -PE_NAME opt_pmu_config
> +event_pmu_name opt_pmu_config
> {
> struct parse_events_state *parse_state = _parse_state;
> struct parse_events_error *error = parse_state->error;
> --
> 2.29.2
>
--
- Arnaldo
Powered by blists - more mailing lists