1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2020 Facebook */
4 #include <bpf/bpf_helpers.h>
5 #include <bpf/bpf_tracing.h>
7 char _license[] SEC("license") = "GPL";
10 int dump_bpf_map(struct bpf_iter__bpf_map *ctx)
12 struct seq_file *seq = ctx->meta->seq;
13 __u64 seq_num = ctx->meta->seq_num;
14 struct bpf_map *map = ctx->map;
16 if (map == (void *)0) {
17 BPF_SEQ_PRINTF(seq, " %%%%%% END %%%%%%\n");
22 BPF_SEQ_PRINTF(seq, " id refcnt usercnt locked_vm\n");
24 BPF_SEQ_PRINTF(seq, "%8u %8ld %8ld %10lu\n", map->id, map->refcnt.counter,