linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	David Ahern <dsahern@gmail.com>,
	Hendrick Brueckner <brueckner@linux.vnet.ibm.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Wang Nan <wangnan0@huawei.com>
Subject: [PATCH 21/32] perf trace: Setup DWARF callchains for non-syscall events when --max-stack is used
Date: Wed, 17 Jan 2018 13:12:11 -0300	[thread overview]
Message-ID: <20180117161222.15611-22-acme@kernel.org> (raw)
In-Reply-To: <20180117161222.15611-1-acme@kernel.org>

From: Arnaldo Carvalho de Melo <acme@redhat.com>

If we use:

	perf trace --max-stack=4

then the syscall events will use DWARF callchains, when available
(libunwind enabled in the build) and the printing will stop at 4 levels.

When we introduced support for tracepoint events this ended up not
applying for them, fix it.

Before:

  # perf trace --call-graph=dwarf --no-syscalls -e probe_libc:inet_pton ping -6 -c 1 ::1
  PING ::1(::1) 56 data bytes
  64 bytes from ::1: icmp_seq=1 ttl=64 time=0.058 ms

  --- ::1 ping statistics ---
  1 packets transmitted, 1 received, 0% packet loss, time 0ms
  rtt min/avg/max/mdev = 0.058/0.058/0.058/0.000 ms
       0.000 probe_libc:inet_pton:(7fc6c2a16350))
  #

After:

  # perf trace --call-graph=dwarf --no-syscalls -e probe_libc:inet_pton ping -6 -c 1 ::1
  PING ::1(::1) 56 data bytes
  64 bytes from ::1: icmp_seq=1 ttl=64 time=0.087 ms

  --- ::1 ping statistics ---
  1 packets transmitted, 1 received, 0% packet loss, time 0ms
  rtt min/avg/max/mdev = 0.087/0.087/0.087/0.000 ms
       0.000 probe_libc:inet_pton:(7fbf9a041350))
                                         __inet_pton (inlined)
                                         gaih_inet.constprop.7 (/usr/lib64/libc-2.26.so)
                                         __GI_getaddrinfo (inlined)
                                         [0xffffaa947cb67f3f] (/usr/bin/ping)
                                         __libc_start_main (/usr/lib64/libc-2.26.so)
                                         [0xffffaa947cb68379] (/usr/bin/ping)
  #

Reported-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hendrick Brueckner <brueckner@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-afsu9eegd43ppihiuafhh9qv@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-trace.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 0362974854e9..ee85c29dbf70 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2350,7 +2350,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 		goto out_delete_evlist;
 	}
 
-	perf_evlist__config(evlist, &trace->opts, NULL);
+	perf_evlist__config(evlist, &trace->opts, &callchain_param);
 
 	signal(SIGCHLD, sig_handler);
 	signal(SIGINT, sig_handler);
@@ -3065,8 +3065,9 @@ int cmd_trace(int argc, const char **argv)
 	}
 
 #ifdef HAVE_DWARF_UNWIND_SUPPORT
-	if ((trace.min_stack || max_stack_user_set) && !callchain_param.enabled && trace.trace_syscalls)
+	if ((trace.min_stack || max_stack_user_set) && !callchain_param.enabled) {
 		record_opts__parse_callchain(&trace.opts, &callchain_param, "dwarf", false);
+	}
 #endif
 
 	if (callchain_param.enabled) {
-- 
2.14.3

  parent reply	other threads:[~2018-01-17 16:17 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17 16:11 [GIT PULL 00/32] perf/core improvements and fixes Arnaldo Carvalho de Melo
2018-01-17 16:11 ` [PATCH 01/32] perf evsel: Fix incorrect handling of type _TERM_DRV_CFG Arnaldo Carvalho de Melo
2018-01-17 16:11 ` [PATCH 02/32] perf evlist: Remove trailing semicolon Arnaldo Carvalho de Melo
2018-01-17 16:11 ` [PATCH 03/32] perf script python: Add script to profile and resolve physical mem type Arnaldo Carvalho de Melo
2018-01-17 16:11 ` [PATCH 04/32] perf trace: No need to set PERF_SAMPLE_IDENTIFIER explicitely Arnaldo Carvalho de Melo
2018-01-17 16:11 ` [PATCH 05/32] perf tools: Fix copyfile_offset update of output offset Arnaldo Carvalho de Melo
2018-01-17 16:11 ` [PATCH 06/32] perf evsel: Check if callchain is enabled before setting it up Arnaldo Carvalho de Melo
2018-01-17 16:11 ` [PATCH 07/32] perf trace: Fix setting of --call-graph/--max-stack for non-syscall events Arnaldo Carvalho de Melo
2018-01-17 16:11 ` [PATCH 08/32] tools lib traceevent: Fix bad force_token escape sequence Arnaldo Carvalho de Melo
2018-01-17 16:11 ` [PATCH 09/32] tools lib traceevent: Show value of flags that have not been parsed Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 10/32] tools lib traceevent: Print value of unknown symbolic fields Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 11/32] tools lib traceevent: Simplify pointer print logic and fix %pF Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 12/32] tools lib traceevent: Handle new pointer processing of bprint strings Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 13/32] tools lib traceevent: Show contents (in hex) of data of unrecognized type records Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 14/32] tools lib traceevent: Use asprintf when possible Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 15/32] tools lib traceevent: Add UL suffix to MISSING_EVENTS Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 16/32] tools lib traceevent: Fix missing break in FALSE case of pevent_filter_clear_trivial() Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 17/32] tools lib traceevent: Fix get_field_str() for dynamic strings Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 18/32] perf tools: Add ARM Statistical Profiling Extensions (SPE) support Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 19/32] perf callchain: Fix attr.sample_max_stack setting Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 20/32] perf unwind: Do not look just at the global callchain_param.record_mode Arnaldo Carvalho de Melo
2018-01-17 16:12 ` Arnaldo Carvalho de Melo [this message]
2018-01-17 16:12 ` [PATCH 22/32] perf trace: Allow overriding global --max-stack per event Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 23/32] perf callchains: Ask for PERF_RECORD_MMAP for data mmaps for DWARF unwinding Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 24/32] perf report: Improve error msg when no first/last sample time found Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 25/32] perf script: " Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 26/32] perf util: Improve error checking for time percent input Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 27/32] perf util: Support no index time percent slice Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 28/32] perf report: Add an indication of what time slices are used Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 29/32] perf util: Allocate time slices buffer according to number of comma Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 30/32] perf report: Remove the time slices number limitation Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 31/32] perf script: " Arnaldo Carvalho de Melo
2018-01-17 16:12 ` [PATCH 32/32] perf record: Fix failed memory allocation for get_cpuid_str Arnaldo Carvalho de Melo
2018-01-17 16:22 ` [GIT PULL 00/32] perf/core improvements and fixes Ingo Molnar

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=20180117161222.15611-22-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=brueckner@linux.vnet.ibm.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.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;
as well as URLs for NNTP newsgroup(s).