On Fri, Dec 11, 2015 at 08:39:35PM +0800, pi3orama wrote:Sorry. I saw error because I use
wait, what kind of errors?static u64 (*bpf_ktime_get_ns)(void) =They are function numbers defined in bpf.h and bpf-common.h, but they are Linux
(void *)5;
static int (*bpf_trace_printk)(const char *fmt, int fmt_size, ...) =
(void *)6;
static int (*bpf_get_smp_processor_id)(void) =
(void *)8;
static int (*bpf_perf_event_output)(void *, struct bpf_map_def *, int,
void *, unsigned long) =
(void *)23;
Where can I get this magical mistery table? Could this be hidden away in
some .h file automagically included in bpf scriptlets so that n00bies
like me don't have to be wtf'ing?
headers. Directly include them causes many error for llvm. Also, the function
prototypes are BPF specific and can't included in Linux source. We should have
a place holds those indices and prototypes together.
they are in uapi, so gets installed into /usr/include eventually
and I haven't seen any erros either with gcc or clang.