Skip to contentSkip to conversation

Fix duplicate caller frame in arm64 stack traces

PATCH Superseded Andrii Nakryiko 5 participants 11 messages Nov 14 – Nov 19

Subsystems (6)
Kselftest BPF perf events arm64 +2 more subsystems

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Andrii Nakryiko

author maintainer
#0 lore raw

cover Fix duplicate caller frame in arm64 stack traces

On arm64 the caller is reported twice when the kernel builds a callchain for the current task from regs filled by perf_fetch_caller_regs(), instead of regs saved by a real exception. There was a similar problem on x86-64, but it was since fixed. Now it's time for arm64.

Patch 1 has the fix, patches 2-3 add BPF selftests for this.

I'm targeting bpf-next because of BPF selftests and to have BPF CI test everything. Patch 1 doesn't have to go through bpf-next, but it's simple enough, so if arm64 folks are ok with that, please ack and then we'll land everything in one go into bpf-next.

Andrii Nakryiko (3):
arm64: perf: Don't report the caller twice in caller-regs callchains selftests/bpf: Add stacktrace_ips test for tracepoint selftests/bpf: Run stacktrace_ips raw_tp, tp and fentry tests on arm64

 arch/arm64/include/asm/perf_event.h           |  2 +-
 .../selftests/bpf/prog_tests/stacktrace_ips.c | 67 ++++++++++++++++++-
 .../selftests/bpf/progs/stacktrace_ips.c      | 18 ++++-
 3 files changed, 81 insertions(+), 6 deletions(-)
Signature · 1 line
2.53.1-Meta
author maintainer
#1 lore raw

PATCH 1/3 arm64: perf: Don't report the caller twice in caller-regs callchains

perf_arch_fetch_caller_regs() sets regs->pc to the return address of the function it is used in (CALLER_ADDR0), but points regs->regs[29] at that function's own frame record, whose saved LR is that same return address. perf_callchain_kernel() reports regs->pc and then unwinds from the frame record at x29, so the caller shows up twice at the top of every kernel callchain built from perf_fetch_caller_regs():
tracepoint events, software events emitted by __perf_sw_event_sched() (context-switches, cgroup-switches, cpu-migrations), and bpf_get_stack() and bpf_get_stackid() in tracepoint, raw tracepoint, tp_btf and fentry/fexit programs. E.g., for a tracepoint program attached to sched_process_fork:

__traceiter_sched_process_fork+0x44
__traceiter_sched_process_fork+0x44
kernel_clone+0x250
...

Use __builtin_frame_address(1), the caller's frame record, the same way kunwind_init_from_caller() does, so that pc and x29 describe the same frame.

x86 had the same duplicate entry, fixed by commit 6d08340d1e35 ("Revert "perf/x86: Always store regs->ip in perf_callchain_kernel()"").

Fixes 5b09a094f2fb ("arm64: perf: Fix callchain parse error with kernel tracepoint events")
---
 arch/arm64/include/asm/perf_event.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/include/asm/perf_event.h +1 -1
index ee45b4e77347..13efb46f0fe8 100644
@@ -15,7 +15,7 @@
 
 #define perf_arch_fetch_caller_regs(regs, __ip) { \
 	(regs)->pc = (__ip);    \
-	(regs)->regs[29] = (unsigned long) __builtin_frame_address(0); \
+	(regs)->regs[29] = (unsigned long) __builtin_frame_address(1); \
 	(regs)->sp = current_stack_pointer; \
 	(regs)->pstate = PSR_MODE_EL1h;	\
 }
Signature · 1 line
2.53.1-Meta
#2 lore raw

Re: [PATCH bpf-next 1/3] arm64: perf: Don't report the caller twice in caller-regs callchains

Sashiko has reviewed this patch and found no issues.
Quoted 21 lines

perf_arch_fetch_caller_regs() sets regs->pc to the return address of the function it is used in (CALLER_ADDR0), but points regs->regs[29] at that function's own frame record, whose saved LR is that same return address. perf_callchain_kernel() reports regs->pc and then unwinds from the frame record at x29, so the caller shows up twice at the top of every kernel callchain built from perf_fetch_caller_regs():
tracepoint events, software events emitted by __perf_sw_event_sched() (context-switches, cgroup-switches, cpu-migrations), and bpf_get_stack() and bpf_get_stackid() in tracepoint, raw tracepoint, tp_btf and fentry/fexit programs. E.g., for a tracepoint program attached to sched_process_fork:

