Lines Matching full:sample
10 struct sample { struct
24 __type(key, struct sample); argument
38 struct sample *sample, sample_copy; in test_ringbuf_mem_map_key() local
44 sample = bpf_ringbuf_reserve(&ringbuf, sizeof(*sample), 0); in test_ringbuf_mem_map_key()
45 if (!sample) in test_ringbuf_mem_map_key()
48 sample->pid = pid; in test_ringbuf_mem_map_key()
49 bpf_get_current_comm(sample->comm, sizeof(sample->comm)); in test_ringbuf_mem_map_key()
50 sample->seq = ++seq; in test_ringbuf_mem_map_key()
51 sample->value = 42; in test_ringbuf_mem_map_key()
53 /* test using 'sample' (PTR_TO_MEM | MEM_ALLOC) as map key arg in test_ringbuf_mem_map_key()
55 lookup_val = (int *)bpf_map_lookup_elem(&hash_map, sample); in test_ringbuf_mem_map_key()
61 * when trying to do bpf_map_update_elem(&hash_map, sample, &sample->seq, BPF_ANY); in test_ringbuf_mem_map_key()
63 * Since bpf_map_lookup_elem above uses 'sample' as key, test using in test_ringbuf_mem_map_key()
64 * sample field as value below in test_ringbuf_mem_map_key()
66 __builtin_memcpy(&sample_copy, sample, sizeof(struct sample)); in test_ringbuf_mem_map_key()
67 bpf_map_update_elem(&hash_map, &sample_copy, &sample->seq, BPF_ANY); in test_ringbuf_mem_map_key()
69 bpf_ringbuf_submit(sample, 0); in test_ringbuf_mem_map_key()