Perf: Add event type check in hrtimer hotplug fix

The hrtimer hotplug fix was missing event_type check due to which
the check was passing both software clock and hardware cycles.

Change-Id: I1d16d0ccc6ce27963ace9d2f3e1e1eab8f8c7d18
Signed-off-by: Sheetal Sahasrabudhe <sheetals@codeaurora.org>
This commit is contained in:
Sheetal Sahasrabudhe 2014-07-21 13:53:37 -04:00
parent 6459505bac
commit 35da3bc228
2 changed files with 6 additions and 2 deletions

View File

@ -45,6 +45,7 @@ static char *descriptions =
"20 msm: perf: set filter bits for cycle counter on krait\n"
"21 Perf: Fix hrtimer operation across hotplug\n"
"22 Perf: add perf user-mode permissions\n"
"23 Perf: Add event type check in hrtimer hotplug fix\n"
;
static ssize_t desc_read(struct file *fp, char __user *buf,

View File

@ -7481,7 +7481,8 @@ static void __perf_event_stop_swclock(void *__info)
struct perf_event *event, *tmp;
list_for_each_entry_safe(event, tmp, &ctx->event_list, event_entry) {
if (event->attr.config == PERF_COUNT_SW_CPU_CLOCK)
if (event->attr.config == PERF_COUNT_SW_CPU_CLOCK &&
event->attr.type == PERF_TYPE_SOFTWARE)
cpu_clock_event_stop(event, 0);
}
}
@ -7529,7 +7530,9 @@ static void perf_event_start_swclock(int cpu)
list_for_each_entry_safe(event, tmp, &ctx->event_list,
event_entry) {
if (event->attr.config ==
PERF_COUNT_SW_CPU_CLOCK)
PERF_COUNT_SW_CPU_CLOCK &&
event->attr.type ==
PERF_TYPE_SOFTWARE)
cpu_clock_event_start(event, 0);
}
}