bpf: Allow bpf_perf_event_read_value in all BPF programs
authorSong Liu <songliubraving@fb.com>
Fri, 14 Feb 2020 23:41:46 +0000 (15:41 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 18 Feb 2020 15:08:27 +0000 (16:08 +0100)
commitb80b033bedae68dae8fc703ab8a69811ce678f2e
tree58d2c30ae0127f991c0e2caf06edb38b38c97dc7
parentb182a66792feb706c62e50c31db8546ca4ff168e
bpf: Allow bpf_perf_event_read_value in all BPF programs

bpf_perf_event_read_value() is NMI safe. Enable it for all BPF programs.
This can be used in fentry/fexit to profile BPF program and individual
kernel function with hardware counters.

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200214234146.2910011-1-songliubraving@fb.com
kernel/trace/bpf_trace.c