aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/perf_counter.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-12-08 13:26:59 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-11 09:45:46 -0500
commiteab656ae04b9d3b83265e3db01c0d2c46b748ef7 (patch)
treea8e12bd5a2da6032234dbb20ad2c75766b96c270 /kernel/perf_counter.c
parent4ac13294e44664bb7edf4daf52edb71e7c6bbe84 (diff)
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 20508f05365..96c333a5b0f 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)
734 * @pid: target pid 734 * @pid: target pid
735 */ 735 */
736asmlinkage int 736asmlinkage int
737sys_perf_counter_open(u32 hw_event_type, 737sys_perf_counter_open(struct perf_counter_event __user *uevent, u32 record_type,
738 u32 hw_event_period, 738 pid_t pid, int cpu, int masterfd)
739 u32 record_type,
740 pid_t pid,
741 int cpu)
742{ 739{
743 struct perf_counter_context *ctx; 740 struct perf_counter_context *ctx;
741 struct perf_counter_event event;
744 struct perf_counter *counter; 742 struct perf_counter *counter;
745 int ret; 743 int ret;
746 744
745 if (copy_from_user(&event, uevent, sizeof(event)) != 0)
746 return -EFAULT;
747
747 ctx = find_get_context(pid, cpu); 748 ctx = find_get_context(pid, cpu);
748 if (IS_ERR(ctx)) 749 if (IS_ERR(ctx))
749 return PTR_ERR(ctx); 750 return PTR_ERR(ctx);
750 751
751 ret = -ENOMEM; 752 ret = -ENOMEM;
752 counter = perf_counter_alloc(hw_event_period, cpu, record_type); 753 counter = perf_counter_alloc(event.hw_event_period, cpu, record_type);
753 if (!counter) 754 if (!counter)
754 goto err_put_context; 755 goto err_put_context;
755 756
756 ret = hw_perf_counter_init(counter, hw_event_type); 757 ret = hw_perf_counter_init(counter, event.hw_event_type);
757 if (ret) 758 if (ret)
758 goto err_free_put_context; 759 goto err_free_put_context;
759 760