__traceiter_sched_process_fork+0x44
__traceiter_sched_process_fork+0x44
kernel_clone+0x250
...

Use __builtin_frame_address(1), the caller's frame record, the same way kunwind_init_from_caller() does, so that pc and x29 describe the same frame.

Quoted 5 lines

x86 had the same duplicate entry, fixed by commit 6d08340d1e35 ("Revert "perf/x86: Always store regs->ip in perf_callchain_kernel()"").

Fixes 5b09a094f2fb ("arm64: perf: Fix callchain parse error with kernel tracepoint events")

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#3 lore raw

Re: [PATCH bpf-next 1/3] arm64: perf: Don't report the caller twice in caller-regs callchains

In reply to Andrii Nakryiko
Quoted 17 lines · Andrii Nakryiko

perf_arch_fetch_caller_regs() sets regs->pc to the return address of the function it is used in (CALLER_ADDR0), but points regs->regs[29] at that function's own frame record, whose saved LR is that same return address. perf_callchain_kernel() reports regs->pc and then unwinds from the frame record at x29, so the caller shows up twice at the top of every kernel callchain built from perf_fetch_caller_regs():
tracepoint events, software events emitted by __perf_sw_event_sched() (context-switches, cgroup-switches, cpu-migrations), and bpf_get_stack() and bpf_get_stackid() in tracepoint, raw tracepoint, tp_btf and fentry/fexit programs. E.g., for a tracepoint program attached to sched_process_fork:

__traceiter_sched_process_fork+0x44
__traceiter_sched_process_fork+0x44
kernel_clone+0x250
...

Quoted 6 lines

Use __builtin_frame_address(1), the caller's frame record, the same way kunwind_init_from_caller() does, so that pc and x29 describe the same frame.

x86 had the same duplicate entry, fixed by commit 6d08340d1e35 ("Revert "perf/x86: Always store regs->ip in perf_callchain_kernel()"").

riscv has the same duplicate it seems.
Its perf_arch_fetch_caller_regs() stores __builtin_frame_address(0) in s0. walk_stackframe() reports epc, then frame->ra of that frame. Can be a follow up by riscv folks.

arch/arm64/include/asm/perf_event.h line 21

Quoted 9 lines
arch/arm64/include/asm/perf_event.h +1 -1
@@ -15,7 +15,7 @@
 
 #define perf_arch_fetch_caller_regs(regs, __ip) { \
 	(regs)->pc = (__ip);    \
-	(regs)->regs[29] = (unsigned long) __builtin_frame_address(0); \
+	(regs)->regs[29] = (unsigned long) __builtin_frame_address(1); \
 	(regs)->sp = current_stack_pointer; \
 	(regs)->pstate = PSR_MODE_EL1h;	\
 }

Will, Mark,
this looks correct to me.
Mind if I take it via bpf-next together with the selftests?

maintainer
#4 lore raw

Re: [PATCH bpf-next 1/3] arm64: perf: Don't report the caller twice in caller-regs callchains

Quoted 32 lines · Alexei Starovoitov
Quoted 17 lines · Andrii Nakryiko

perf_arch_fetch_caller_regs() sets regs->pc to the return address of the function it is used in (CALLER_ADDR0), but points regs->regs[29] at that function's own frame record, whose saved LR is that same return address. perf_callchain_kernel() reports regs->pc and then unwinds from the frame record at x29, so the caller shows up twice at the top of every kernel callchain built from perf_fetch_caller_regs():
tracepoint events, software events emitted by __perf_sw_event_sched() (context-switches, cgroup-switches, cpu-migrations), and bpf_get_stack() and bpf_get_stackid() in tracepoint, raw tracepoint, tp_btf and fentry/fexit programs. E.g., for a tracepoint program attached to sched_process_fork:

__traceiter_sched_process_fork+0x44
__traceiter_sched_process_fork+0x44
kernel_clone+0x250
...

Quoted 6 lines

Use __builtin_frame_address(1), the caller's frame record, the same way kunwind_init_from_caller() does, so that pc and x29 describe the same frame.

