summaryrefslogtreecommitdiffstats
path: root/include/linux/perf_counter.h
diff options
context:
space:
mode:
authorPeter Zijlstra2009-05-08 18:52:22 +0200
committerIngo Molnar2009-05-08 20:36:58 +0200
commit3df5edad87a998273aa5a9a8c728c05d855ad00e (patch)
treec8e8090b1fe518918ac85d92a172702e9544fa91 /include/linux/perf_counter.h
parentperf_counter: optimize perf_counter_task_tick() (diff)
downloadkernel-qcow2-linux-3df5edad87a998273aa5a9a8c728c05d855ad00e.tar.gz
kernel-qcow2-linux-3df5edad87a998273aa5a9a8c728c05d855ad00e.tar.xz
kernel-qcow2-linux-3df5edad87a998273aa5a9a8c728c05d855ad00e.zip
perf_counter: rework ioctl()s
Corey noticed that ioctl()s on grouped counters didn't work on the whole group. This extends the ioctl() interface to take a second argument that is interpreted as a flags field. We then provide PERF_IOC_FLAG_GROUP to toggle the behaviour. Having this flag gives the greatest flexibility, allowing you to individually enable/disable/reset counters in a group, or all together. [ Impact: fix group counter enable/disable semantics ] Reported-by: Corey Ashford <cjashfor@linux.vnet.ibm.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <20090508170028.837558214@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r--include/linux/perf_counter.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 00081d84169f..88f863ec2748 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -157,10 +157,14 @@ struct perf_counter_hw_event {
/*
* Ioctls that can be done on a perf counter fd:
*/
-#define PERF_COUNTER_IOC_ENABLE _IO ('$', 0)
-#define PERF_COUNTER_IOC_DISABLE _IO ('$', 1)
+#define PERF_COUNTER_IOC_ENABLE _IOW('$', 0, u32)
+#define PERF_COUNTER_IOC_DISABLE _IOW('$', 1, u32)
#define PERF_COUNTER_IOC_REFRESH _IOW('$', 2, u32)
-#define PERF_COUNTER_IOC_RESET _IO ('$', 3)
+#define PERF_COUNTER_IOC_RESET _IOW('$', 3, u32)
+
+enum perf_counter_ioc_flags {
+ PERF_IOC_FLAG_GROUP = 1U << 0,
+};
/*
* Structure of the page that can be mapped via mmap