summaryrefslogtreecommitdiffstats
path: root/kernel/perf_counter.c
diff options
context:
space:
mode:
authorThomas Gleixner2008-12-08 19:26:59 +0100
committerIngo Molnar2008-12-11 15:45:46 +0100
commiteab656ae04b9d3b83265e3db01c0d2c46b748ef7 (patch)
treea8e12bd5a2da6032234dbb20ad2c75766b96c270 /kernel/perf_counter.c
parentperf counters: protect them against CSTATE transitions (diff)
downloadkernel-qcow2-linux-eab656ae04b9d3b83265e3db01c0d2c46b748ef7.tar.gz
kernel-qcow2-linux-eab656ae04b9d3b83265e3db01c0d2c46b748ef7.tar.xz
kernel-qcow2-linux-eab656ae04b9d3b83265e3db01c0d2c46b748ef7.zip
perf counters: clean up 'raw' type API
Impact: cleanup Introduce a separate hw_event type. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r--kernel/perf_counter.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index 20508f053658..96c333a5b0fc 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -734,26 +734,27 @@ perf_counter_alloc(u32 hw_event_period, int cpu, u32 record_type)
* @pid: target pid
*/
asmlinkage int
-sys_perf_counter_open(u32 hw_event_type,
- u32 hw_event_period,
- u32 record_type,
- pid_t pid,
- int cpu)
+sys_perf_counter_open(struct perf_counter_event __user *uevent, u32 record_type,
+ pid_t pid, int cpu, int masterfd)
{
struct perf_counter_context *ctx;
+ struct perf_counter_event event;
struct perf_counter *counter;
int ret;
+ if (copy_from_user(&event, uevent, sizeof(event)) != 0)
+ return -EFAULT;
+
ctx = find_get_context(pid, cpu);
if (IS_ERR(ctx))
return PTR_ERR(ctx);
ret = -ENOMEM;
- counter = perf_counter_alloc(hw_event_period, cpu, record_type);
+ counter = perf_counter_alloc(event.hw_event_period, cpu, record_type);
if (!counter)
goto err_put_context;
- ret = hw_perf_counter_init(counter, hw_event_type);
+ ret = hw_perf_counter_init(counter, event.hw_event_type);
if (ret)
goto err_free_put_context;