summaryrefslogtreecommitdiffstats
path: root/include/linux/btf.h
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2018-12-16 01:13:52 -0500
committerDaniel Borkmann <daniel@iogearbox.net>2018-12-17 19:11:59 -0500
commitffa0c1cf59596fba54546ea828305acfcc2cf55e (patch)
treeb30071761afe90e0fbc7779429d3381cb1501b53 /include/linux/btf.h
parent9d5f9f701b1891466fb3dbb1806ad97716f95cc3 (diff)
bpf: enable cgroup local storage map pretty print with kind_flag
Commit 970289fc0a83 ("bpf: add bpffs pretty print for cgroup local storage maps") added bpffs pretty print for cgroup local storage maps. The commit worked for struct without kind_flag set. This patch refactored and made pretty print also work with kind_flag set for the struct. Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux/btf.h')
-rw-r--r--include/linux/btf.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/btf.h b/include/linux/btf.h
index 58000d7e06e3..12502e25e767 100644
--- a/include/linux/btf.h
+++ b/include/linux/btf.h
@@ -7,6 +7,7 @@
7#include <linux/types.h> 7#include <linux/types.h>
8 8
9struct btf; 9struct btf;
10struct btf_member;
10struct btf_type; 11struct btf_type;
11union bpf_attr; 12union bpf_attr;
12 13
@@ -46,7 +47,9 @@ void btf_type_seq_show(const struct btf *btf, u32 type_id, void *obj,
46 struct seq_file *m); 47 struct seq_file *m);
47int btf_get_fd_by_id(u32 id); 48int btf_get_fd_by_id(u32 id);
48u32 btf_id(const struct btf *btf); 49u32 btf_id(const struct btf *btf);
49bool btf_type_is_reg_int(const struct btf_type *t, u32 expected_size); 50bool btf_member_is_reg_int(const struct btf *btf, const struct btf_type *s,
51 const struct btf_member *m,
52 u32 expected_offset, u32 expected_size);
50 53
51#ifdef CONFIG_BPF_SYSCALL 54#ifdef CONFIG_BPF_SYSCALL
52const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id); 55const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id);