Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor adjustsments #276

Merged
merged 2 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions benchmark/probes/benchmark.bpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
#include <bpf/bpf_tracing.h>

#if defined(__TARGET_ARCH_x86)
#define FENTRY_SEC() SEC("fentry/__x64_sys_getpid")
#define FENTRY_SEC() SEC("fentry/__do_sys_getpid")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see both on our x86_64 running v6.1:

$ cat /proc/kallsyms | grep -E '( __x64_sys_getpid|__do_sys_getpid)$'
0000000000000000 t __do_sys_getpid
0000000000000000 T __x64_sys_getpid

On arm64 we only have one:

$ cat /proc/kallsyms | grep -E '( __arm64_sys_getpid|__do_sys_getpid)$'
0000000000000000 T __arm64_sys_getpid

Switching to __do_sys_getpid makes sense given what you say, even if it makes me sad for the lack of consistency.

#elif defined(__TARGET_ARCH_arm64)
#define FENTRY_SEC() SEC("fentry/__arm64_sys_getpid")
#else
#error Unknown target for this architecture
#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
Expand Down
2 changes: 1 addition & 1 deletion cgroup/fanotify.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down