This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Regarding systemtap support for AArch64


On 10/02/2013 12:17 AM, Sandeepa Prabhu wrote:
> Hi all,
> 
> I have uploaded ARM64 kprobes work on Linaro public git:
> git://git.linaro.org/people/sandeepa.prabhu/linux-aarch64.git  Branch:
> kprobes_devel_v8.  Patches are published on LAKML too.  This is based
> on v8 upstream kernel (3.12-rc1) right now, and works with linaro
> boot-wrapper and fast model setup, though, not sure what it takes to
> build for fedora.
> 
> Will,
> 
> Is aarch64 fc19 port  public? I am interested in using fc on v8 fast
> model, are there instructions about how to get the packages and
> build/run them?
> 
> Thanks,
> Sandeepa

Hi Sandeepa,

I finally got a locally built aarch64 kernel with the kprobe patches
built and running on the simulator.  The SystemTap tapsets.cxx needed to be
patched to understand the aarch64 (the attached patch). With that patch the
SystemTap Beginner's guide smoke test example showed signs of life!
However, it took minutes for it to compile and run.

[wcohen@localhost systemtap]$ sudo ../install/bin/stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'
[sudo] password for wcohen: 
Pass 1: parsed user script and 92 library script(s) using 140528virt/24952res/2744shr/22868data kb, in 4740usr/160sys/5319real ms.
Pass 2: analyzed script: 1 probe(s), 1 function(s), 3 embed(s), 0 global(s) using 326804virt/106856res/3568shr/103752data kb, in 33860usr/14520sys/52942real ms.
Pass 3: translated to C into "/tmp/stap6Cbu2d/stap_3a0ef010f6cdfb2bdc3cac691a0f3c0e_1393_src.c" using 326804virt/109236res/5948shr/103752data kb, in 120usr/30sys/163real ms.
Pass 4: compiled C into "stap_3a0ef010f6cdfb2bdc3cac691a0f3c0e_1393.ko" in 117620usr/10440sys/141829real ms.
Pass 5: starting run.
read performed
Pass 5: run completed in 100usr/90sys/573real ms.
[wcohen@localhost systemtap]$ uname -a
Linux localhost 3.12.0-rc5+ #3 SMP Wed Oct 23 15:03:27 EDT 2013 aarch64 aarch64 aarch64 GNU/Linux

-Will
diff --git a/tapsets.cxx b/tapsets.cxx
index f729c1c..79ac6c5 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -2002,6 +2002,7 @@ validate_module_elf (Dwfl_Module *mod, const char *name,  base_query *q)
     case EM_S390: expect_machine = "s390"; break;
     case EM_IA_64: expect_machine = "ia64"; break;
     case EM_ARM: expect_machine = "arm*"; break;
+    case EM_AARCH64: expect_machine = "arm64"; break;
       // XXX: fill in some more of these
     default: expect_machine = "?"; break;
     }
@@ -5609,6 +5610,39 @@ struct sdt_uprobe_var_expanding_visitor: public var_expanding_visitor
       DRI ("sp", 13, SI);
       DRI ("lr", 14, SI);
       DRI ("pc", 15, SI);
+    } else if (elf_machine == EM_AARCH64) {
+      DRI ("x0", 0, DI); DRI ("w0", 0, SI);
+      DRI ("x1", 1, DI); DRI ("w1", 1, SI);
+      DRI ("x2", 2, DI); DRI ("w2", 2, SI);
+      DRI ("x3", 3, DI); DRI ("w3", 3, SI);
+      DRI ("x4", 4, DI); DRI ("w4", 4, SI);
+      DRI ("x5", 5, DI); DRI ("w5", 5, SI);
+      DRI ("x6", 6, DI); DRI ("w6", 6, SI);
+      DRI ("x7", 7, DI); DRI ("w7", 7, SI);
+      DRI ("x8", 8, DI); DRI ("w8", 8, SI);
+      DRI ("x9", 9, DI); DRI ("w9", 9, SI);
+      DRI ("x10", 10, DI); DRI ("w10", 10, SI);
+      DRI ("x11", 11, DI); DRI ("w11", 11, SI);
+      DRI ("x12", 12, DI); DRI ("w12", 12, SI);
+      DRI ("x13", 13, DI); DRI ("w13", 13, SI);
+      DRI ("x14", 14, DI); DRI ("w14", 14, SI);
+      DRI ("x15", 15, DI); DRI ("w15", 15, SI);
+      DRI ("x16", 16, DI); DRI ("w16", 16, SI);
+      DRI ("x17", 17, DI); DRI ("w17", 17, SI);
+      DRI ("x18", 18, DI); DRI ("w18", 18, SI);
+      DRI ("x19", 19, DI); DRI ("w19", 19, SI);
+      DRI ("x20", 20, DI); DRI ("w20", 20, SI);
+      DRI ("x21", 21, DI); DRI ("w21", 21, SI);
+      DRI ("x22", 22, DI); DRI ("w22", 22, SI);
+      DRI ("x23", 23, DI); DRI ("w23", 23, SI);
+      DRI ("x24", 24, DI); DRI ("w24", 24, SI);
+      DRI ("x25", 25, DI); DRI ("w25", 25, SI);
+      DRI ("x26", 26, DI); DRI ("w26", 26, SI);
+      DRI ("x27", 27, DI); DRI ("w27", 27, SI);
+      DRI ("x28", 28, DI); DRI ("w28", 28, SI);
+      DRI ("x29", 29, DI); DRI ("w29", 29, SI);
+      DRI ("x30", 30, DI); DRI ("w30", 30, SI);
+      DRI ("sp", 31, DI);
     } else if (arg_count) {
       /* permit this case; just fall back to dwarf */
     }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]