diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-20 14:37:41 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-20 14:37:41 +0300 |
| commit | 96355c79a38032ab4bd880b3b3ff4192ae709795 (patch) | |
| tree | 7a395706e3db680f6e695c8602501741eed6ad45 /internal/generate/classify_test.go | |
| parent | f063e626a28339735da583142e5af864a60c2111 (diff) | |
task 27: add KindSleep and requested sleep metric
Diffstat (limited to 'internal/generate/classify_test.go')
| -rw-r--r-- | internal/generate/classify_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/generate/classify_test.go b/internal/generate/classify_test.go index 2bc0e88..daf008a 100644 --- a/internal/generate/classify_test.go +++ b/internal/generate/classify_test.go @@ -439,6 +439,20 @@ func TestClassifyMremap(t *testing.T) { } } +func TestClassifyNanosleep(t *testing.T) { + r := classifyFromData(t, FormatNanosleep) + if r.Kind != KindSleep { + t.Errorf("nanosleep: got kind %d, want KindSleep", r.Kind) + } +} + +func TestClassifyClockNanosleep(t *testing.T) { + r := classifyFromData(t, FormatClockNanosleep) + if r.Kind != KindSleep { + t.Errorf("clock_nanosleep: got kind %d, want KindSleep", r.Kind) + } +} + func TestClassifyKillRequiresGenerationFallback(t *testing.T) { r := classifyFromData(t, FormatKill) if r.Kind != KindNone { @@ -493,6 +507,8 @@ func TestClassifySyscallPairAccepted(t *testing.T) { {"pselect6", FormatPselect6, FormatExitPselect6, KindPoll}, {"munmap", FormatMunmap, FormatExitMunmap, KindMem}, {"mremap", FormatMremap, FormatExitMremap, KindMem}, + {"nanosleep", FormatNanosleep, FormatExitNanosleep, KindSleep}, + {"clock_nanosleep", FormatClockNanosleep, FormatExitClockNanosleep, KindSleep}, {"kill", FormatKill, FormatExitKill, KindNull}, } @@ -532,6 +548,8 @@ func TestClassifySyscallPairEmitsAllFamilies(t *testing.T) { {"pselect6", FormatPselect6, FormatExitPselect6, FamilyPolling}, {"munmap", FormatMunmap, FormatExitMunmap, FamilyMemory}, {"mremap", FormatMremap, FormatExitMremap, FamilyMemory}, + {"nanosleep", FormatNanosleep, FormatExitNanosleep, FamilyTime}, + {"clock_nanosleep", FormatClockNanosleep, FormatExitClockNanosleep, FamilyTime}, {"kill", FormatKill, FormatExitKill, FamilySignals}, } |
