aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/cpu/perf_counter.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index 49f258537cbf..240ca5630632 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -696,10 +696,11 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
696 if (!attr->exclude_kernel) 696 if (!attr->exclude_kernel)
697 hwc->config |= ARCH_PERFMON_EVENTSEL_OS; 697 hwc->config |= ARCH_PERFMON_EVENTSEL_OS;
698 698
699 if (!hwc->sample_period) 699 if (!hwc->sample_period) {
700 hwc->sample_period = x86_pmu.max_period; 700 hwc->sample_period = x86_pmu.max_period;
701 atomic64_set(&hwc->period_left, hwc->sample_period);
702 }
701 703
702 atomic64_set(&hwc->period_left, hwc->sample_period);
703 counter->destroy = hw_perf_counter_destroy; 704 counter->destroy = hw_perf_counter_destroy;
704 705
705 /* 706 /*