From 27d879bf5b99d5d7115ca73850c3466a43e729ad Mon Sep 17 00:00:00 2001 From: Jesper Dangaard Brouer Date: Mon, 18 Sep 2023 15:44:04 +0200 Subject: [PATCH 1/2] cgroup/fanotify.go: Adjust comment about commit Wanted to demo the shorter URL https://git.kernel.org/torvalds/c/. Plus, adding desc "subject" after commit SHA like kernel commits usually does for e.g. Fixes tags. Signed-off-by: Jesper Dangaard Brouer --- cgroup/fanotify.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cgroup/fanotify.go b/cgroup/fanotify.go index 4622f736..2bf549fe 100644 --- a/cgroup/fanotify.go +++ b/cgroup/fanotify.go @@ -188,7 +188,7 @@ func (m *fanotifyMonitor) Resolve(id int) string { } // The following kernel patch is required to take advantage of this (included in v6.6-rc1): -// * https://github.com/torvalds/linux/commit/0ce7c12e88cf +// * https://git.kernel.org/torvalds/c/0ce7c12e88cf ("kernfs: attach uuid for every kernfs and report it in fsid") func attachFanotify(path string) (io.Reader, error) { fd, err := unix.FanotifyInit(unix.FAN_CLASS_NOTIF|unix.FAN_REPORT_DFID_NAME, uint(0)) if err != nil { From 5246b36893303e9933388cceffb2446f5d211245 Mon Sep 17 00:00:00 2001 From: Jesper Dangaard Brouer Date: Mon, 18 Sep 2023 17:01:44 +0200 Subject: [PATCH 2/2] benchmark: Adjust BPF hook point for getpid On my kernel __x64_sys_getpid() is not available in BTF vmlinux. The function __do_sys_getpid() is to use that instead. Tested on kernels: - 6.4.10-200.fc38.x86_64 - 6.5.0-rc5-net-next Signed-off-by: Jesper Dangaard Brouer --- benchmark/probes/benchmark.bpf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmark/probes/benchmark.bpf.h b/benchmark/probes/benchmark.bpf.h index 92e0145a..d133ff86 100644 --- a/benchmark/probes/benchmark.bpf.h +++ b/benchmark/probes/benchmark.bpf.h @@ -3,7 +3,7 @@ #include #if defined(__TARGET_ARCH_x86) -#define FENTRY_SEC() SEC("fentry/__x64_sys_getpid") +#define FENTRY_SEC() SEC("fentry/__do_sys_getpid") #elif defined(__TARGET_ARCH_arm64) #define FENTRY_SEC() SEC("fentry/__arm64_sys_getpid") #else @@ -11,7 +11,7 @@ #endif #if defined(__TARGET_ARCH_x86) -#define KPROBE_SEC() SEC("kprobe/__x64_sys_getpid") +#define KPROBE_SEC() SEC("kprobe/__do_sys_getpid") #elif defined(__TARGET_ARCH_arm64) #define KPROBE_SEC() SEC("kprobe/__arm64_sys_getpid") #else