diff options
| author | Yonghong Song <[email protected]> | 2017-11-30 21:47:55 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2017-12-01 01:59:21 +0000 |
| commit | 0ec9552b43b98deb882bf48efd347be4bd7afc9f (patch) | |
| tree | a71ca8775603c52eb8c8d086f02505a3459f34b6 /net/unix/af_unix.c | |
| parent | bpf: set maximum number of attached progs to 64 for a single perf tp (diff) | |
| download | kernel-0ec9552b43b98deb882bf48efd347be4bd7afc9f.tar.gz kernel-0ec9552b43b98deb882bf48efd347be4bd7afc9f.zip | |
samples/bpf: add error checking for perf ioctl calls in bpf loader
load_bpf_file() should fail if ioctl with command
PERF_EVENT_IOC_ENABLE and PERF_EVENT_IOC_SET_BPF fails.
When they do fail, proper error messages are printed.
With this change, the below "syscall_tp" run shows that
the maximum number of bpf progs attaching to the same
perf tracepoint is indeed enforced.
$ ./syscall_tp -i 64
prog #0: map ids 4 5
...
prog #63: map ids 382 383
$ ./syscall_tp -i 65
prog #0: map ids 4 5
...
prog #64: map ids 388 389
ioctl PERF_EVENT_IOC_SET_BPF failed err Argument list too long
Signed-off-by: Yonghong Song <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
