diff options
| author | Dave Airlie <airlied@redhat.com> | 2017-12-19 21:37:24 +1000 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2017-12-19 21:37:24 +1000 |
| commit | 6b7dcb536e3535444c39286333f10d06d2f44fb5 (patch) | |
| tree | 6a4c1e30e5900626e506d46b100d21a2fcd59003 /samples/bpf/bpf_load.c | |
| parent | a942b3c2cddc4378482a427845d15c78eb50f4d4 (diff) | |
| parent | 1291a0d5049dbc06baaaf66a9ff3f53db493b19b (diff) | |
| download | talos-op-linux-6b7dcb536e3535444c39286333f10d06d2f44fb5.tar.gz talos-op-linux-6b7dcb536e3535444c39286333f10d06d2f44fb5.zip | |
BackMerge tag 'v4.15-rc4' into drm-next
Linux 4.15-rc4
Daniel requested it to fix some messy conflicts.
Diffstat (limited to 'samples/bpf/bpf_load.c')
| -rw-r--r-- | samples/bpf/bpf_load.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c index 522ca9252d6c..242631aa4ea2 100644 --- a/samples/bpf/bpf_load.c +++ b/samples/bpf/bpf_load.c @@ -193,8 +193,18 @@ static int load_and_attach(const char *event, struct bpf_insn *prog, int size) return -1; } event_fd[prog_cnt - 1] = efd; - ioctl(efd, PERF_EVENT_IOC_ENABLE, 0); - ioctl(efd, PERF_EVENT_IOC_SET_BPF, fd); + err = ioctl(efd, PERF_EVENT_IOC_ENABLE, 0); + if (err < 0) { + printf("ioctl PERF_EVENT_IOC_ENABLE failed err %s\n", + strerror(errno)); + return -1; + } + err = ioctl(efd, PERF_EVENT_IOC_SET_BPF, fd); + if (err < 0) { + printf("ioctl PERF_EVENT_IOC_SET_BPF failed err %s\n", + strerror(errno)); + return -1; + } return 0; } |