x86 had the same duplicate entry, fixed by commit 6d08340d1e35 ("Revert "perf/x86: Always store regs->ip in perf_callchain_kernel()"").

riscv has the same duplicate it seems.
Its perf_arch_fetch_caller_regs() stores __builtin_frame_address(0) in s0. walk_stackframe() reports epc, then frame->ra of that frame. Can be a follow up by riscv folks.

Quoted 2 lines
(quoted diff) +0 -0
@@ -15,7 +15,7 @@
 
Quoted 11 lines

arch/arm64/include/asm/perf_event.h line 21

Quoted 7 lines
arch/arm64/include/asm/perf_event.h +1 -1
 #define perf_arch_fetch_caller_regs(regs, __ip) { \
 	(regs)->pc = (__ip);    \
-	(regs)->regs[29] = (unsigned long) __builtin_frame_address(0); \
+	(regs)->regs[29] = (unsigned long) __builtin_frame_address(1); \
 	(regs)->sp = current_stack_pointer; \
 	(regs)->pstate = PSR_MODE_EL1h;	\
 }

Will, Mark,
this looks correct to me.
Mind if I take it via bpf-next together with the selftests?

Please don't pick this up, as I don't think it's quite right. I replied on the patch itself.

Will

maintainer
#5 lore raw

Re: [PATCH bpf-next 1/3] arm64: perf: Don't report the caller twice in caller-regs callchains

In reply to Andrii Nakryiko
Quoted 35 lines · Andrii Nakryiko

perf_arch_fetch_caller_regs() sets regs->pc to the return address of the function it is used in (CALLER_ADDR0), but points regs->regs[29] at that function's own frame record, whose saved LR is that same return address. perf_callchain_kernel() reports regs->pc and then unwinds from the frame record at x29, so the caller shows up twice at the top of every kernel callchain built from perf_fetch_caller_regs():
tracepoint events, software events emitted by __perf_sw_event_sched() (context-switches, cgroup-switches, cpu-migrations), and bpf_get_stack() and bpf_get_stackid() in tracepoint, raw tracepoint, tp_btf and fentry/fexit programs. E.g., for a tracepoint program attached to sched_process_fork:

__traceiter_sched_process_fork+0x44
__traceiter_sched_process_fork+0x44
kernel_clone+0x250
...

Use __builtin_frame_address(1), the caller's frame record, the same way kunwind_init_from_caller() does, so that pc and x29 describe the same frame.

x86 had the same duplicate entry, fixed by commit 6d08340d1e35 ("Revert "perf/x86: Always store regs->ip in perf_callchain_kernel()"").

Fixes 5b09a094f2fb ("arm64: perf: Fix callchain parse error with kernel tracepoint events")
---
 arch/arm64/include/asm/perf_event.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/include/asm/perf_event.h +0 -0
index ee45b4e77347..13efb46f0fe8 100644

arch/arm64/include/asm/perf_event.h line 20

Quoted 7 lines
arch/arm64/include/asm/perf_event.h +1 -1
@@ -15,7 +15,7 @@
 
 #define perf_arch_fetch_caller_regs(regs, __ip) { \
 	(regs)->pc = (__ip);    \
-	(regs)->regs[29] = (unsigned long) __builtin_frame_address(0); \
+	(regs)->regs[29] = (unsigned long) __builtin_frame_address(1); \
 	(regs)->sp = current_stack_pointer; \
 	(regs)->pstate = PSR_MODE_EL1h;	\

This doesn't look right to me. Presumably, the compiler is now going to emit the first step of the unwind, but it has no idea about the different stacks that we have, the meta frames or the invariants that the walker in arch/arm64/kernel/stacktrace.c takes care of.

So we should continue to unwind from the current frame, but then perf can discard the duplicate leaf entry if we don't want it. After all, it's perf that's passing in CALLER_ADDR0 for __ip.

Will

#6 lore raw

Re: [PATCH bpf-next 1/3] arm64: perf: Don't report the caller twice in caller-regs callchains

Quoted 50 lines · Will Deacon
Quoted 35 lines · Andrii Nakryiko

