Re: [tip:perf/core] perf/x86: Add an MSR PMU driver

Jiri Olsa
2015-08-10T11:19:40Z

On Tue, Aug 04, 2015 at 02:01:20AM -0700, tip-bot for Andy Lutomirski wrote:

SNIP

> + /* unsupported modes and filters */
> + if (event->attr.exclude_user ||
> + event->attr.exclude_kernel ||
> + event->attr.exclude_hv ||
> + event->attr.exclude_idle ||
> + event->attr.exclude_host ||
> + event->attr.exclude_guest ||
> + event->attr.sample_period) /* no sampling */
> + return -EINVAL;
> +
> + event->hw.idx = -1;
> + event->hw.event_base = msr[cfg].msr;
> + event->hw.config = cfg;
> +
> + return 0;
> +}
> +
> +static inline u64 msr_read_counter(struct perf_event *event)
> +{
> + u64 now;
> +
> + if (event->hw.event_base)
> + rdmsrl(event->hw.event_base, now);
> + else
> + now = rdtsc();

not sure itf there's newer version, but I needed attached change
to make it compile on latest Arnaldo's tree

jirka

---
diff --git a/arch/x86/kernel/cpu/perf_event_msr.c b/arch/x86/kernel/cpu/perf_event_msr.c
index af216e9..dfa75e5 100644
--- a/arch/x86/kernel/cpu/perf_event_msr.c
+++ b/arch/x86/kernel/cpu/perf_event_msr.c
@@ -88,7 +88,7 @@ static inline u64 msr_read_counter(struct perf_event *event)
if (event->hw.event_base)
rdmsrl(event->hw.event_base, now);
else
- now = rdtsc();
+ rdtscll(now);

return now;
}