diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-21 11:45:09 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-21 11:45:09 +0300 |
| commit | 8bd5f17ae2cd662b21fcd45a849c4b701a3aa40f (patch) | |
| tree | 338b145f35995aa5db1726f93f862a79a9de7a2a /internal/generate/classify_test.go | |
| parent | c58aa139f5e7252aefb1bcacb5fa8b9ea8cdcdef (diff) | |
g7 classify fd-from-air eventfd users
Diffstat (limited to 'internal/generate/classify_test.go')
| -rw-r--r-- | internal/generate/classify_test.go | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/internal/generate/classify_test.go b/internal/generate/classify_test.go index 4b156ff..b51877c 100644 --- a/internal/generate/classify_test.go +++ b/internal/generate/classify_test.go @@ -654,6 +654,43 @@ func TestClassifyN7NameOnlyKinds(t *testing.T) { } } +func TestClassifyG7NameOnlyKinds(t *testing.T) { + tests := []struct { + name string + want TracepointKind + }{ + {"sys_enter_epoll_create", KindEventfd}, + {"sys_exit_epoll_create", KindEventfd}, + {"sys_enter_epoll_create1", KindEventfd}, + {"sys_exit_epoll_create1", KindEventfd}, + {"sys_enter_inotify_init", KindEventfd}, + {"sys_exit_inotify_init", KindEventfd}, + {"sys_enter_inotify_init1", KindEventfd}, + {"sys_exit_inotify_init1", KindEventfd}, + {"sys_enter_fanotify_init", KindEventfd}, + {"sys_exit_fanotify_init", KindEventfd}, + {"sys_enter_landlock_create_ruleset", KindEventfd}, + {"sys_exit_landlock_create_ruleset", KindEventfd}, + {"sys_enter_fsopen", KindEventfd}, + {"sys_exit_fsopen", KindEventfd}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + r := ClassifyFormat(&Format{ + Name: tt.name, + ExternalFields: []Field{ + {Type: "long", Name: "__syscall_nr"}, + {Type: "long", Name: "arg0"}, + }, + }) + if r.Kind != tt.want { + t.Fatalf("%s: got kind %d, want %d", tt.name, r.Kind, tt.want) + } + }) + } +} + func TestClassifyMount(t *testing.T) { r := classifyFromData(t, FormatMount) if r.Kind != KindPathname { @@ -819,6 +856,13 @@ func TestClassifySyscallPairAccepted(t *testing.T) { {"pipe2", FormatPipe2, FormatExitPipe2, KindPipe}, {"eventfd", FormatEventfd, FormatExitEventfd, KindEventfd}, {"eventfd2", FormatEventfd2, FormatExitEventfd2, KindEventfd}, + {"epoll_create", syntheticEnter("epoll_create", 9340), syntheticExit("epoll_create", 9339), KindEventfd}, + {"epoll_create1", syntheticEnter("epoll_create1", 9342), syntheticExit("epoll_create1", 9341), KindEventfd}, + {"inotify_init", syntheticEnter("inotify_init", 9344), syntheticExit("inotify_init", 9343), KindEventfd}, + {"inotify_init1", syntheticEnter("inotify_init1", 9346), syntheticExit("inotify_init1", 9345), KindEventfd}, + {"fanotify_init", syntheticEnter("fanotify_init", 9348), syntheticExit("fanotify_init", 9347), KindEventfd}, + {"landlock_create_ruleset", syntheticEnter("landlock_create_ruleset", 9350), syntheticExit("landlock_create_ruleset", 9349), KindEventfd}, + {"fsopen", syntheticEnter("fsopen", 9352), syntheticExit("fsopen", 9351), KindEventfd}, {"pidfd_open", syntheticEnter("pidfd_open", 9320), syntheticExit("pidfd_open", 9319), KindPidfd}, {"pidfd_send_signal", syntheticEnter("pidfd_send_signal", 9322), syntheticExit("pidfd_send_signal", 9321), KindFd}, {"epoll_ctl", FormatEpollCtl, FormatExitEpollCtl, KindEpollCtl}, |
