public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: "Jin, Yao" <yao.jin@linux.intel.com>
Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org,
	mingo@redhat.com, alexander.shishkin@linux.intel.com,
	Linux-kernel@vger.kernel.org, ak@linux.intel.com,
	kan.liang@intel.com, yao.jin@intel.com
Subject: Re: [PATCH v3] perf pmu: Validate raw event with sysfs exported format bits
Date: Tue, 9 Mar 2021 22:44:21 +0100	[thread overview]
Message-ID: <YEfsNSM6kcR+Ygux@krava> (raw)
In-Reply-To: <b84f76b1-1300-ef04-9845-ff206dec9f10@linux.intel.com>

On Tue, Mar 09, 2021 at 11:00:02AM +0800, Jin, Yao wrote:

SNIP

> > > if (format->value != PERF_PMU_FORMAT_VALUE_CONFIG)
> > > 	continue;
> > > 
> > > Is it right?
> > 
> > sure, what I meant was to process only PERF_PMU_FORMAT_VALUE_CONFIG
> > and then call break, because there's no need to iterate further
> > 
> > jirka
> > 
> 
> Sorry, maybe I still misunderstood what you suggested.
> 
> My understanding is we still need to iterate the whole formats list even we
> find a PERF_PMU_FORMAT_VALUE_CONFIG.
> 
> root@kbl-ppc:/sys/devices/cpu/format# ls
> any  cmask  edge  event  frontend  in_tx  in_tx_cp  inv  ldlat  offcore_rsp  pc  umask
> root@kbl-ppc:/sys/devices/cpu/format# cat any
> config:21
> root@kbl-ppc:/sys/devices/cpu/format# cat cmask
> config:24-31
> root@kbl-ppc:/sys/devices/cpu/format# cat edge
> config:18
> root@kbl-ppc:/sys/devices/cpu/format# cat edge
> config:18
> root@kbl-ppc:/sys/devices/cpu/format# cat event
> config:0-7
> root@kbl-ppc:/sys/devices/cpu/format# cat frontend
> config1:0-23
> root@kbl-ppc:/sys/devices/cpu/format# cat in_tx_cp
> config:33
> root@kbl-ppc:/sys/devices/cpu/format# cat inv
> config:23
> root@kbl-ppc:/sys/devices/cpu/format# cat ldlat
> config1:0-15
> root@kbl-ppc:/sys/devices/cpu/format# cat offcore_rsp
> config1:0-63
> root@kbl-ppc:/sys/devices/cpu/format# cat pc
> config:19
> root@kbl-ppc:/sys/devices/cpu/format# cat umask
> config:8-15
> 
> If we break the loop when we get the first PERF_PMU_FORMAT_VALUE_CONFIG, we
> will only get the format 'any', right?

ugh, yep.. we need all of them ;-) sry

thanks,
jirka


      reply	other threads:[~2021-03-09 21:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08  3:15 [PATCH v3] perf pmu: Validate raw event with sysfs exported format bits Jin Yao
2021-03-08 10:35 ` Jiri Olsa
2021-03-08 12:57   ` Jin, Yao
2021-03-08 13:14     ` Jiri Olsa
2021-03-09  3:00       ` Jin, Yao
2021-03-09 21:44         ` Jiri Olsa [this message]

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=YEfsNSM6kcR+Ygux@krava \
    --to=jolsa@redhat.com \
    --cc=Linux-kernel@vger.kernel.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@intel.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=yao.jin@intel.com \
    --cc=yao.jin@linux.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