public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Hekuang <hekuang@huawei.com>
Cc: peterz@infradead.org, mingo@redhat.com,
	alexander.shishkin@linux.intel.com, wangnan0@huawei.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] perf script: Don't disable use_callchain if input is pipe
Date: Mon, 15 Aug 2016 13:24:39 -0300	[thread overview]
Message-ID: <20160815162439.GA20972@kernel.org> (raw)
In-Reply-To: <57B1988B.3020806@huawei.com>

Em Mon, Aug 15, 2016 at 06:25:15PM +0800, Hekuang escreveu:
> ping.

Thanks, tested and applied both patches.

- Arnaldo
 
> 在 2016/8/4 19:25, He Kuang 写道:
> > Because perf data from pipe do not have a header with evsel attr, we
> > should not check that and disable symbol_conf.use_callchain. Otherwise,
> > perf script won't show callchains even if the data stream contains
> > callchain.
> > 
> > Before:
> >    $ perf record -g -o - uname |perf script
> >    Linux
> >    [ perf record: Woken up 1 times to write data ]
> >    [ perf record: Captured and wrote 0.000 MB - ]
> >    uname  1828 182630.186578:  250000 cpu-clock:  ..b9499 setup_arg_pages
> >    uname  1828 182630.186850:  250000 cpu-clock:  ..83b20 ___might_sleep
> >    uname  1828 182630.187153:  250000 cpu-clock:  ..4b6be file_map_prot_ch
> >    ...
> > 
> > After:
> >    $ perf record -g -o - uname |perf script
> >    Linux
> >    [ perf record: Woken up 1 times to write data ]
> >    [ perf record: Captured and wrote 0.000 MB - ]
> >    uname  1833 182675.927099:     250000 cpu-clock:
> >                    ba5520 _raw_spin_lock+0xfe200040 ([kernel.kallsyms])
> >                    389dd4 expand_downwards+0xfe200154 ([kernel.kallsyms])
> >                    389f34 expand_stack+0xfe200024 ([kernel.kallsyms])
> >                    3b957e setup_arg_pages+0xfe20019e ([kernel.kallsyms])
> >                    40c80f load_elf_binary+0xfe20042f ([kernel.kallsyms])
> >                    ...
> > 
> > Signed-off-by: He Kuang <hekuang@huawei.com>
> > ---
> >   tools/perf/builtin-script.c | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> > index d47aef9..ec8df8f 100644
> > --- a/tools/perf/builtin-script.c
> > +++ b/tools/perf/builtin-script.c
> > @@ -371,14 +371,16 @@ static int perf_session__check_output_opt(struct perf_session *session)
> >   	if (!no_callchain) {
> >   		bool use_callchain = false;
> > +		bool not_pipe = false;
> >   		evlist__for_each_entry(session->evlist, evsel) {
> > +			not_pipe = true;
> >   			if (evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN) {
> >   				use_callchain = true;
> >   				break;
> >   			}
> >   		}
> > -		if (!use_callchain)
> > +		if (not_pipe && !use_callchain)
> >   			symbol_conf.use_callchain = false;
> >   	}
> 

  reply	other threads:[~2016-08-15 16:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-04 11:25 [PATCH 1/2] perf script: Show proper message when failed list scripts He Kuang
2016-08-04 11:25 ` [PATCH 2/2] perf script: Don't disable use_callchain if input is pipe He Kuang
2016-08-15 10:25   ` Hekuang
2016-08-15 16:24     ` Arnaldo Carvalho de Melo [this message]
2016-08-16 18:15   ` [tip:perf/urgent] " tip-bot for He Kuang
2016-08-16 18:14 ` [tip:perf/urgent] perf script: Show proper message when failed list scripts tip-bot for He Kuang

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=20160815162439.GA20972@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=hekuang@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=wangnan0@huawei.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