]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - kernel/perf_counter.c
Merge branch 'perfcounters/urgent' into perfcounters/core
[linux-2.6.git] / kernel / perf_counter.c
index 53abcbefa0bf64e6c0d7abea64174b59595345db..d988dfb4bbab96d4366cfb219bc0f4bd3fa5e358 100644 (file)
@@ -50,7 +50,7 @@ static atomic_t nr_task_counters __read_mostly;
  *  1 - disallow cpu counters to unpriv
  *  2 - disallow kernel profiling to unpriv
  */
-int sysctl_perf_counter_paranoid __read_mostly;
+int sysctl_perf_counter_paranoid __read_mostly = 1;
 
 static inline bool perf_paranoid_cpu(void)
 {
@@ -4103,6 +4103,7 @@ perf_counter_alloc(struct perf_counter_attr *attr,
        hwc->sample_period = attr->sample_period;
        if (attr->freq && attr->sample_freq)
                hwc->sample_period = 1;
+       hwc->last_period = hwc->sample_period;
 
        atomic64_set(&hwc->period_left, hwc->sample_period);