diff options
| author | Alexei Starovoitov <ast@kernel.org> | 2017-12-20 18:09:41 -0800 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2017-12-20 18:09:42 -0800 |
| commit | 7466177635be4d5f2452284085b5c2cc299367fe (patch) | |
| tree | 47cca432779b910dab12ee5cc81b792f6e432a76 /include/linux | |
| parent | 7d9890ef505a8c2a778d304535e26e827d58c466 (diff) | |
| parent | 7105e828c087de970fcb5a9509db51bfe6bd7894 (diff) | |
| download | cachepc-linux-7466177635be4d5f2452284085b5c2cc299367fe.tar.gz cachepc-linux-7466177635be4d5f2452284085b5c2cc299367fe.zip | |
Merge branch 'bpftool-improvements-kallsymfix'
Daniel Borkmann says:
====================
This work adds correlation of maps and calls into the bpftool
xlated dump in order to help debugging and introspection of
loaded BPF progs. First patch makes kallsyms work on subprogs
with bpf calls, and second implements the actual correlation.
Details and example output can be found in the 2nd patch.
====================
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/filter.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index e872b4ebaa57..2b0df2703671 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -18,6 +18,7 @@ #include <linux/capability.h> #include <linux/cryptohash.h> #include <linux/set_memory.h> +#include <linux/kallsyms.h> #include <net/sch_generic.h> @@ -724,6 +725,14 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog); void bpf_jit_compile(struct bpf_prog *prog); bool bpf_helper_changes_pkt_data(void *func); +static inline bool bpf_dump_raw_ok(void) +{ + /* Reconstruction of call-sites is dependent on kallsyms, + * thus make dump the same restriction. + */ + return kallsyms_show_value() == 1; +} + struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off, const struct bpf_insn *patch, u32 len); |
