File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -4917,24 +4917,26 @@ static enum hrtimer_restart perf_swevent_hrtimer(struct hrtimer *hrtimer)
4917
4917
static void perf_swevent_start_hrtimer (struct perf_event * event )
4918
4918
{
4919
4919
struct hw_perf_event * hwc = & event -> hw ;
4920
+ s64 period ;
4921
+
4922
+ if (!is_sampling_event (event ))
4923
+ return ;
4920
4924
4921
4925
hrtimer_init (& hwc -> hrtimer , CLOCK_MONOTONIC , HRTIMER_MODE_REL );
4922
4926
hwc -> hrtimer .function = perf_swevent_hrtimer ;
4923
- if (is_sampling_event (event )) {
4924
- s64 period = local64_read (& hwc -> period_left );
4925
4927
4926
- if (period ) {
4927
- if (period < 0 )
4928
- period = 10000 ;
4928
+ period = local64_read (& hwc -> period_left );
4929
+ if (period ) {
4930
+ if (period < 0 )
4931
+ period = 10000 ;
4929
4932
4930
- local64_set (& hwc -> period_left , 0 );
4931
- } else {
4932
- period = max_t (u64 , 10000 , hwc -> sample_period );
4933
- }
4934
- __hrtimer_start_range_ns (& hwc -> hrtimer ,
4933
+ local64_set (& hwc -> period_left , 0 );
4934
+ } else {
4935
+ period = max_t (u64 , 10000 , hwc -> sample_period );
4936
+ }
4937
+ __hrtimer_start_range_ns (& hwc -> hrtimer ,
4935
4938
ns_to_ktime (period ), 0 ,
4936
4939
HRTIMER_MODE_REL_PINNED , 0 );
4937
- }
4938
4940
}
4939
4941
4940
4942
static void perf_swevent_cancel_hrtimer (struct perf_event * event )
You can’t perform that action at this time.
0 commit comments