From: tip-bot for Ravi Bangoria <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: alexander.shishkin@linux.intel.com,
ravi.bangoria@linux.vnet.ibm.com, tglx@linutronix.de,
jolsa@redhat.com, namhyung@kernel.org, hpa@zytor.com,
mingo@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org
Subject: [tip:perf/urgent] perf trace: Fix call-graph output
Date: Mon, 5 Feb 2018 13:37:17 -0800 [thread overview]
Message-ID: <tip-3a9e9a47092e302f3c75ababebfc16e196400a93@git.kernel.org> (raw)
In-Reply-To: <20180130053053.13214-3-ravi.bangoria@linux.vnet.ibm.com>
Commit-ID: 3a9e9a47092e302f3c75ababebfc16e196400a93
Gitweb: https://git.kernel.org/tip/3a9e9a47092e302f3c75ababebfc16e196400a93
Author: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
AuthorDate: Tue, 30 Jan 2018 11:00:53 +0530
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 5 Feb 2018 13:53:45 -0300
perf trace: Fix call-graph output
Recently, Arnaldo fixed global vs event specific --max-stack usage with
commit bd3dda9ab0fb ("perf trace: Allow overriding global --max-stack
per event"). This commit is having a regression when we don't use
--max-stack at all with perf trace. Ex,
$ ./perf trace record -g ls
$ ./perf trace -i perf.data
0.076 ( 0.002 ms): ls/9109 brk(
0.196 ( 0.008 ms): ls/9109 access(filename: 0x9f998b70, mode: R
0.209 ( 0.031 ms): ls/9109 open(filename: 0x9f998978, flags: CLOEXEC
This is missing call-traces.
After patch:
$ ./perf trace -i perf.data
0.076 ( 0.002 ms): ls/9109 brk(
do_syscall_trace_leave ([kernel.kallsyms])
[0] ([unknown])
syscall_exit_work ([kernel.kallsyms])
brk (/usr/lib64/ld-2.17.so)
_dl_sysdep_start (/usr/lib64/ld-2.17.so)
_dl_start_final (/usr/lib64/ld-2.17.so)
_dl_start (/usr/lib64/ld-2.17.so)
_start (/usr/lib64/ld-2.17.so)
0.196 ( 0.008 ms): ls/9109 access(filename: 0x9f998b70, mode: R
do_syscall_trace_leave ([kernel.kallsyms])
[0] ([unknown])
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Fixes: bd3dda9ab0fb ("perf trace: Allow overriding global --max-stack per event")
Link: http://lkml.kernel.org/r/20180130053053.13214-3-ravi.bangoria@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-trace.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 17d11de..e7f1b18 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1661,9 +1661,12 @@ static int trace__resolve_callchain(struct trace *trace, struct perf_evsel *evse
struct callchain_cursor *cursor)
{
struct addr_location al;
+ int max_stack = evsel->attr.sample_max_stack ?
+ evsel->attr.sample_max_stack :
+ trace->max_stack;
if (machine__resolve(trace->host, &al, sample) < 0 ||
- thread__resolve_callchain(al.thread, cursor, evsel, sample, NULL, NULL, evsel->attr.sample_max_stack))
+ thread__resolve_callchain(al.thread, cursor, evsel, sample, NULL, NULL, max_stack))
return -1;
return 0;
next prev parent reply other threads:[~2018-02-05 21:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 5:30 [PATCH 0/2] perf trace: Two trivial fixes Ravi Bangoria
2018-01-30 5:30 ` [PATCH 1/2] perf tools: Add trace/beauty/generated/ into .gitignore Ravi Bangoria
2018-02-05 21:37 ` [tip:perf/urgent] " tip-bot for Ravi Bangoria
2018-01-30 5:30 ` [PATCH 2/2] perf trace: Fix call-graph output Ravi Bangoria
2018-02-05 21:37 ` tip-bot for Ravi Bangoria [this message]
2018-02-05 16:58 ` [PATCH 0/2] perf trace: Two trivial fixes Arnaldo Carvalho de Melo
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=tip-3a9e9a47092e302f3c75ababebfc16e196400a93@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=ravi.bangoria@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
/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