diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/filter.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index d2059cb4e465..d7d25083130b 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -50,6 +50,16 @@ extern int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, uns #ifdef CONFIG_BPF_JIT extern void bpf_jit_compile(struct sk_filter *fp); extern void bpf_jit_free(struct sk_filter *fp); + +static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen, + u32 pass, void *image) +{ + pr_err("flen=%u proglen=%u pass=%u image=%p\n", + flen, proglen, pass, image); + if (image) + print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_ADDRESS, + 16, 1, image, proglen, false); +} #define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns) #else static inline void bpf_jit_compile(struct sk_filter *fp) |