diff options
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r-- | kernel/perf_counter.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index d55a50da2347..c6c38fb7766a 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -3671,7 +3671,7 @@ static const struct pmu perf_ops_task_clock = { | |||
3671 | void perf_tpcounter_event(int event_id) | 3671 | void perf_tpcounter_event(int event_id) |
3672 | { | 3672 | { |
3673 | struct perf_sample_data data = { | 3673 | struct perf_sample_data data = { |
3674 | .regs = get_irq_regs(); | 3674 | .regs = get_irq_regs(), |
3675 | .addr = 0, | 3675 | .addr = 0, |
3676 | }; | 3676 | }; |
3677 | 3677 | ||
@@ -3687,16 +3687,12 @@ extern void ftrace_profile_disable(int); | |||
3687 | 3687 | ||
3688 | static void tp_perf_counter_destroy(struct perf_counter *counter) | 3688 | static void tp_perf_counter_destroy(struct perf_counter *counter) |
3689 | { | 3689 | { |
3690 | ftrace_profile_disable(perf_event_id(&counter->attr)); | 3690 | ftrace_profile_disable(counter->attr.config); |
3691 | } | 3691 | } |
3692 | 3692 | ||
3693 | static const struct pmu *tp_perf_counter_init(struct perf_counter *counter) | 3693 | static const struct pmu *tp_perf_counter_init(struct perf_counter *counter) |
3694 | { | 3694 | { |
3695 | int event_id = perf_event_id(&counter->attr); | 3695 | if (ftrace_profile_enable(counter->attr.config)) |
3696 | int ret; | ||
3697 | |||
3698 | ret = ftrace_profile_enable(event_id); | ||
3699 | if (ret) | ||
3700 | return NULL; | 3696 | return NULL; |
3701 | 3697 | ||
3702 | counter->destroy = tp_perf_counter_destroy; | 3698 | counter->destroy = tp_perf_counter_destroy; |