From: Brenden Blanco Date: Mon, 9 Nov 2015 05:18:51 +0000 (-0800) Subject: Add bpf() syscall feature check and readme update X-Git-Tag: v0.1.8~84^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e3c57cefd08eb794f498ec07c2faa002dd41abad;p=platform%2Fupstream%2Fbcc.git Add bpf() syscall feature check and readme update Fixes: #283 Signed-off-by: Brenden Blanco --- diff --git a/INSTALL.md b/INSTALL.md index 103577c..4845951 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,3 +1,18 @@ +# Kernel requirements + +## Requirements + +In general, to use these features, a Linux kernel version 4.1 or newer is +required. In addition, the following flags should be set: + +- `CONFIG_BPF=y` +- `CONFIG_BPF_SYSCALL=y` +- `CONFIG_NET_CLS_BPF=m` [optional, for tc filters] +- `CONFIG_NET_ACT_BPF=m` [optional, for tc actions] +- `CONFIG_BPF_JIT=y` +- `CONFIG_HAVE_BPF_JIT=y` +- `CONFIG_BPF_EVENTS=y` [optional, for kprobes] + # Ubuntu - Binary Install a 4.3+ kernel from http://kernel.ubuntu.com/~kernel-ppa/mainline, diff --git a/src/cc/export/helpers.h b/src/cc/export/helpers.h index cbf54af..fda04c0 100644 --- a/src/cc/export/helpers.h +++ b/src/cc/export/helpers.h @@ -20,6 +20,10 @@ #include #include +#ifndef CONFIG_BPF_SYSCALL +#error "CONFIG_BPF_SYSCALL is undefined, please check your .config or ask your Linux distro to enable this feature" +#endif + /* helper macro to place programs, maps, license in * different sections in elf_bpf file. Section names * are interpreted by elf_bpf loader