]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: btf: add pretty print for hash/lru_hash maps
authorYonghong Song <yhs@fb.com>
Thu, 9 Aug 2018 15:55:20 +0000 (08:55 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 10 Aug 2018 18:54:07 +0000 (20:54 +0200)
commited409b1417eb4d7ace03710378a900d7c2eb5169
treebb2bd8aa6de8cc79a8112954356e241b58dfb8b2
parent93d6ff97ae554fe2463b0e612638e2d6c2b6e1f7
bpf: btf: add pretty print for hash/lru_hash maps

Commit 4449dfbca218 ("bpf: btf: Add pretty print support to
the basic arraymap") added pretty print support to array map.
This patch adds pretty print for hash and lru_hash maps.
The following example shows the pretty-print result of
a pinned hashmap:

    struct map_value {
            int count_a;
            int count_b;
    };

    cat /sys/fs/bpf/pinned_hash_map:

    87907: {87907,87908}
    57354: {37354,57355}
    76625: {76625,76626}
    ...

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/hashtab.c