diff options
author | Arnaldo Carvalho de Melo <[email protected]> | 2020-12-17 14:37:24 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2020-12-17 14:37:24 -0300 |
commit | 281a94b0f2f0775a2b7825c18bccf7e4c922b7b3 (patch) | |
tree | 9c6b8a2d392a1640d84989de25e079f3758c4f1a /tools/lib/bpf/ringbuf.c | |
parent | feca8a8342d3f53e394c9fc7d985b98ec0250ce1 (diff) | |
parent | accefff5b547a9a1d959c7e76ad539bf2480e78b (diff) |
Merge remote-tracking branch 'torvalds/master' into perf/core
To pick up fixes and check what UAPI headers need to be synched.
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/lib/bpf/ringbuf.c')
-rw-r--r-- | tools/lib/bpf/ringbuf.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/lib/bpf/ringbuf.c b/tools/lib/bpf/ringbuf.c index 5c6522c89af1..8caaafe7e312 100644 --- a/tools/lib/bpf/ringbuf.c +++ b/tools/lib/bpf/ringbuf.c @@ -278,7 +278,13 @@ int ring_buffer__poll(struct ring_buffer *rb, int timeout_ms) err = ringbuf_process_ring(ring); if (err < 0) return err; - res += cnt; + res += err; } return cnt < 0 ? -errno : res; } + +/* Get an fd that can be used to sleep until data is available in the ring(s) */ +int ring_buffer__epoll_fd(const struct ring_buffer *rb) +{ + return rb->epoll_fd; +} |