linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: German Gomez <german.gomez@arm.com>
Cc: Wei Li <liwei391@huawei.com>, Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	guohanjun@huawei.com, jinyao5@huawei.com
Subject: Re: [PATCH] perf script: Fix printing 'phys_addr' failure issue
Date: Sat, 22 Jan 2022 17:04:07 -0300	[thread overview]
Message-ID: <YexjN1tV27bBQBkJ@kernel.org> (raw)
In-Reply-To: <1c38c70b-d165-acf9-1c98-eeb234fbbe99@arm.com>

Em Fri, Jan 21, 2022 at 11:24:57AM +0000, German Gomez escreveu:
> Hi Wei,
> 
> This looks good to me. As a followup we could also fix the 'weight'
> field, which was introduced recently.
> 
> On 21/01/2022 06:59, Wei Li wrote:
> > From: Yao Jin <jinyao5@huawei.com>
> >
> > Perf script was failed to print the phys_addr for SPE profiling.
> > One 'dummy' event is added by SPE profiling but it doesn't have PHYS_ADDR
> > attribute set, perf script then exits with error.
> >
> > Now referring to 'addr', use evsel__do_check_stype() to check the type.
> >
> > Before:
> >
> >   # perf record -e arm_spe_0/branch_filter=0,ts_enable=1,pa_enable=1,load_filter=1,jitter=0,\
> > 		store_filter=0,min_latency=0,event_filter=2/ -p 4064384 -- sleep 3
> >   # perf script -F pid,tid,addr,phys_addr
> >   Samples for 'dummy:u' event do not have PHYS_ADDR attribute set. Cannot print 'phys_addr' field.
> >
> > After:
> >
> >   # perf record -e arm_spe_0/branch_filter=0,ts_enable=1,pa_enable=1,load_filter=1,jitter=0,\
> > 		store_filter=0,min_latency=0,event_filter=2/ -p 4064384 -- sleep 3
> >   # perf script -F pid,tid,addr,phys_addr
> >   4064384/4064384 ffff802f921be0d0      2f921be0d0
> >   4064384/4064384 ffff802f921be0d0      2f921be0d0
> >
> > Signed-off-by: Yao Jin <jinyao5@huawei.com>
> > Signed-off-by: Wei Li <liwei391@huawei.com>
> 
> Reviewed-by: German Gomez <german.gomez@arm.com>
> 
> Also it looks like the SPE samples are also missing the PHYS_ADDR flag.
> I think we'll need to fix the consistency of the flags.

Thanks, applied.

- Arnaldo

 
> Many thanks,
> German
> 
> > ---
> >  tools/perf/builtin-script.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> > index ecd4f99a6c14..abae8184e171 100644
> > --- a/tools/perf/builtin-script.c
> > +++ b/tools/perf/builtin-script.c
> > @@ -515,7 +515,7 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session)
> >  		return -EINVAL;
> >  
> >  	if (PRINT_FIELD(PHYS_ADDR) &&
> > -	    evsel__check_stype(evsel, PERF_SAMPLE_PHYS_ADDR, "PHYS_ADDR", PERF_OUTPUT_PHYS_ADDR))
> > +	    evsel__do_check_stype(evsel, PERF_SAMPLE_PHYS_ADDR, "PHYS_ADDR", PERF_OUTPUT_PHYS_ADDR, allow_user_set))
> >  		return -EINVAL;
> >  
> >  	if (PRINT_FIELD(DATA_PAGE_SIZE) &&

-- 

- Arnaldo

      reply	other threads:[~2022-01-22 20:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-21  6:59 [PATCH] perf script: Fix printing 'phys_addr' failure issue Wei Li
2022-01-21 11:24 ` German Gomez
2022-01-22 20:04   ` Arnaldo Carvalho de Melo [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=YexjN1tV27bBQBkJ@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=german.gomez@arm.com \
    --cc=guohanjun@huawei.com \
    --cc=jinyao5@huawei.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=liwei391@huawei.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).