diff options
author | Alexei Starovoitov <ast@kernel.org> | 2018-09-12 00:17:25 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-09-12 00:17:25 +0300 |
commit | 2e2a0c961a87a4dc49fd481ea0e56ed66fc11d4a (patch) | |
tree | b913be301cd2a317da5ed40d032c3716c3cf3629 /tools | |
parent | f6f3bac08ff9855d803081a353a1fafaa8845739 (diff) | |
parent | ad3338d2508cd7752accdd39881deced1ec2b8a1 (diff) | |
download | linux-2e2a0c961a87a4dc49fd481ea0e56ed66fc11d4a.tar.xz |
Merge branch 'progarray_mapinmap_dump'
Yonghong Song says:
====================
The support to dump program array and map_in_map maps
for bpffs and bpftool is added. Patch #1 added bpffs support
and Patch #2 added bpftool support. Please see
individual patches for example output.
====================
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bpf/bpftool/map.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index 9c55077ca5dd..af8ad32fa6e9 100644 --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c @@ -673,12 +673,6 @@ static int do_dump(int argc, char **argv) if (fd < 0) return -1; - if (map_is_map_of_maps(info.type) || map_is_map_of_progs(info.type)) { - p_err("Dumping maps of maps and program maps not supported"); - close(fd); - return -1; - } - key = malloc(info.key_size); value = alloc_value(&info); if (!key || !value) { @@ -732,7 +726,9 @@ static int do_dump(int argc, char **argv) } else { print_entry_plain(&info, key, value); } - } else { + num_elems++; + } else if (!map_is_map_of_maps(info.type) && + !map_is_map_of_progs(info.type)) { if (json_output) { jsonw_name(json_wtr, "key"); print_hex_data_json(key, info.key_size); @@ -749,7 +745,6 @@ static int do_dump(int argc, char **argv) } prev_key = key; - num_elems++; } if (json_output) |