|
@@ -5002,8 +5002,15 @@ inherit_event(struct perf_event *parent_event,
|
|
|
else
|
|
|
child_event->state = PERF_EVENT_STATE_OFF;
|
|
|
|
|
|
- if (parent_event->attr.freq)
|
|
|
- child_event->hw.sample_period = parent_event->hw.sample_period;
|
|
|
+ if (parent_event->attr.freq) {
|
|
|
+ u64 sample_period = parent_event->hw.sample_period;
|
|
|
+ struct hw_perf_event *hwc = &child_event->hw;
|
|
|
+
|
|
|
+ hwc->sample_period = sample_period;
|
|
|
+ hwc->last_period = sample_period;
|
|
|
+
|
|
|
+ atomic64_set(&hwc->period_left, sample_period);
|
|
|
+ }
|
|
|
|
|
|
child_event->overflow_handler = parent_event->overflow_handler;
|
|
|
|