systemtap needs porting for Aarch64

Bug #1236746 reported by Fathi Boudra on 2013-10-08
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro AArch64 cross-distro work
Medium
Unassigned
systemtap (Ubuntu)
Undecided
Unassigned
Trusty
Undecided
dann frazier

Bug Description

[Impact]
systemtap is not available on arm64 in trusty. As mentioned below, having a systemtap deb isn't sufficient in itself to use systemtap - there are also kernel feature dependencies like kprobes, which have not landed yet in upstream or Ubuntu. However, those patches exist, and can be applied for debugging purposes.

[Test Case]
I rebuilt an Ubuntu 3.13 kernel with kprobes patches applied - git branch here:
  http://kernel.ubuntu.com/git/dannf/trusty-xgene.git/log/?h=kprobes

The test case I used is the included hello world. When it works:

$ stap ./testsuite/systemtap.examples/general/helloworld.stp
hello world

[Regression Risk]
My backport cherry-picks several changes back from 2.7 upstream:

> Update-autoconf-related-files-to-support-aarch64.patch
> Update-gettext-related-material.patch

These two patches refresh autoconf/gettext files to recognize arm64.
We've done this for many packages when porting them to arm64 without problem, so regression risk should be low here.

> Add-am64-support.patch
> Basic-SystemTap-support-for-aarch64.patch
> Add-basic-aarch64-support-for-kprobes.patch
> Add-basic-print_regs-support-for-aarch64.patch
> Add-tapset-arm64-aux_syscalls.stp.patch
> Add-MMPAP_SYSCALL_NO-and-other-defines-in-runtime-sy.patch
> Normalize-aarch64-to-arm64-to-match-SystemTap-s-idea.patch
> Add-backtrace-support-for-aarch64.patch
> Estimate-the-frequency-of-the-arch64-get_cycle.patch

The changes in these files are all gated by arch-specific checks. That is, they are encapsulated in #ifdef (__aarch64__) or $(uname -m) = "aarch64".
Since we haven't previously had an arm64 port, regression risk is minimal.

> Flip-condition-so-proper-default-picked-for-STAP_NOP.patch

This flips an #ifdef condition around so that the default nop instruction for unknown archs is different. It is easy to see that the nop instruction for
all previously-supported Ubuntu archs remains the same as before.

> Make-the-DDEBUG_UNWIND-output-more-tolerant-of-types.patch
This adds casting to some debugging statements to allow them to compile on arm64. The casting method is based on kernel documentation and hasn't changed again upstream in a year and 2 releases, so it seems safe.

Matthias Klose (doko) on 2013-10-15
tags: added: arm64 ftbfs
Riku Voipio (riku-voipio) wrote :
Changed in linaro-aarch64:
importance: Undecided → Medium
status: New → Fix Committed
Will Newton (will-newton) wrote :

The dpkg build works for me on Trusty arm64 after updating config.sub and config.guess (although I disabled building the docs to save disk space).

Matthias Klose (doko) wrote :

setting back to new, after talking with Mark :

<mjw> elfutils has patches and should be good enough since 0.158.
<mjw> The kernel needs some patches for kprobes, which do exist, but I don't know if they are integrated mainline yet.
<mjw> Finally systemtap need some patches and I have seen them go into git, but I know the unwinder work is still missing/partial.
<mjw> O and uprobes of course. I know patches exist for the kernel, again status of being in mainline unknown.
<mjw> Without uprobes you'll need dyninst for user space probing.

Changed in linaro-aarch64:
status: Fix Committed → New
Changed in linaro-aarch64:
status: New → In Progress
dann frazier (dannf) on 2015-09-23
Changed in systemtap (Ubuntu):
status: New → Fix Released
dann frazier (dannf) on 2015-09-23
description: updated
Changed in systemtap (Ubuntu Trusty):
status: New → In Progress
assignee: nobody → dann frazier (dannf)

Hello Fathi, or anyone else affected,

Accepted systemtap into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemtap/2.3-1ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in systemtap (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
dann frazier (dannf) wrote :

ubuntu@ms10-36-mcdivittB0:~/systemtap-2.3$ sudo stap -v ./testsuite/systemtap.examples/general/helloworld.stp
Pass 1: parsed user script and 92 library script(s) using 35208virt/25304res/2324shr/23752data kb, in 300usr/0sys/303real ms.
Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s) using 35732virt/26160res/2488shr/24276data kb, in 10usr/0sys/7real ms.
Pass 3: translated to C into "/tmp/stapcuz5Cs/stap_411a9796ebf09f1e339d2940f6feaee3_897_src.c" using 35732virt/26392res/2708shr/24276data kb, in 0usr/0sys/0real ms.
Pass 4: compiled C into "stap_411a9796ebf09f1e339d2940f6feaee3_897.ko" in 2420usr/80sys/2827real ms.
Pass 5: starting run.
hello world
Pass 5: run completed in 0usr/10sys/464real ms.
ubuntu@ms10-36-mcdivittB0:~/systemtap-2.3$

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemtap - 2.3-1ubuntu1.1

---------------
systemtap (2.3-1ubuntu1.1) trusty; urgency=medium

  * Backport arm64 support patches from upstream 2.7 (LP: #1236746).

 -- dann frazier <email address hidden> Tue, 22 Sep 2015 13:55:04 -0600

Changed in systemtap (Ubuntu Trusty):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for systemtap has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers