Lines Matching full:sample
10 struct sample { struct
43 struct sample *sample; in test_ringbuf() local
48 sample = bpf_ringbuf_reserve(&ringbuf, sizeof(*sample), 0); in test_ringbuf()
49 if (!sample) { in test_ringbuf()
54 sample->pid = pid; in test_ringbuf()
55 bpf_get_current_comm(sample->comm, sizeof(sample->comm)); in test_ringbuf()
56 sample->value = value; in test_ringbuf()
58 sample->seq = seq++; in test_ringbuf()
61 if (sample->seq & 1) { in test_ringbuf()
62 /* copy from reserved sample to a new one... */ in test_ringbuf()
63 bpf_ringbuf_output(&ringbuf, sample, sizeof(*sample), flags); in test_ringbuf()
64 /* ...and then discard reserved sample */ in test_ringbuf()
65 bpf_ringbuf_discard(sample, flags); in test_ringbuf()
68 bpf_ringbuf_submit(sample, flags); in test_ringbuf()