bpf: bpf_stackmap_copy depends on CONFIG_PERF_EVENTS
authorAlexei Starovoitov <ast@fb.com>
Thu, 10 Mar 2016 02:56:49 +0000 (18:56 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Mar 2016 04:26:51 +0000 (23:26 -0500)
commitb8cdc05173f05d212627b7aba7ec47fa334a79f2
tree0f22256fd7e864e2770e2b7c6f7ee494457ac11c
parent3b8377dca1fd1974d245b2a04a708fc434761c65
bpf: bpf_stackmap_copy depends on CONFIG_PERF_EVENTS

0-day bot reported build error:
kernel/built-in.o: In function `map_lookup_elem':
>> kernel/bpf/.tmp_syscall.o:(.text+0x329b3c): undefined reference to `bpf_stackmap_copy'
when CONFIG_BPF_SYSCALL is set and CONFIG_PERF_EVENTS is not.
Add weak definition to resolve it.
This code path in map_lookup_elem() is never taken
when CONFIG_PERF_EVENTS is not set.

Fixes: 557c0c6e7df8 ("bpf: convert stackmap to pre-allocation")
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/bpf/syscall.c