* [PATCH bpf-next] samples: bpf: Add macro SYSCALL() for aarch64
@ 2023-02-06 11:27 Rong Tao
2023-02-06 22:54 ` Andrii Nakryiko
0 siblings, 1 reply; 2+ messages in thread
From: Rong Tao @ 2023-02-06 11:27 UTC (permalink / raw)
To: ast
Cc: Rong Tao, Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
Song Liu, Yonghong Song, John Fastabend, KP Singh,
Stanislav Fomichev, Hao Luo, Jiri Olsa,
open list:BPF [GENERAL] (Safe Dynamic Programs and Tools),
open list
From: Rong Tao <rongtao@cestc.cn>
kernel arm64/kernel/sys.c macro __SYSCALL() adds a prefix __arm64_, we
should support it for aarch64. The following is the output of the bpftrace
script:
$ sudo bpftrace -l | grep sys_write
...
kprobe:__arm64_sys_write
kprobe:__arm64_sys_writev
...
Signed-off-by: Rong Tao <rongtao@cestc.cn>
---
samples/bpf/trace_common.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/samples/bpf/trace_common.h b/samples/bpf/trace_common.h
index 8cb5400aed1f..fafc699af0a3 100644
--- a/samples/bpf/trace_common.h
+++ b/samples/bpf/trace_common.h
@@ -6,6 +6,8 @@
#define SYSCALL(SYS) "__x64_" __stringify(SYS)
#elif defined(__s390x__)
#define SYSCALL(SYS) "__s390x_" __stringify(SYS)
+#elif defined(__aarch64__)
+#define SYSCALL(SYS) "__arm64_" __stringify(SYS)
#else
#define SYSCALL(SYS) __stringify(SYS)
#endif
--
2.39.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH bpf-next] samples: bpf: Add macro SYSCALL() for aarch64
2023-02-06 11:27 [PATCH bpf-next] samples: bpf: Add macro SYSCALL() for aarch64 Rong Tao
@ 2023-02-06 22:54 ` Andrii Nakryiko
0 siblings, 0 replies; 2+ messages in thread
From: Andrii Nakryiko @ 2023-02-06 22:54 UTC (permalink / raw)
To: Rong Tao
Cc: ast, Rong Tao, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
open list:BPF [GENERAL] (Safe Dynamic Programs and Tools),
open list
On Mon, Feb 6, 2023 at 3:34 AM Rong Tao <rtoax@foxmail.com> wrote:
>
> From: Rong Tao <rongtao@cestc.cn>
>
> kernel arm64/kernel/sys.c macro __SYSCALL() adds a prefix __arm64_, we
> should support it for aarch64. The following is the output of the bpftrace
> script:
>
> $ sudo bpftrace -l | grep sys_write
> ...
> kprobe:__arm64_sys_write
> kprobe:__arm64_sys_writev
> ...
>
> Signed-off-by: Rong Tao <rongtao@cestc.cn>
> ---
samples were converted to SEC("ksyscall") programs and BPF_KSYSCALL()
macro, there is not even samples/bpf/trace_common.h there. Please
check the latest bpf-next/master.
> samples/bpf/trace_common.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/samples/bpf/trace_common.h b/samples/bpf/trace_common.h
> index 8cb5400aed1f..fafc699af0a3 100644
> --- a/samples/bpf/trace_common.h
> +++ b/samples/bpf/trace_common.h
> @@ -6,6 +6,8 @@
> #define SYSCALL(SYS) "__x64_" __stringify(SYS)
> #elif defined(__s390x__)
> #define SYSCALL(SYS) "__s390x_" __stringify(SYS)
> +#elif defined(__aarch64__)
> +#define SYSCALL(SYS) "__arm64_" __stringify(SYS)
> #else
> #define SYSCALL(SYS) __stringify(SYS)
> #endif
> --
> 2.39.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-06 22:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-06 11:27 [PATCH bpf-next] samples: bpf: Add macro SYSCALL() for aarch64 Rong Tao
2023-02-06 22:54 ` Andrii Nakryiko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.