From: Masami Hiramatsu <mhiramat@kernel.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Kim Phillips <kim.phillips@arm.com>,
Will Deacon <will.deacon@arm.com>, He Kuang <hekuang@huawei.com>,
Wang Nan <wangnan0@huawei.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Mark Rutland <mark.rutland@arm.com>,
<linux-kernel@vger.kernel.org>
Subject: [BUG?] perf: dwarf unwind doesn't work correctly with -static
Date: Mon, 27 Mar 2017 12:39:54 +0900 [thread overview]
Message-ID: <20170327123954.44acd4f0f32ef106e27517a4@kernel.org> (raw)
In-Reply-To: <20170324220030.9be942699250e87a5e22c53e@kernel.org>
Hello,
On Fri, 24 Mar 2017 22:00:30 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:
> On Thu, 23 Mar 2017 22:24:01 -0500
> Kim Phillips <kim.phillips@arm.com> wrote:
>
> > On Thu, 23 Feb 2017 16:50:18 +0900
> > Masami Hiramatsu <mhiramat@kernel.org> wrote:
> >
> > [sorry for the delay, I just saw this]
> >
> > > perf record -g dwarf (and perf report) doesn't show correct callchain
> > > on aarch64. Here is how to reproduce it.
> > ...
> > > # Samples: 6K of event 'cpu-clock:u'
> > > # Event count (approx.): 1623750000
> > > #
> > > # Children Self Command Shared Object Symbol
> > > # ........ ........ ....... ............. ..........................
> > > #
> > > 17.21% 17.21% main main [.] func2
> > > |
> > > ---func2
> > >
> > > 17.09% 17.09% main main [.] func1
> > > |
> > > ---func1
> > >
> > > 16.67% 16.67% main main [.] main
> > > |
> > > ---main
> > > .....
> > >
> > > So, as you can see, the call graph reported each function has been
> > > called from itself. If I report it with fp as below, perf reported
> > > correct callgraph.
> > ...
> > > I guess there is a bug in libunwind on aarch64 or we missed to pass
> > > the stack data to libunwind. (BTW, it works correctly on arm32)
> >
> > Trying to replicate this on a debian 9 ("stretch") arm64 box:
>
> I'm using debian 8 ("jessie"), but I can try debian 9 too.
I've tried debian 9 and found this issue is another reason.
> 2) Build attached program as below
> # gcc -O0 -ggdb3 -funwind-tables -o main main.c
Originally, I reported above, but that is not correct, when I cleaned
up the command line, I missed important piece -- -static.
I've tested several binaries with different gcc, and found that
- Even with linaro-gcc 6.3.1, this issue happened.
- But natively build binary with gcc-6.3 (stretch) I didn't see it.
- Building binary with -static, it happened even with native binary 6.3.
- And I saw this happened even on x86-64 with -static.
So, I think the correct subject is
"perf: dwarf unwind doesn't work correctly with -static"
Thank you,
--
Masami Hiramatsu <mhiramat@kernel.org>
prev parent reply other threads:[~2017-03-27 3:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-23 7:50 [BUG?] perf: dwarf unwind doesn't work correctly on aarch64 Masami Hiramatsu
2017-03-24 3:24 ` Kim Phillips
2017-03-24 13:00 ` Masami Hiramatsu
2017-03-27 3:39 ` Masami Hiramatsu [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=20170327123954.44acd4f0f32ef106e27517a4@kernel.org \
--to=mhiramat@kernel.org \
--cc=acme@kernel.org \
--cc=hekuang@huawei.com \
--cc=kim.phillips@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=peterz@infradead.org \
--cc=wangnan0@huawei.com \
--cc=will.deacon@arm.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
Powered by JetHome