perf_arch_fetch_caller_regs() sets regs->pc to the return address of the function it is used in (CALLER_ADDR0), but points regs->regs[29] at that function's own frame record, whose saved LR is that same return address. perf_callchain_kernel() reports regs->pc and then unwinds from the frame record at x29, so the caller shows up twice at the top of every kernel callchain built from perf_fetch_caller_regs():
tracepoint events, software events emitted by __perf_sw_event_sched() (context-switches, cgroup-switches, cpu-migrations), and bpf_get_stack() and bpf_get_stackid() in tracepoint, raw tracepoint, tp_btf and fentry/fexit programs. E.g., for a tracepoint program attached to sched_process_fork:

__traceiter_sched_process_fork+0x44
__traceiter_sched_process_fork+0x44
kernel_clone+0x250
...

Use __builtin_frame_address(1), the caller's frame record, the same way kunwind_init_from_caller() does, so that pc and x29 describe the same frame.

x86 had the same duplicate entry, fixed by commit 6d08340d1e35 ("Revert "perf/x86: Always store regs->ip in perf_callchain_kernel()"").

Fixes 5b09a094f2fb ("arm64: perf: Fix callchain parse error with kernel tracepoint events")
---
 arch/arm64/include/asm/perf_event.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/include/asm/perf_event.h +0 -0
index ee45b4e77347..13efb46f0fe8 100644

arch/arm64/include/asm/perf_event.h line 20

Quoted 7 lines
arch/arm64/include/asm/perf_event.h +1 -1
@@ -15,7 +15,7 @@
 
 #define perf_arch_fetch_caller_regs(regs, __ip) { \
      (regs)->pc = (__ip);    \
-     (regs)->regs[29] = (unsigned long) __builtin_frame_address(0); \
+     (regs)->regs[29] = (unsigned long) __builtin_frame_address(1); \
      (regs)->sp = current_stack_pointer; \
      (regs)->pstate = PSR_MODE_EL1h; \

This doesn't look right to me. Presumably, the compiler is now going to emit the first step of the unwind, but it has no idea about the different stacks that we have, the meta frames or the invariants that the walker in arch/arm64/kernel/stacktrace.c takes care of.

Quoted 3 lines

So we should continue to unwind from the current frame, but then perf can discard the duplicate leaf entry if we don't want it. After all, it's perf that's passing in CALLER_ADDR0 for __ip.

Thanks for feedback! I just sent v2 which follows (conceptually) what x86-64 does, please take a look when you get a chance. I'm not sure about PSR_MODE_EL1h vs PSR_MODE_EL1t hackery, but that's what my AI suggested and it promised it's fine :)

Quoted 2 lines

Will

author maintainer
#7 lore raw

PATCH 2/3 selftests/bpf: Add stacktrace_ips test for tracepoint

In reply to Andrii Nakryiko

Add a tp subtest that checks the stack captured by bpf_get_stack() from a tracepoint program, recorded only for the test's own process. Depending on static calls and inlining, the stack may or may not have __traceiter_bpf_testmod_test_read in front of bpf_testmod_test_read, so accept both. Also check that the entry after it differs: kernels without commit 6d08340d1e35 ("Revert "perf/x86: Always store regs->ip in perf_callchain_kernel()"") report the tracepoint's caller twice.

---
 .../selftests/bpf/prog_tests/stacktrace_ips.c | 54 +++++++++++++++++++
 .../selftests/bpf/progs/stacktrace_ips.c      | 13 +++++
 2 files changed, 67 insertions(+)
tools/testing/selftests/bpf/prog_tests/stacktrace_ips.c +54 -0
index da42b00e3d1f..a03d4c10c469 100644
@@ -137,6 +137,58 @@ static void test_stacktrace_ips_raw_tp(void)
 	stacktrace_ips__destroy(skel);
 }
 
