public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jin, Yao" <yao.jin@linux.intel.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: kernel test robot <oliver.sang@intel.com>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
	Matthew Brost <matthew.brost@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	lkp@lists.01.org, lkp@intel.com, Andi Kleen <ak@linux.intel.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	"Liang, Kan" <kan.liang@intel.com>,
	"Jin, Yao" <yao.jin@intel.com>, "Yi, Ammy" <ammy.yi@intel.com>
Subject: Re: [drm/i915/gt] 8c3b1ba0e7: perf-sanity-tests.Parse_event_definition_strings.fail
Date: Mon, 1 Mar 2021 09:12:01 +0800	[thread overview]
Message-ID: <d2a9769e-0632-0cfd-99e5-ab6ff2a54e46@linux.intel.com> (raw)
In-Reply-To: <YDtjgCcP9mLBcu/y@krava>

Hi Jiri,

On 2/28/2021 5:33 PM, Jiri Olsa wrote:
> On Sat, Feb 27, 2021 at 11:21:25AM +0100, Jiri Olsa wrote:
>> On Fri, Feb 26, 2021 at 08:41:26AM +0800, Jin, Yao wrote:
>>
>> SNIP
>>
>>>> +				SET_SYMBOL(prefix, PMU_EVENT_SYMBOL);
>>>>    				len++;
>>>>    			}
>>>>    		}
>>>>    	}
>>>> +
>>>> +	/* unlikely, but still.. */
>>>> +	if (!len)
>>>> +		goto err;
>>>> +	perf_pmu_events_list_num = len;
>>>> +
>>>>    	qsort(perf_pmu_events_list, len,
>>>>    		sizeof(struct perf_pmu_event_symbol), comp_pmu);
>>>>
>>>
>>> Thanks so much for the patch! It works with my tests.
>>>
>>> # ./perf test 6
>>>   6: Parse event definition strings                                  : Ok
>>>
>>> # ./perf stat -e software/r1a/ -a -- sleep 1
>>>
>>>   Performance counter stats for 'system wide':
>>>
>>>     <not supported>      software/r1a/
>>>
>>>         1.000940433 seconds time elapsed
>>>
>>> In theory, do we also need to check suffix as well? I think returning
>>> PMU_EVENT_SYMBOL_SUFFIX may also confuse the parser. But yes, we don't have
>>> this case now.
>>
>> yep, let's wait for use case ;-) you can't have suffix
>> without prefix, and that's the one failing, so I think
>> we are fine
> 
> actualy this one seems to work as well, could you plz check
> 
> thanks,
> jirka
> 
> 
> ---
> 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;
> 

This fix looks good.

[root@p-tglr02 perf]# ./perf list | grep i915/software-gt-awake-time/
   i915/software-gt-awake-time/                       [Kernel PMU event]

[root@p-tglr02 perf]# ./perf test 6
  6: Parse event definition strings                                  : Ok

[root@p-tglr02 perf]# ./perf stat -e software/r1a/ -a -- sleep 1

  Performance counter stats for 'system wide':

    <not supported>      software/r1a/

        1.001379319 seconds time elapsed

Thanks
Jin Yao

  reply	other threads:[~2021-03-01  1:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24  7:48 [drm/i915/gt] 8c3b1ba0e7: perf-sanity-tests.Parse_event_definition_strings.fail kernel test robot
2021-02-25  8:06 ` Jin, Yao
2021-02-25 13:33   ` Jiri Olsa
2021-02-25 18:16     ` Jiri Olsa
2021-02-25 18:50       ` Jiri Olsa
2021-02-25 19:03         ` Jiri Olsa
2021-02-26  0:41           ` Jin, Yao
2021-02-27 10:21             ` Jiri Olsa
2021-02-28  9:33               ` Jiri Olsa
2021-03-01  1:12                 ` Jin, Yao [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-12-26 10:58 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2a9769e-0632-0cfd-99e5-ab6ff2a54e46@linux.intel.com \
    --to=yao.jin@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=ammy.yi@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lkp@lists.01.org \
    --cc=matthew.brost@intel.com \
    --cc=oliver.sang@intel.com \
    --cc=tvrtko.ursulin@intel.com \
    --cc=yao.jin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox