All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/3] bpf: add bpffs pretty print for hash/lru_hash maps
@ 2018-08-09 15:55 Yonghong Song
  2018-08-09 15:55 ` [PATCH bpf-next 1/3] bpf: fix bpffs non-array map seq_show issue Yonghong Song
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Yonghong Song @ 2018-08-09 15:55 UTC (permalink / raw)
  To: ast, daniel, netdev; +Cc: kernel-team

Commit a26ca7c982cb ("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.
Without this patch set, user will get an error instead.

    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}
    ...

Patch #1 fixed a bug in bpffs map_seq_next() function so that
all elements in the hash table will be traversed.
Patch #2 implemented map_seq_show_elem() and map_check_btf()
callback functions for hash and lru hash maps.
Patch #3 enhanced tools/testing/selftests/bpf/test_btf.c to
test bpffs hash and lru hash map pretty print.

Yonghong Song (3):
  bpf: fix bpffs non-array map seq_show issue
  bpf: btf: add pretty print for hash/lru_hash maps
  tools/bpf: add bpffs pretty print btf test for hash/lru_hash maps

 kernel/bpf/hashtab.c                   | 44 +++++++++++++++++
 kernel/bpf/inode.c                     |  8 ++--
 tools/testing/selftests/bpf/test_btf.c | 87 ++++++++++++++++++++++++++++------
 3 files changed, 121 insertions(+), 18 deletions(-)

-- 
2.14.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-11  2:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-09 15:55 [PATCH bpf-next 0/3] bpf: add bpffs pretty print for hash/lru_hash maps Yonghong Song
2018-08-09 15:55 ` [PATCH bpf-next 1/3] bpf: fix bpffs non-array map seq_show issue Yonghong Song
2018-08-09 15:55 ` [PATCH bpf-next 2/3] bpf: btf: add pretty print for hash/lru_hash maps Yonghong Song
2018-08-09 15:55 ` [PATCH bpf-next 3/3] tools/bpf: add bpffs pretty print btf test " Yonghong Song
2018-08-10 23:32 ` [PATCH bpf-next 0/3] bpf: add bpffs pretty print " Daniel Borkmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.