aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/perf_counter.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r--kernel/perf_counter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index 53abcbefa0b..d988dfb4bba 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -50,7 +50,7 @@ static atomic_t nr_task_counters __read_mostly;
50 * 1 - disallow cpu counters to unpriv 50 * 1 - disallow cpu counters to unpriv
51 * 2 - disallow kernel profiling to unpriv 51 * 2 - disallow kernel profiling to unpriv
52 */ 52 */
53int sysctl_perf_counter_paranoid __read_mostly; 53int sysctl_perf_counter_paranoid __read_mostly = 1;
54 54
55static inline bool perf_paranoid_cpu(void) 55static inline bool perf_paranoid_cpu(void)
56{ 56{
@@ -4103,6 +4103,7 @@ perf_counter_alloc(struct perf_counter_attr *attr,
4103 hwc->sample_period = attr->sample_period; 4103 hwc->sample_period = attr->sample_period;
4104 if (attr->freq && attr->sample_freq) 4104 if (attr->freq && attr->sample_freq)
4105 hwc->sample_period = 1; 4105 hwc->sample_period = 1;
4106 hwc->last_period = hwc->sample_period;
4106 4107
4107 atomic64_set(&hwc->period_left, hwc->sample_period); 4108 atomic64_set(&hwc->period_left, hwc->sample_period);
4108 4109