aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/bpf/disasm.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2018-03-23 11:41:28 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2018-03-23 17:38:57 +0100
commitabe0884011f1a569bc1254b70c41525b755e8037 (patch)
tree1fde4260003a96f264a8daaac78df085958af838 /kernel/bpf/disasm.h
parentintel: add SPDX identifiers to all the Intel drivers (diff)
downloadlinux-dev-abe0884011f1a569bc1254b70c41525b755e8037.tar.xz
linux-dev-abe0884011f1a569bc1254b70c41525b755e8037.zip
bpf: Remove struct bpf_verifier_env argument from print_bpf_insn
We use print_bpf_insn in user space (bpftool and soon perf), so it'd be nice to keep it generic and strip it off the kernel struct bpf_verifier_env argument. This argument can be safely removed, because its users can use the struct bpf_insn_cbs::private_data to pass it. By changing the argument type we can no longer have clean 'verbose' alias to 'bpf_verifier_log_write' in verifier.c. Instead we're adding the 'verbose' cb_print callback and removing the alias. This way we have new cb_print callback in place, and all the 'verbose(env, ...) calls in verifier.c will cleanly cast to 'verbose(void *, ...)' so no other change is needed. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'kernel/bpf/disasm.h')
-rw-r--r--kernel/bpf/disasm.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/bpf/disasm.h b/kernel/bpf/disasm.h
index 266fe8ee542b..e1324a834a24 100644
--- a/kernel/bpf/disasm.h
+++ b/kernel/bpf/disasm.h
@@ -22,14 +22,12 @@
#include <string.h>
#endif
-struct bpf_verifier_env;
-
extern const char *const bpf_alu_string[16];
extern const char *const bpf_class_string[8];
const char *func_id_name(int id);
-typedef __printf(2, 3) void (*bpf_insn_print_t)(struct bpf_verifier_env *env,
+typedef __printf(2, 3) void (*bpf_insn_print_t)(void *private_data,
const char *, ...);
typedef const char *(*bpf_insn_revmap_call_t)(void *private_data,
const struct bpf_insn *insn);
@@ -45,7 +43,6 @@ struct bpf_insn_cbs {
};
void print_bpf_insn(const struct bpf_insn_cbs *cbs,
- struct bpf_verifier_env *env,
const struct bpf_insn *insn,
bool allow_ptr_leaks);
#endif