qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Call Trace for QEMU functions
@ 2015-07-30 12:20 Naman patel
  2015-07-30 13:59 ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: Naman patel @ 2015-07-30 12:20 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 3144 bytes --]

Hi,

     I have compiled QEMU (2.0) for x86_64 on Fedora 22 with tracing
enabled and the tracing option I chose was dtrace. I have this script
called callTrace.stp in which I try and get the Call Trace of the function
*helper_invlpg *and later *tlb_flush.*  But I am not able to get the
function name of the caller function and the call trace depth is only
limited to 2.

*probe process("/usr/bin/qemu-system-x86_64").function("helper_invlpg") {*
*                printf("gen_helper_invlpg called \n");*
*                        print_usyms(ubacktrace())*
*}*


I run it using following command: *sudo stap -d
/usr/local/bin/qemu-system-x86_64 --ldd --vp 08 *callTrace*.stp*

Following is the ouput:
*gen_helper_invlpg called *
* 0x7faae9d7c040 : helper_invlpg+0x0/0x30 [/usr/bin/qemu-system-x86_64]*
* 0x7faac5cfcd8c : 0x7faac5cfcd8c*
*gen_helper_invlpg called *
* 0x7faae9d7c040 : helper_invlpg+0x0/0x30 [/usr/bin/qemu-system-x86_64]*
* 0x7faac5cfcd8c : 0x7faac5cfcd8c*
*gen_helper_invlpg called *
* 0x7faae9d7c040 : helper_invlpg+0x0/0x30 [/usr/bin/qemu-system-x86_64]*
* 0x7faac5cfcd8c : 0x7faac5cfcd8c*

and so on...

It does not show the function name but the address from where it was
called. Does it mean that its not possible to get backtrace for this
function???

Similarly if I probe for *tlb_flush *then I get the following output:
TLB FULSH called
 0x7faae9cf19f0 : tlb_flush+0x0/0xb0 [/usr/bin/qemu-system-x86_64]
 0x7faac6ab5722 : 0x7faac6ab5722
TLB FULSH called
 0x7faae9cf19f0 : tlb_flush+0x0/0xb0 [/usr/bin/qemu-system-x86_64]
 0x7faac6b689be : 0x7faac6b689be
TLB FULSH called
 0x7faae9cf19f0 : tlb_flush+0x0/0xb0 [/usr/bin/qemu-system-x86_64]
 0x7faac6a74998 : 0x7faac6a74998
TLB FULSH called
 0x7faae9cf19f0 : tlb_flush+0x0/0xb0 [/usr/bin/qemu-system-x86_64]
 0x7faac6b689be : 0x7faac6b689be

Here also I am not able to get full Call Trace.

If I do this similar kind of probe using stap -d /bin/ls --ldd -e 'probe
process("ls").function("xmalloc") {print_usyms(ubacktrace())}' -c "ls /"
then I do get proper call trace, Check the following output.
*0x4112f0 : xmalloc+0x0/0x20 [/usr/bin/ls]*
* 0x4114c4 : xmemdup+0x14/0x30 [/usr/bin/ls]*
* 0x40eb4a : clone_quoting_options+0x2a/0x40 [/usr/bin/ls]*
* 0x4033e2 : main+0xa52/0x2160 [/usr/bin/ls]*
* 0x7fc6be4fc790 : __libc_start_main+0xf0/0x1d0 [/usr/lib64/libc-2.21.so
<http://libc-2.21.so/>]*
* 0x404b19 : _start+0x29/0x30 [/usr/bin/ls]*
* 0x4112f0 : xmalloc+0x0/0x20 [/usr/bin/ls]*
* 0x4114c4 : xmemdup+0x14/0x30 [/usr/bin/ls]*
* 0x40eb4a : clone_quoting_options+0x2a/0x40 [/usr/bin/ls]*
* 0x403441 : main+0xab1/0x2160 [/usr/bin/ls]*
* 0x7fc6be4fc790 : __libc_start_main+0xf0/0x1d0 [/usr/lib64/libc-2.21.so
<http://libc-2.21.so/>]*
* 0x404b19 : _start+0x29/0x30 [/usr/bin/ls]*
* 0x4112f0 : xmalloc+0x0/0x20 [/usr/bin/ls]*
* 0x40378f : main+0xdff/0x2160 [/usr/bin/ls]*
* 0x7fc6be4fc790 : __libc_start_main+0xf0/0x1d0 [/usr/lib64/libc-2.21.so
<http://libc-2.21.so/>]*

Do you have any clue why this could happen? Or any alternative approach to
get the call trace?

This is my first email on the group so please pardon me if I have not
followed some customs.

Regards,
Naman

[-- Attachment #2: Type: text/html, Size: 7107 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-08-04  6:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-30 12:20 [Qemu-devel] Call Trace for QEMU functions Naman patel
2015-07-30 13:59 ` Peter Maydell
2015-07-30 15:04   ` Alex Bennée
2015-07-31  9:29     ` Naman patel
2015-07-31 10:02       ` Peter Maydell
2015-08-04  6:04         ` Naman patel

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).