diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-21 08:16:08 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-21 08:16:08 +0300 |
| commit | be8735fe701f7398c19c17c394f4827614eab875 (patch) | |
| tree | aba59890563edb6e03f2eb82fee5d89b49fa2c81 /integrationtests/attach_tracepoints_test.go | |
| parent | 3a5706f21d30258577a5934efb93c400dad723db (diff) | |
p7 add attach-time trace dimension gating
Diffstat (limited to 'integrationtests/attach_tracepoints_test.go')
| -rw-r--r-- | integrationtests/attach_tracepoints_test.go | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/integrationtests/attach_tracepoints_test.go b/integrationtests/attach_tracepoints_test.go index b2392cf..2dcb28d 100644 --- a/integrationtests/attach_tracepoints_test.go +++ b/integrationtests/attach_tracepoints_test.go @@ -59,3 +59,44 @@ func TestAttachTracepointsExcludeByInclusion(t *testing.T) { }, }) } + +func TestAttachTraceFamiliesTimeOnly(t *testing.T) { + enableParallelIfRequested(t) + h := newTestHarness(t) + + result, pid, err := h.RunWithIorArgs("sleep-syscalls", defaultDuration, []string{ + "-trace-families", "Time", + }) + if err != nil { + t.Fatalf("run scenario sleep-syscalls with trace-families=Time: %v", err) + } + + AssertNoUnexpectedPID(t, result, pid) + AssertNoUnexpectedComm(t, result, "ioworkload") + AssertEventsPresent(t, result, []ExpectedEvent{ + {Tracepoint: "enter_nanosleep", Comm: "ioworkload", MinCount: 1}, + {Tracepoint: "enter_clock_nanosleep", Comm: "ioworkload", MinCount: 1}, + }) +} + +func TestAttachTraceSyscallsWithExclusion(t *testing.T) { + enableParallelIfRequested(t) + h := newTestHarness(t) + + result, pid, err := h.RunWithIorArgs("open-rdonly-write", defaultDuration, []string{ + "-trace-syscalls", "openat,write", + "-no-trace-syscalls", "openat", + }) + if err != nil { + t.Fatalf("run scenario open-rdonly-write with syscall include/exclude: %v", err) + } + + AssertNoUnexpectedPID(t, result, pid) + AssertNoUnexpectedComm(t, result, "ioworkload") + AssertEventsPresent(t, result, []ExpectedEvent{ + {Tracepoint: "enter_write", Comm: "ioworkload", MinCount: 1}, + }) + AssertEventsAbsent(t, result, []ExpectedEvent{ + {Tracepoint: "enter_openat", Comm: "ioworkload"}, + }) +} |
