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