Skip to contentSkip to conversation

perf: Use POLLIN instead of POLL_IN for perf poll data in flag

PATCH New Jiri Olsa 2 participants 2 messages Jan 28, 2015 – Feb 4, 2015 perf events

lore
Share & tools
lore

Jiri Olsa

author reviewer
#0 lore raw

PATCH 1/1 perf: Use POLLIN instead of POLL_IN for perf poll data in flag

Currently we flag available data (via poll syscall) on perf fd with POLL_IN macro, which is normally used for SIGIO interface.

We've been lucky, because POLLIN (0x1) is subset of POLL_IN (0x20001) and sys_poll (do_pollfd function) cut the extra bit out (0x20000).

Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
---
 kernel/events/ring_buffer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/events/ring_buffer.c +2 -1
index 146a5792b1d2..eadb95ce7aac 100644
@@ -13,12 +13,13 @@
 #include <linux/vmalloc.h>
 #include <linux/slab.h>
 #include <linux/circ_buf.h>
+#include <linux/poll.h>
 
 #include "internal.h"
 
 static void perf_output_wakeup(struct perf_output_handle *handle)
 {
-	atomic_set(&handle->rb->poll, POLL_IN);
+	atomic_set(&handle->rb->poll, POLLIN);
 
 	handle->event->pending_wakeup = 1;
 	irq_work_queue(&handle->event->pending);
Signature · 1 line
1.9.3
#1 lore raw
perf: Use POLLIN instead of POLL_IN for perf poll data in flag
Commit-ID:  7c60fc0e022858e19c66289ec65cc3effc8c0b1f
Gitweb:     http://git.kernel.org/tip/7c60fc0e022858e19c66289ec65cc3effc8c0b1f
Author:     Jiri Olsa <[email protected]>
AuthorDate: Wed, 28 Jan 2015 18:54:38 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 4 Feb 2015 08:07:13 +0100

perf: Use POLLIN instead of POLL_IN for perf poll data in flag

Currently we flag available data (via poll syscall) on perf fd with POLL_IN macro, which is normally used for SIGIO interface.

We've been lucky, because POLLIN (0x1) is subset of POLL_IN (0x20001) and sys_poll (do_pollfd function) cut the extra bit out (0x20000).

---
 kernel/events/ring_buffer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/events/ring_buffer.c +2 -1
index 146a579..eadb95c 100644
@@ -13,12 +13,13 @@
 #include <linux/vmalloc.h>
 #include <linux/slab.h>
 #include <linux/circ_buf.h>
+#include <linux/poll.h>
 
 #include "internal.h"
 
 static void perf_output_wakeup(struct perf_output_handle *handle)
 {
-	atomic_set(&handle->rb->poll, POLL_IN);
+	atomic_set(&handle->rb->poll, POLLIN);
 
 	handle->event->pending_wakeup = 1;
 	irq_work_queue(&handle->event->pending);