#include <linux/bpf.h>
#include <linux/fs.h>
#include <linux/filter.h>
#include <linux/kernel.h>
#include <linux/btf_ids.h>
struct bpf_iter_seq_map_info { … };
static void *bpf_map_seq_start(struct seq_file *seq, loff_t *pos)
{ … }
static void *bpf_map_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{ … }
struct bpf_iter__bpf_map { … };
DEFINE_BPF_ITER_FUNC(bpf_map, struct bpf_iter_meta *meta, struct bpf_map *map)
static int __bpf_map_seq_show(struct seq_file *seq, void *v, bool in_stop)
{ … }
static int bpf_map_seq_show(struct seq_file *seq, void *v)
{ … }
static void bpf_map_seq_stop(struct seq_file *seq, void *v)
{ … }
static const struct seq_operations bpf_map_seq_ops = …;
BTF_ID_LIST_GLOBAL_SINGLE(btf_bpf_map_id, struct, bpf_map)
static const struct bpf_iter_seq_info bpf_map_seq_info = …;
static struct bpf_iter_reg bpf_map_reg_info = …;
static int bpf_iter_attach_map(struct bpf_prog *prog,
union bpf_iter_link_info *linfo,
struct bpf_iter_aux_info *aux)
{ … }
static void bpf_iter_detach_map(struct bpf_iter_aux_info *aux)
{ … }
void bpf_iter_map_show_fdinfo(const struct bpf_iter_aux_info *aux,
struct seq_file *seq)
{ … }
int bpf_iter_map_fill_link_info(const struct bpf_iter_aux_info *aux,
struct bpf_link_info *info)
{ … }
DEFINE_BPF_ITER_FUNC(bpf_map_elem, struct bpf_iter_meta *meta,
struct bpf_map *map, void *key, void *value)
static const struct bpf_iter_reg bpf_map_elem_reg_info = …;
static int __init bpf_map_iter_init(void)
{ … }
late_initcall(bpf_map_iter_init);
__bpf_kfunc_start_defs();
__bpf_kfunc s64 bpf_map_sum_elem_count(const struct bpf_map *map)
{ … }
__bpf_kfunc_end_defs();
BTF_KFUNCS_START(bpf_map_iter_kfunc_ids)
BTF_ID_FLAGS(…)
BTF_KFUNCS_END(…)
static const struct btf_kfunc_id_set bpf_map_iter_kfunc_set = …;
static int init_subsystem(void)
{ … }
late_initcall(init_subsystem);