bpf: avoid excessive stack usage for perf_sample_data
authorDaniel Borkmann <daniel@iogearbox.net>
Sat, 10 Jun 2017 22:50:40 +0000 (00:50 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Jun 2017 23:05:45 +0000 (19:05 -0400)
commit20b9d7ac48526ce9a14106241e76e8382d126a60
tree8e5e133552c45aaf6eddf0e61c88939f2df57695
parent41e8e40458a417bbbabfbec5362b8747601e6a3a
bpf: avoid excessive stack usage for perf_sample_data

perf_sample_data consumes 386 bytes on stack, reduce excessive stack
usage and move it to per cpu buffer. It's allowed due to preemption
being disabled for tracing, xdp and tc programs, thus at all times
only one program can run on a specific CPU and programs cannot run
from interrupt. We similarly also handle bpf_pt_regs.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/trace/bpf_trace.c