Skip to contentSkip to conversation

perf: Mark software events as irqsafe

PATCH New Arnaldo Carvalho de Melo 1 participant 1 message Oct 18, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: Mark software events as irqsafe

From: Peter Zijlstra <[email protected]>

Noticed while using 'perf top' on a machine without a supported PMU on 2.6.33.7-rt29, when top falls back to using the "cpu-clock" software event.

Reproduced on other machines where the problem was masked due to the existence and use of hardware events, by explicitely asking for a software event using:

perf top -e cpu-clock

kernel/perf_event.c +1 -0
index 6dfaf5b..b9fbc17 100644
@@ -4238,6 +4238,7 @@ static void perf_swevent_start_hrtimer(struct perf_event *event)
 	struct hw_perf_event *hwc = &event->hw;
 
 	hrtimer_init(&hwc->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hwc->hrtimer.irqsafe = 1;
 	hwc->hrtimer.function = perf_swevent_hrtimer;
 	if (hwc->sample_period) {
 		u64 period;