aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/perf_counter.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-12-08 13:35:37 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-11 09:45:47 -0500
commitdfa7c899b401d7dc5d85aca416aee64ac82812f2 (patch)
tree496b0fee69989fd4127905a888de7135a7969e9e /kernel/perf_counter.c
parenteab656ae04b9d3b83265e3db01c0d2c46b748ef7 (diff)
perf counters: expand use of counter->event
Impact: change syscall, cleanup Make use of the new perf_counters 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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index 96c333a5b0fc..2557c670a3bb 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -37,7 +37,7 @@ static DEFINE_MUTEX(perf_resource_mutex);
37 * Architecture provided APIs - weak aliases: 37 * Architecture provided APIs - weak aliases:
38 */ 38 */
39 39
40int __weak hw_perf_counter_init(struct perf_counter *counter, u32 hw_event_type) 40int __weak hw_perf_counter_init(struct perf_counter *counter)
41{ 41{
42 return -EINVAL; 42 return -EINVAL;
43} 43}
@@ -707,7 +707,7 @@ static const struct file_operations perf_fops = {
707 * Allocate and initialize a counter structure 707 * Allocate and initialize a counter structure
708 */ 708 */
709static struct perf_counter * 709static struct perf_counter *
710perf_counter_alloc(u32 hw_event_period, int cpu, u32 record_type) 710perf_counter_alloc(struct perf_counter_event *event, int cpu, u32 record_type)
711{ 711{
712 struct perf_counter *counter = kzalloc(sizeof(*counter), GFP_KERNEL); 712 struct perf_counter *counter = kzalloc(sizeof(*counter), GFP_KERNEL);
713 713
@@ -722,7 +722,7 @@ perf_counter_alloc(u32 hw_event_period, int cpu, u32 record_type)
722 counter->usrdata = &counter->data[1]; 722 counter->usrdata = &counter->data[1];
723 counter->cpu = cpu; 723 counter->cpu = cpu;
724 counter->record_type = record_type; 724 counter->record_type = record_type;
725 counter->__irq_period = hw_event_period; 725 counter->event = *event;
726 counter->wakeup_pending = 0; 726 counter->wakeup_pending = 0;
727 727
728 return counter; 728 return counter;
@@ -750,11 +750,11 @@ sys_perf_counter_open(struct perf_counter_event __user *uevent, u32 record_type,
750 return PTR_ERR(ctx); 750 return PTR_ERR(ctx);
751 751
752 ret = -ENOMEM; 752 ret = -ENOMEM;
753 counter = perf_counter_alloc(event.hw_event_period, cpu, record_type); 753 counter = perf_counter_alloc(&event, cpu, record_type);
754 if (!counter) 754 if (!counter)
755 goto err_put_context; 755 goto err_put_context;
756 756
757 ret = hw_perf_counter_init(counter, event.hw_event_type); 757 ret = hw_perf_counter_init(counter);
758 if (ret) 758 if (ret)
759 goto err_free_put_context; 759 goto err_free_put_context;
760 760