Lines Matching +full:total +full:- +full:timeout
1 // SPDX-License-Identifier: GPL-2.0
46 switch (s->seq) { in process_sample()
48 CHECK(s->value != 333, "sample1_value", "exp %ld, got %ld\n", in process_sample()
49 333L, s->value); in process_sample()
52 CHECK(s->value != 777, "sample2_value", "exp %ld, got %ld\n", in process_sample()
53 777L, s->value); in process_sample()
54 return -EDONE; in process_sample()
66 skel->bss->dropped = 0; in trigger_samples()
67 skel->bss->total = 0; in trigger_samples()
68 skel->bss->discarded = 0; in trigger_samples()
71 skel->bss->value = 333; in trigger_samples()
73 skel->bss->value = 777; in trigger_samples()
79 long timeout = (long)input; in poll_thread() local
81 return (void *)(long)ring_buffer__poll(ringbuf, timeout); in poll_thread()
88 long bg_ret = -1; in test_ringbuf()
97 skel->maps.ringbuf.max_entries = page_size; in test_ringbuf()
103 rb_fd = skel->maps.ringbuf.map_fd; in test_ringbuf()
115 err = -errno; in test_ringbuf()
117 ASSERT_EQ(err, -EPERM, "wr_prod_pos_err"); in test_ringbuf()
121 err = -errno; in test_ringbuf()
123 ASSERT_EQ(err, -EPERM, "wr_data_page_one_err"); in test_ringbuf()
129 /* good read-only pages */ in test_ringbuf()
139 /* good read-only pages with initial offset */ in test_ringbuf()
150 skel->bss->pid = getpid(); in test_ringbuf()
152 ringbuf = ring_buffer__new(skel->maps.ringbuf.map_fd, in test_ringbuf()
164 CHECK(skel->bss->avail_data != 3 * rec_sz, in test_ringbuf()
166 3L * rec_sz, skel->bss->avail_data); in test_ringbuf()
167 CHECK(skel->bss->ring_size != page_size, in test_ringbuf()
169 (long)page_size, skel->bss->ring_size); in test_ringbuf()
170 CHECK(skel->bss->cons_pos != 0, in test_ringbuf()
172 0L, skel->bss->cons_pos); in test_ringbuf()
173 CHECK(skel->bss->prod_pos != 3 * rec_sz, in test_ringbuf()
175 3L * rec_sz, skel->bss->prod_pos); in test_ringbuf()
178 err = ring_buffer__poll(ringbuf, -1); in test_ringbuf()
180 /* -EDONE is used as an indicator that we are done */ in test_ringbuf()
181 if (CHECK(err != -EDONE, "err_done", "done err: %d\n", err)) in test_ringbuf()
193 CHECK(skel->bss->dropped != 0, "err_dropped", "exp %ld, got %ld\n", in test_ringbuf()
194 0L, skel->bss->dropped); in test_ringbuf()
195 CHECK(skel->bss->total != 2, "err_total", "exp %ld, got %ld\n", in test_ringbuf()
196 2L, skel->bss->total); in test_ringbuf()
197 CHECK(skel->bss->discarded != 1, "err_discarded", "exp %ld, got %ld\n", in test_ringbuf()
198 1L, skel->bss->discarded); in test_ringbuf()
202 CHECK(skel->bss->cons_pos != 3 * rec_sz, in test_ringbuf()
204 3L * rec_sz, skel->bss->cons_pos); in test_ringbuf()
205 err = ring_buffer__poll(ringbuf, -1); in test_ringbuf()
210 /* start poll in background w/ long timeout */ in test_ringbuf()
216 skel->bss->flags = BPF_RB_NO_WAKEUP; in test_ringbuf()
231 CHECK(skel->bss->dropped != 0, "err_dropped", "exp %ld, got %ld\n", in test_ringbuf()
232 0L, skel->bss->dropped); in test_ringbuf()
233 CHECK(skel->bss->total != 2, "err_total", "exp %ld, got %ld\n", in test_ringbuf()
234 2L, skel->bss->total); in test_ringbuf()
235 CHECK(skel->bss->discarded != 1, "err_discarded", "exp %ld, got %ld\n", in test_ringbuf()
236 1L, skel->bss->discarded); in test_ringbuf()
241 skel->bss->flags = 0; in test_ringbuf()
257 skel->bss->dropped = 0; in test_ringbuf()
258 skel->bss->total = 0; in test_ringbuf()
259 skel->bss->discarded = 0; in test_ringbuf()
261 skel->bss->value = 333; in test_ringbuf()
264 skel->bss->flags = BPF_RB_FORCE_WAKEUP; in test_ringbuf()
265 skel->bss->value = 777; in test_ringbuf()
277 /* due to timing variations, there could still be non-notified in test_ringbuf()
288 CHECK(skel->bss->dropped != 0, "err_dropped", "exp %ld, got %ld\n", in test_ringbuf()
289 0L, skel->bss->dropped); in test_ringbuf()
290 CHECK(skel->bss->total != 2, "err_total", "exp %ld, got %ld\n", in test_ringbuf()
291 2L, skel->bss->total); in test_ringbuf()
292 CHECK(skel->bss->discarded != 1, "err_discarded", "exp %ld, got %ld\n", in test_ringbuf()
293 1L, skel->bss->discarded); in test_ringbuf()