This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
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: 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 Wielaard <mjw at redhat dot com>
- Date: Fri, 01 Nov 2013 17:06:14 -0400
- Subject: Re: Regarding systemtap support for AArch64
- Authentication-results: sourceware.org; auth=none
- References: <CA+b37P3S4adOJe+S1RWKVDEzeVLG2Oa4EFqYgeH4cU6SNmvtEQ at mail dot gmail dot com> <1380011243 dot 3958 dot 11921 dot camel at bordewijk dot wildebeest dot org> <52432F3B dot 4020503 at redhat dot com> <CA+b37P13t44vQfS3RwxkCowgqYBAHyUHCNJQtGqxmrqnt_rw6Q at mail dot gmail dot com> <5248E391 dot 3060306 at hitachi dot com> <52496A50 dot 9090904 at redhat dot com> <CA+b37P31Zz3F0SGJt_M_3T2GxCm6zn5K4b56oeoR-qMBF=wjDg at mail dot gmail dot com> <52687CDC dot 3010108 at redhat dot com> <CA+b37P3CmOtyaTF_J+XvsDd=68-Fp=87Euneg4=KEVa_rFW_PQ at mail dot gmail dot com> <526E6E8E dot 50200 at redhat dot com>
On 10/28/2013 10:02 AM, William Cohen wrote:
> Hi Sandeepa,
>
> I got the v2 versions of the kprobe patches and built and booted the new kernel. It functions and gives the same same results as the earlier version of the kprobe patches. I was looking around to see why the $return doesn't work and came across the a similar thread for the arm from a couple years ago:
>
> http://comments.gmane.org/gmane.linux.systemtap/17986
>
> elfutils still need to have some additional aarch64 support included so that systemtap can find the location of the return value.
>
> -Will
>
Hi Sandeepa,
With the helpful tips from Mark and Frank, I have a built systemtap on
aarch64 using the elfutils with aarch64 support from the elfutils git
repo. Systemtap scripts using the $return compiles but the $return
value looks wrong. For example below $return shouldn't be some huge
negative number:
$ sudo ../install/bin/stap -m return -k -v -e 'probe vfs.read.return {printf("read performed 0x%x\n", $return); exit()}'
Pass 1: parsed user script and 92 library script(s) using 140728virt/25036res/2784shr/22952data kb, in 4750usr/150sys/10805real ms.
Pass 2: analyzed script: 2 probe(s), 7 function(s), 6 embed(s), 0 global(s) using 323588virt/103604res/3676shr/100440data kb, in 40150usr/7910sys/105966real ms.
Pass 3: translated to C into "/tmp/stapmZsmxy/return_src.c" using 323588virt/105924res/5996shr/100440data kb, in 150usr/10sys/357real ms.
Pass 4: compiled C into "return.ko" in 41820usr/2890sys/100357real ms.
Pass 5: starting run.
[358010.304872] return: systemtap: 2.4/0.157, base: ffffffbffc0e8000, memory: 15data/21text/0ctx/2058net/11alloc kb, probes: 2
read performed 0xffffffc077a9a100
Pass 5: run completed in 40usr/150sys/3714real ms.
Keeping temporary directory "/tmp/stapmZsmxy"
The aarch64 call abi is described in:
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055b/IHI0055B_aapcs64.pdf
According to the call abi the simple integer value should be in
register "x0". It looks in the generated c code for the module that
it is trying to access the return value with:
{ int64_t value = fetch_register (0); STAP_RETVALUE = value; }
As a sanity check I ran a "make -s check" on the locally built aarch64
elfutils to see if there were any issues with it.
FAIL: run-elflint-self.sh
Probably should implement the print_regs() to make debugging this easier.
-Will