+static void test_stacktrace_ips_tp(void)
+{
+	__u64 traceiter_addr, read_addr, *ips;
+	struct stacktrace_ips *skel;
+	struct ksyms *ksyms = NULL;
+	struct ksym *ksym;
+	int i;
+
+	skel = stacktrace_ips__open_and_load();
+	if (!ASSERT_OK_PTR(skel, "stacktrace_ips__open_and_load"))
+		return;
+
+	if (!skel->kconfig->CONFIG_UNWINDER_ORC) {
+		test__skip();
+		goto cleanup;
+	}
+
+	skel->bss->my_pid = getpid();
+
+	skel->links.tp_test = bpf_program__attach(skel->progs.tp_test);
+	if (!ASSERT_OK_PTR(skel->links.tp_test, "bpf_program__attach"))
+		goto cleanup;
+
+	trigger_module_test_read(1);
+
+	ksyms = load_kallsyms_local();
+	if (!ASSERT_OK_PTR(ksyms, "load_kallsyms_local"))
+		goto cleanup;
+	traceiter_addr = ksym_get_addr_local(ksyms, "__traceiter_bpf_testmod_test_read");
+	read_addr = ksym_get_addr_local(ksyms, "bpf_testmod_test_read");
+
+	/*
+	 * Depending on static calls and inlining, __traceiter_bpf_testmod_test_read
+	 * may or may not be in front of bpf_testmod_test_read.
+	 */
+	ips = skel->bss->tp_ips;
+	ksym = ksym_search_local(ksyms, ips[0]);
+	if (!ASSERT_OK_PTR(ksym, "ksym_search_local"))
+		goto cleanup;
+	i = ksym->addr == traceiter_addr ? 1 : 0;
+
+	ksym = ksym_search_local(ksyms, ips[i]);
+	if (!ASSERT_OK_PTR(ksym, "ksym_search_local"))
+		goto cleanup;
+	ASSERT_EQ(ksym->addr, read_addr, "stack_cmp");
+	ASSERT_NEQ(ips[i], ips[i + 1], "stack_dup");
+
+cleanup:
+	free_kallsyms_local(ksyms);
+	stacktrace_ips__destroy(skel);
+}
+
 static void test_stacktrace_ips_kprobe(bool retprobe)
 {
 	LIBBPF_OPTS(bpf_kprobe_opts, opts,
@@ -238,6 +290,8 @@ static void __test_stacktrace_ips(void)
 		test_stacktrace_ips_kprobe_multi(true);
 	if (test__start_subtest("raw_tp"))
 		test_stacktrace_ips_raw_tp();
+	if (test__start_subtest("tp"))
+		test_stacktrace_ips_tp();
 	if (test__start_subtest("kprobe"))
 		test_stacktrace_ips_kprobe(false);
 	if (test__start_subtest("kretprobe"))
tools/testing/selftests/bpf/progs/stacktrace_ips.c +13 -0
index 6830f2978613..df10ef3cb14d 100644
@@ -53,6 +53,19 @@ int rawtp_test(void *ctx)
 	return 0;
 }
 
+__u64 tp_ips[128];
+int my_pid;
+
+SEC("tp/bpf_testmod/bpf_testmod_test_read")
+int tp_test(void *ctx)
+{
+	if (bpf_get_current_pid_tgid() >> 32 != my_pid)
+		return 0;
+
+	bpf_get_stack(ctx, tp_ips, sizeof(tp_ips), 0);
+	return 0;
+}
+
 SEC("fentry/bpf_testmod_stacktrace_test")
 int fentry_test(struct pt_regs *ctx)
 {
Signature · 1 line
2.53.1-Meta
#8 lore raw

Re: [PATCH bpf-next 2/3] selftests/bpf: Add stacktrace_ips test for tracepoint

Sashiko has reviewed this patch and found no issues.
Quoted 9 lines

Add a tp subtest that checks the stack captured by bpf_get_stack() from a tracepoint program, recorded only for the test's own process. Depending on static calls and inlining, the stack may or may not have __traceiter_bpf_testmod_test_read in front of bpf_testmod_test_read, so accept both. Also check that the entry after it differs: kernels without commit 6d08340d1e35 ("Revert "perf/x86: Always store regs->ip in perf_callchain_kernel()"") report the tracepoint's caller twice.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
author maintainer
#9 lore raw

PATCH 3/3 selftests/bpf: Run stacktrace_ips raw_tp, tp and fentry tests on arm64

In reply to Andrii Nakryiko

The raw_tp, tp and fentry subtests check stacks unwound from perf_fetch_caller_regs() regs, which arm64 reported with the caller twice until perf_arch_fetch_caller_regs() was fixed. Run them on arm64 as well, where kernel stacks are always unwound through frame records.

Leave the kprobe and fexit subtests x86-only: on arm64, kprobes at function entry miss the probed function's caller, and fexit stacks have an extra entry for the traced function (kretprobe subtests pass, but don't use these regs).

---
 .../selftests/bpf/prog_tests/stacktrace_ips.c     | 15 +++++++++++----
 .../testing/selftests/bpf/progs/stacktrace_ips.c  |  5 +++--
 2 files changed, 14 insertions(+), 6 deletions(-)
tools/testing/selftests/bpf/prog_tests/stacktrace_ips.c +11 -4
index a03d4c10c469..aee46543f390 100644
@@ -2,7 +2,7 @@
 #include <test_progs.h>
 #include "stacktrace_ips.skel.h"
 
-#ifdef __x86_64__
+#if defined(__x86_64__) || defined(__aarch64__)
 static int check_stacktrace_ips(int fd, __u32 key, int cnt, ...)
 {
 	__u64 ips[PERF_MAX_STACK_DEPTH];
@@ -47,6 +47,12 @@ static int check_stacktrace_ips(int fd, __u32 key, int cnt, ...)
 	return err;
 }
 
+/* arm64 always unwinds kernel stacks through frame records */
+static bool unwinder_ok(struct stacktrace_ips *skel)
+{
+	return skel->kconfig->CONFIG_UNWINDER_ORC || skel->kconfig->CONFIG_ARM64;
+}
+
 static void test_stacktrace_ips_kprobe_multi(bool retprobe)
 {
 	LIBBPF_OPTS(bpf_kprobe_multi_opts, opts,
@@ -106,7 +112,7 @@ static void test_stacktrace_ips_raw_tp(void)
 	if (!ASSERT_OK_PTR(skel, "stacktrace_ips__open_and_load"))
 		return;
 
-	if (!skel->kconfig->CONFIG_UNWINDER_ORC) {
+	if (!unwinder_ok(skel)) {
 		test__skip();
 		goto cleanup;
 	}
@@ -149,7 +155,7 @@ static void test_stacktrace_ips_tp(void)
 	if (!ASSERT_OK_PTR(skel, "stacktrace_ips__open_and_load"))
 		return;
 
-	if (!skel->kconfig->CONFIG_UNWINDER_ORC) {
+	if (!unwinder_ok(skel)) {
 		test__skip();
 		goto cleanup;
 	}
@@ -244,7 +250,8 @@ static void test_stacktrace_ips_trampoline(bool retprobe)
 	if (!ASSERT_OK_PTR(skel, "stacktrace_ips__open_and_load"))
 		return;
 
-	if (!skel->kconfig->CONFIG_UNWINDER_ORC) {
+	/* on arm64, fexit stacks also have a frame for the traced function */
+	if ((retprobe && !skel->kconfig->CONFIG_UNWINDER_ORC) || !unwinder_ok(skel)) {
 		test__skip();
 		goto cleanup;
 	}
tools/testing/selftests/bpf/progs/stacktrace_ips.c +3 -2
index df10ef3cb14d..11dfebd4ddb2 100644
@@ -19,14 +19,15 @@ struct {
 } stackmap SEC(".maps");
 
 extern bool CONFIG_UNWINDER_ORC __kconfig __weak;
+extern bool CONFIG_ARM64 __kconfig __weak;
 
 /*
- * This function is here to have CONFIG_UNWINDER_ORC
+ * This function is here to have CONFIG_UNWINDER_ORC and CONFIG_ARM64
  * used and added to object BTF.
  */
 int unused(void)
 {
-	return CONFIG_UNWINDER_ORC ? 0 : 1;
+	return CONFIG_UNWINDER_ORC || CONFIG_ARM64 ? 0 : 1;
 }
 
 __u32 stack_key;
Signature · 1 line
2.53.1-Meta
#10 lore raw

Re: [PATCH bpf-next 3/3] selftests/bpf: Run stacktrace_ips raw_tp, tp and fentry tests on arm64

Sashiko has reviewed this patch and found no issues.
Quoted 11 lines

The raw_tp, tp and fentry subtests check stacks unwound from perf_fetch_caller_regs() regs, which arm64 reported with the caller twice until perf_arch_fetch_caller_regs() was fixed. Run them on arm64 as well, where kernel stacks are always unwound through frame records.

Leave the kprobe and fexit subtests x86-only: on arm64, kprobes at function entry miss the probed function's caller, and fexit stacks have an extra entry for the traced function (kretprobe subtests pass, but don't use these regs).

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3