diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-21 17:58:01 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-21 17:58:01 +0300 |
| commit | 3e00ee8e994147c2dce70bc785fb6fb70f3ecd41 (patch) | |
| tree | 722485bcdb9227b15fc662fdecd580dfbb8c99c0 /internal/flags/sampling_test.go | |
| parent | 47091d7d25da2bb80ce8ad2209575e098f726075 (diff) | |
j7 add futex kind and aggregate-only defaults
Diffstat (limited to 'internal/flags/sampling_test.go')
| -rw-r--r-- | internal/flags/sampling_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/internal/flags/sampling_test.go b/internal/flags/sampling_test.go index 0966c0f..82a43ec 100644 --- a/internal/flags/sampling_test.go +++ b/internal/flags/sampling_test.go @@ -76,3 +76,29 @@ func TestCloneDeepCopiesSamplingMaps(t *testing.T) { t.Fatalf("original syscall rate mutated: got %d, want 9", got) } } + +func TestDefaultSamplingRatesIncludeFutexAggregateOnly(t *testing.T) { + cfg, err := parseForTest(t) + if err != nil { + t.Fatalf("parse returned error: %v", err) + } + for _, syscall := range []string{"futex", "futex_wait", "futex_wake", "futex_requeue", "futex_waitv"} { + rate, ok := cfg.SyscallSamplingRates[syscall] + if !ok { + t.Fatalf("expected default sampling entry for %s", syscall) + } + if rate != 0 { + t.Fatalf("%s default rate = %d, want 0 (aggregate-only)", syscall, rate) + } + } +} + +func TestParseSamplingRatesOverrideDefaultFutexRate(t *testing.T) { + cfg, err := parseForTest(t, "-syscall-sampling-syscalls", "futex=7") + if err != nil { + t.Fatalf("parse returned error: %v", err) + } + if got := cfg.SyscallSamplingRates["futex"]; got != 7 { + t.Fatalf("futex rate = %d, want 7", got) + } +} |
