Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1463207

[PATCH 06/11] perf script: Don't disable use_callchain if input is pipe

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 06/11] perf script: Don't disable use_callchain if input is pipe
Date 2016-08-16 00:10 +0200
Message-ID <s6yf0-327-47@gated-at.bofh.it> (permalink)
References <s6yeZ-327-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: He Kuang <hekuang@huawei.com>

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>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1470309943-153909-2-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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 45c51eb6cab4..c859e59dfe3e 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;
 	}
 
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 00/11] perf/urgent fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-16 00:10 +0200
  [PATCH 02/11] perf tools mem: Fix -t store option for record command Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-16 00:10 +0200
  [PATCH 06/11] perf script: Don't disable use_callchain if input is pipe Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-16 00:10 +0200
  [PATCH 03/11] perf ppc64le: Fix build failure when libelf is not present Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-16 00:10 +0200
  [PATCH 11/11] perf intel-pt: Fix occasional decoding errors when tracing system-wide Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-16 00:10 +0200
  [PATCH 04/11] perf jitdump: Add the right header to get the major()/minor() definitions Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-16 00:10 +0200
  [PATCH 09/11] perf probe: Release resources on error when handling exit paths Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-16 00:10 +0200
  [PATCH 10/11] tools: Sync kvm related header files for arm64 and s390 Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-16 00:10 +0200
  [PATCH 05/11] perf script: Show proper message when failed list scripts Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-16 00:10 +0200
  [PATCH 07/11] perf symbols: Fix annotation of objects with debuginfo files Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-16 00:10 +0200
  [GIT PULL v2 00/11] perf/urgent fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-16 15:40 +0200
    Re: [GIT PULL v2 00/11] perf/urgent fixes Ingo Molnar <mingo@kernel.org> - 2016-08-16 20:20 +0200

csiph-web