diff options
-rw-r--r-- | kernel/perf_event.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 251fb9552492..53dc2a362111 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -5002,8 +5002,15 @@ inherit_event(struct perf_event *parent_event, | |||
5002 | else | 5002 | else |
5003 | child_event->state = PERF_EVENT_STATE_OFF; | 5003 | child_event->state = PERF_EVENT_STATE_OFF; |
5004 | 5004 | ||
5005 | if (parent_event->attr.freq) | 5005 | if (parent_event->attr.freq) { |
5006 | child_event->hw.sample_period = parent_event->hw.sample_period; | 5006 | u64 sample_period = parent_event->hw.sample_period; |
5007 | struct hw_perf_event *hwc = &child_event->hw; | ||
5008 | |||
5009 | hwc->sample_period = sample_period; | ||
5010 | hwc->last_period = sample_period; | ||
5011 | |||
5012 | atomic64_set(&hwc->period_left, sample_period); | ||
5013 | } | ||
5007 | 5014 | ||
5008 | child_event->overflow_handler = parent_event->overflow_handler; | 5015 | child_event->overflow_handler = parent_event->overflow_handler; |
5009 | 5016 | ||