This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [Fwd: Re: Regarding systemtap support for AArch64]
- From: William Cohen <wcohen at redhat dot com>
- To: Sandeepa Prabhu <sandeepa dot prabhu at linaro dot org>
- Cc: Petr Machata <pmachata at redhat dot com>, Mark Wielaard <mjw at redhat dot com>, Masami Hiramatsu <masami dot hiramatsu dot pt at hitachi dot com>, systemtap at sourceware dot org, Deepak Saxena <dsaxena at linaro dot org>, Krishna Dani <krishna dot mohan at linaro dot org>, Jakub Pavelek <jakub dot pavelek at linaro dot org>, Mark Salter <msalter at redhat dot com>
- Date: Fri, 08 Nov 2013 22:27:23 -0500
- Subject: Re: [Fwd: Re: Regarding systemtap support for AArch64]
- Authentication-results: sourceware.org; auth=none
- References: <1383340682 dot 3850 dot 864 dot camel at bordewijk dot wildebeest dot org> <m2habsnq4w dot fsf at redhat dot com> <5277FBF2 dot 2080108 at redhat dot com> <m2wqknmumc dot fsf at redhat dot com> <52791818 dot 9070809 at redhat dot com> <m2eh6tn9cv dot fsf at redhat dot com> <CA+b37P2xA5vDBW7rWrEfTOvrzCC+VQpjad+Ge26m6uRjG-sp2w at mail dot gmail dot com> <527BAA13 dot 4000301 at redhat dot com> <CA+b37P2Je0G_uwNnai8ZsfeYVQDofOGXis=xJUqd57HoP4d5Kw at mail dot gmail dot com>
On 11/07/2013 09:22 PM, Sandeepa Prabhu wrote:
> Yes exactly, the trampoline was replacing exception return (ERET)
> address not the function return (RET) address! (wrong manipulation of
> saved pt_regs), so was firing ret-probe at the function entry not
> return and x0 showed the function argument not the return value.
> Thanks for pointing out this, have fixed this on my devel branch.
> ~Sandeepa
>>
>> -Will
Hi Sandeepa,
The build of the devel branch kernel finally finished and I was able to boot it. The results look much better for the probe of vfs.return. Thanks for fixing this. Thanks so much for fixing the kretprobes.
$ uname -a
Linux localhost 3.12.0-rc5+ #6 SMP Thu Nov 7 21:27:15 EST 2013 aarch64 aarch64 aarch64 GNU/Linux
$ sudo ~/systemtap_write/install/bin/stap -k -e 'probe vfs.read.return {printf("$return = 0x%x\n", $return);print_regs(); exit()}'
[sudo] password for wcohen:
$return = 0xc
pc : [<ffffffc000186924>] lr : [<ffffffc00008b07c>] pstate: 40000145
sp : ffffffc05f6f7e80
x29: ffffffc05f6f7e80 x28: ffffffc05f6f4000
x27: ffffffc000835000 x26: 000000000000003f
x25: 0000000000000112 x24: 0000000000000015
x23: 0000000080000000 x22: 0000007fa256eaa8
x21: 0000000000000001 x20: 0000007fdf0520e0
x19: ffffffc05f502100 x18: 0000007fdf050c70
x17: 0000007fa256ea50 x16: ffffffc0001868e0
x15: 0000000000000004 x14: 0000007fdf054420
x13: 0000000000000001 x12: 0000000000000008
x11: 00000000106180f0 x10: 0000000000401277
x9 : 0000000000000028 x8 : 000000000000003f
x7 : 0000000000000005 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000
x3 : 0000000000000001 x2 : 00000000000000a6
x1 : ffffffc072d62800 x0 : 000000000000000c
Keeping temporary directory "/tmp/stapJO91tf"
Looking at where the pc is in the disassembled vmlinux that seems to make sense. The instruction right after the call to vfs_read:
ffffffc00018691c: f9001ba4 str x4, [x29,#48]
ffffffc000186920: 97fffe04 bl ffffffc000186130 <vfs_read>
ffffffc000186924: aa0003f4 mov x20, x0
ffffffc000186928: b7f80074 tbnz x20, #63, ffffffc000186934 <SyS\
_read+0x54>
-Will