summaryrefslogtreecommitdiff
path: root/internal/generate/classify_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-23 10:40:36 +0200
committerPaul Buetow <paul@buetow.org>2026-02-23 10:40:36 +0200
commitfaeb28d0e0e8ad6b1ec1bbd7aa4d0db1f07013e5 (patch)
tree492e0efef9bb105e4f8a834d13c78d0d049344da /internal/generate/classify_test.go
parenta1eb580aa5b80e913dc722ccf97e42c6987152e8 (diff)
Add baseline pidfd_getfd tracepoint support
Diffstat (limited to 'internal/generate/classify_test.go')
-rw-r--r--internal/generate/classify_test.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/generate/classify_test.go b/internal/generate/classify_test.go
index b223210..301d4bc 100644
--- a/internal/generate/classify_test.go
+++ b/internal/generate/classify_test.go
@@ -39,6 +39,13 @@ func TestClassifyFdWrite(t *testing.T) {
}
}
+func TestClassifyFdPidfdGetfd(t *testing.T) {
+ r := classifyFromData(t, FormatPidfdGetfd)
+ if r.Kind != KindFd {
+ t.Errorf("pidfd_getfd: got kind %d, want KindFd", r.Kind)
+ }
+}
+
func TestClassifyOpenOpenat(t *testing.T) {
r := classifyFromData(t, FormatOpenat)
if r.Kind != KindOpen {
@@ -264,7 +271,6 @@ func TestShouldIgnorePatterns(t *testing.T) {
"sys_enter_sendto", "sys_enter_sendmsg", "sys_enter_sendmmsg",
"sys_enter_socket", "sys_enter_socketpair", "sys_enter_getsockname",
"sys_enter_inotify_init", "sys_enter_inotify_add_watch",
- "sys_enter_pidfd_open", "sys_enter_pidfd_getfd",
"sys_enter_bind", "sys_enter_setns", "sys_enter_shutdown",
"sys_enter_connect", "sys_enter_fanotify_init", "sys_enter_getpeername",
}
@@ -281,6 +287,7 @@ func TestShouldNotIgnore(t *testing.T) {
"sys_enter_close", "sys_enter_rename", "sys_enter_unlink",
"sys_enter_copy_file_range",
"sys_enter_msync",
+ "sys_enter_pidfd_getfd",
"sys_exit_read", "sys_exit_openat",
}
for _, name := range noIgnore {
@@ -308,6 +315,7 @@ func TestClassifySyscallPairAccepted(t *testing.T) {
{"sync", FormatSync, FormatExitSync, KindNull},
{"msync", FormatMsync, FormatExitMsync, KindNull},
{"getcwd", FormatGetcwd, FormatExitGetcwd, KindNull},
+ {"pidfd_getfd", FormatPidfdGetfd, FormatExitPidfdGetfd, KindFd},
{"copy_file_range", FormatCopyFileRange, FormatExitCopyFileRange, KindFd},
{"syslog", FormatSyslog, FormatExitSyslog, KindNull},
{"open_by_handle_at", FormatOpenByHandleAt, FormatExitOpenByHandleAt, KindOpenByHandleAt},