* perf cannot see call graph, visible in gdb
@ 2013-09-05 16:48 Mark Hills
2013-09-06 19:49 ` Andi Kleen
0 siblings, 1 reply; 5+ messages in thread
From: Mark Hills @ 2013-09-05 16:48 UTC (permalink / raw)
To: linux-perf-users
I have a pre-compiled .so library, which was given to me for profiling.
gdb can see a complete call stack -- both the library and my own code, as
expected.
But in perf the callgraph for the library is not present. I'm using "perf
record -g", and the callgraph for the other code is seen.
In what cases could gdb see the stack, but perf cannot?
Many thanks
--
Mark
---
# System is Scientific Linux 6.3 (derived from RedHat 6.3)
$ uname -a
Linux star 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 20:37:17 CST 2013 x86_64 x86_64 x86_64 GNU/Linux
$ rpm -q perf
perf-2.6.32-358.el6.x86_64
$ rpm -q gdb
gdb-7.2-56.el6.x86_64
# The library which is missing the callgraph is librj.so
$ perf script -L
[...]
radford. 16009 1117798.447638: cycles:
7ff2836dd906 RjMetaDataGetStr (/mnt/scratch/radford/librj.so)
radford. 16009 1117798.471449: cycles:
7ff2837213a2 RjFile::getChar() (/mnt/scratch/radford/librj.so)
radford. 16102 1117798.707682: cycles:
ffffffffa0fa9281 rpc_task_release_client (/lib/modules/2.6.32-358.el6.x86_64/kernel/net/sunrpc/sunrpc.ko)
ffffffffa0fb1f7b rpc_release_resources_task (/lib/modules/2.6.32-358.el6.x86_64/kernel/net/sunrpc/sunrpc.ko)
ffffffffa0fb2a84 __rpc_execute (/lib/modules/2.6.32-358.el6.x86_64/kernel/net/sunrpc/sunrpc.ko)
ffffffffa0fb2cc1 rpc_execute (/lib/modules/2.6.32-358.el6.x86_64/kernel/net/sunrpc/sunrpc.ko)
ffffffffa0fa93a5 rpc_run_task (/lib/modules/2.6.32-358.el6.x86_64/kernel/net/sunrpc/sunrpc.ko)
ffffffffa0fa94c2 rpc_call_sync (/lib/modules/2.6.32-358.el6.x86_64/kernel/net/sunrpc/sunrpc.ko)
ffffffffa106af6d nfs3_rpc_wrapper.clone.0 (/lib/modules/2.6.32-358.el6.x86_64/kernel/fs/nfs/nfs.ko)
ffffffffa106b34c nfs3_proc_access (/lib/modules/2.6.32-358.el6.x86_64/kernel/fs/nfs/nfs.ko)
ffffffffa10531e9 nfs_do_access (/lib/modules/2.6.32-358.el6.x86_64/kernel/fs/nfs/nfs.ko)
ffffffffa10534b8 nfs_permission (/lib/modules/2.6.32-358.el6.x86_64/kernel/fs/nfs/nfs.ko)
ffffffff8119053d __link_path_walk ([kernel.kallsyms])
ffffffff811909ca __link_path_walk ([kernel.kallsyms])
ffffffff8119174a path_walk ([kernel.kallsyms])
ffffffff8119191b do_path_lookup ([kernel.kallsyms])
ffffffff811925a7 user_path_at ([kernel.kallsyms])
ffffffff811869bc vfs_fstatat ([kernel.kallsyms])
ffffffff81186b2b vfs_stat ([kernel.kallsyms])
ffffffff81186b54 sys_newstat ([kernel.kallsyms])
ffffffff8100b072 system_call_fastpath ([kernel.kallsyms])
320a6da735 __xstat64 (/lib64/libc-2.12.so)
7ff282d09247 Evaluate(RjNode*, RjHiderGlobals*) (/home/mark/built/rathiders.so)
7ff283701585 RjHiderEvaluate (/mnt/scratch/radford/librj.so)
7ff283701585 RjHiderEvaluate (/mnt/scratch/radford/librj.so)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: perf cannot see call graph, visible in gdb
2013-09-05 16:48 perf cannot see call graph, visible in gdb Mark Hills
@ 2013-09-06 19:49 ` Andi Kleen
2013-09-09 12:59 ` Mark Hills
0 siblings, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2013-09-06 19:49 UTC (permalink / raw)
To: Mark Hills; +Cc: linux-perf-users
Mark Hills <mark@pogo.org.uk> writes:
> I have a pre-compiled .so library, which was given to me for profiling.
>
> gdb can see a complete call stack -- both the library and my own code, as
> expected.
>
> But in perf the callgraph for the library is not present. I'm using "perf
> record -g", and the callgraph for the other code is seen.
>
> In what cases could gdb see the stack, but perf cannot?
No frame pointer.
Recompile with -fno-omit-frame-pointer
Or if you have a new enough perf, you can use -g dwarf to enable
dwarf backtracing, but it's very slow and also doesn't handle all
situations gdb handles.
-Andi
--
ak@linux.intel.com -- Speaking for myself only
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: perf cannot see call graph, visible in gdb
2013-09-06 19:49 ` Andi Kleen
@ 2013-09-09 12:59 ` Mark Hills
2013-09-09 14:05 ` David Ahern
0 siblings, 1 reply; 5+ messages in thread
From: Mark Hills @ 2013-09-09 12:59 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-perf-users
On Fri, 6 Sep 2013, Andi Kleen wrote:
> Mark Hills <mark@pogo.org.uk> writes:
>
> > I have a pre-compiled .so library, which was given to me for profiling.
> >
> > gdb can see a complete call stack -- both the library and my own code,
> > as expected.
> >
> > But in perf the callgraph for the library is not present. I'm using
> > "perf record -g", and the callgraph for the other code is seen.
> >
> > In what cases could gdb see the stack, but perf cannot?
>
> No frame pointer.
>
> Recompile with -fno-omit-frame-pointer
>
> Or if you have a new enough perf, you can use -g dwarf to enable
> dwarf backtracing, but it's very slow and also doesn't handle all
> situations gdb handles.
Thank you, much appreciated.
A newer perf appears to need a newer kernel too, and it's not practical
for me to break away from the RedHat kernel at the moment (currently on
2.6.32-358.14.1.el6)
Also I looked to cherry-pick the relevant patches, but it seems this is
non-trivial.
I'll speak to the author of the library in question but may have to
re-visit the dwarf behaviour; omit-frame-pointer may have been used with
performance in mind.
Thanks
--
Mark
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: perf cannot see call graph, visible in gdb
2013-09-09 12:59 ` Mark Hills
@ 2013-09-09 14:05 ` David Ahern
2013-09-09 14:35 ` Jiri Olsa
0 siblings, 1 reply; 5+ messages in thread
From: David Ahern @ 2013-09-09 14:05 UTC (permalink / raw)
To: Mark Hills, Jiri Olsa; +Cc: Andi Kleen, linux-perf-users
Adding Jiri.
On 9/9/13 5:59 AM, Mark Hills wrote:
> On Fri, 6 Sep 2013, Andi Kleen wrote:
>
>> Mark Hills <mark@pogo.org.uk> writes:
>>
>>> I have a pre-compiled .so library, which was given to me for profiling.
>>>
>>> gdb can see a complete call stack -- both the library and my own code,
>>> as expected.
>>>
>>> But in perf the callgraph for the library is not present. I'm using
>>> "perf record -g", and the callgraph for the other code is seen.
>>>
>>> In what cases could gdb see the stack, but perf cannot?
>>
>> No frame pointer.
>>
>> Recompile with -fno-omit-frame-pointer
>>
>> Or if you have a new enough perf, you can use -g dwarf to enable
>> dwarf backtracing, but it's very slow and also doesn't handle all
>> situations gdb handles.
>
> Thank you, much appreciated.
>
> A newer perf appears to need a newer kernel too, and it's not practical
> for me to break away from the RedHat kernel at the moment (currently on
> 2.6.32-358.14.1.el6)
Any updates to RHEL6 for dwarf callchains?
David
>
> Also I looked to cherry-pick the relevant patches, but it seems this is
> non-trivial.
>
> I'll speak to the author of the library in question but may have to
> re-visit the dwarf behaviour; omit-frame-pointer may have been used with
> performance in mind.
>
> Thanks
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: perf cannot see call graph, visible in gdb
2013-09-09 14:05 ` David Ahern
@ 2013-09-09 14:35 ` Jiri Olsa
0 siblings, 0 replies; 5+ messages in thread
From: Jiri Olsa @ 2013-09-09 14:35 UTC (permalink / raw)
To: David Ahern; +Cc: Mark Hills, Andi Kleen, linux-perf-users
On Mon, Sep 09, 2013 at 07:05:25AM -0700, David Ahern wrote:
> Adding Jiri.
>
> On 9/9/13 5:59 AM, Mark Hills wrote:
> >On Fri, 6 Sep 2013, Andi Kleen wrote:
> >
> >>Mark Hills <mark@pogo.org.uk> writes:
> >>
> >>>I have a pre-compiled .so library, which was given to me for profiling.
> >>>
> >>>gdb can see a complete call stack -- both the library and my own code,
> >>>as expected.
> >>>
> >>>But in perf the callgraph for the library is not present. I'm using
> >>>"perf record -g", and the callgraph for the other code is seen.
> >>>
> >>>In what cases could gdb see the stack, but perf cannot?
> >>
> >>No frame pointer.
> >>
> >>Recompile with -fno-omit-frame-pointer
> >>
> >>Or if you have a new enough perf, you can use -g dwarf to enable
> >>dwarf backtracing, but it's very slow and also doesn't handle all
> >>situations gdb handles.
> >
> >Thank you, much appreciated.
> >
> >A newer perf appears to need a newer kernel too, and it's not practical
> >for me to break away from the RedHat kernel at the moment (currently on
> >2.6.32-358.14.1.el6)
>
> Any updates to RHEL6 for dwarf callchains?
>
unfortunately no news in RHEL6 for this one
jirka
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-09-09 14:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-05 16:48 perf cannot see call graph, visible in gdb Mark Hills
2013-09-06 19:49 ` Andi Kleen
2013-09-09 12:59 ` Mark Hills
2013-09-09 14:05 ` David Ahern
2013-09-09 14:35 ` Jiri Olsa
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).