Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v6.9-rc4 21 lines 428 B view raw
1// SPDX-License-Identifier: GPL-2.0 2/* Copyright (c) 2020 Facebook */ 3#include "bpf_iter.h" 4#include <bpf/bpf_helpers.h> 5 6char _license[] SEC("license") = "GPL"; 7 8__u32 value_sum = 0; 9 10SEC("iter/bpf_map_elem") 11int dump_bpf_hash_map(struct bpf_iter__bpf_map_elem *ctx) 12{ 13 void *value = ctx->value; 14 15 if (value == (void *)0) 16 return 0; 17 18 /* negative offset, verifier failure. */ 19 value_sum += *(__u32 *)(value - 4); 20 return 0; 21}