summaryrefslogtreecommitdiff
path: root/integrationtests/sampling_test.go
blob: 34c1fdb5953fa3c756619583edd9884712b7785a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package integrationtests

import "testing"

func TestPerSyscallSamplingAggregateOnlySuppressesRingbufEvents(t *testing.T) {
	enableParallelIfRequested(t)
	h := newTestHarness(t)
	result, pid, err := h.RunWithIorArgs("open-basic", defaultDuration, []string{
		"-syscall-sampling-syscalls", "openat=0",
	})
	if err != nil {
		t.Fatalf("run scenario open-basic with sampling: %v", err)
	}

	AssertNoUnexpectedPID(t, result, pid)
	AssertNoUnexpectedComm(t, result, "ioworkload")
	AssertEventsAbsent(t, result, []ExpectedEvent{
		{
			Tracepoint: "enter_openat",
			Comm:       "ioworkload",
		},
	})
	AssertEventsPresent(t, result, []ExpectedEvent{
		{
			Tracepoint: "enter_close",
			Comm:       "ioworkload",
			MinCount:   1,
		},
	})
}