| // SPDX-License-Identifier: GPL-2.0 |
| /* Copyright (c) 2020 Facebook */ |
| #include <bpf/bpf_helpers.h> |
| char _license[] SEC("license") = "GPL"; |
| __u32 map1_id = 0, map2_id = 0; |
| __u32 map1_accessed = 0, map2_accessed = 0; |
| __u64 map1_seqnum = 0, map2_seqnum1 = 0, map2_seqnum2 = 0; |
| static volatile const __u32 print_len; |
| static volatile const __u32 ret1; |
| int dump_bpf_map(struct bpf_iter__bpf_map *ctx) |
| struct seq_file *seq = ctx->meta->seq; |
| struct bpf_map *map = ctx->map; |
| /* only dump map1_id and map2_id */ |
| if (map->id != map1_id && map->id != map2_id) |
| seq_num = ctx->meta->seq_num; |
| if (map->id == map1_id) { |
| if (map->id == map2_id) { |
| if (map2_accessed == 0) { |
| /* fill seq_file buffer */ |
| for (i = 0; i < print_len; i++) |
| bpf_seq_write(seq, &seq_num, sizeof(seq_num)); |