perf/x86: Add RAPL hrtimer support
perf/x86: Add RAPL hrtimer support

The RAPL PMU counters do not interrupt on overflow.
Therefore, the kernel needs to poll the counters
to avoid missing an overflow. This patch adds
the hrtimer code to do this.

The timer interval is calculated at boot time
based on the power unit used by the HW.

There is one hrtimer per-cpu to handle the case
of multiple simultaneous use across cores on
the same package + hotplug CPU.

Thanks to Maria Dimakopoulou for her contributions
to this patch especially on the math aspects.

Signed-off-by: Stephane Eranian <f199ae9781930a5b94b284ca2f471140752002a7@google.com>
Reviewed-by: Maria Dimakopoulou <28f3c2dc96ec396307e1aa62407636f933914c5f@gmail.com>
Reviewed-by: Andi Kleen <0474aee45985f5ae829f53849df476200e876990@linux.intel.com>
[ Applied 32-bit build fix. ]
Signed-off-by: Peter Zijlstra <3fddac958924aef220f202ca567388ddab3f14a8@infradead.org>
Cc: 293abb6b76d7791c0732cc517d38c4b5c734b87f@redhat.com
Cc: 2c6594f608aa3d41e98d48846a6328831f7084ad@redhat.com
Cc: 45e2ee8c8b09e76a9d512320d4eb53c0cd9925c0@intel.com
Cc: 0691a664b24b6f15b20cd5aee64b72271db08be1@alien8.de
Cc: 28f3c2dc96ec396307e1aa62407636f933914c5f@gmail.com
Link: http://lkml.kernel.org/r/1384275531-10892-5-git-send-email-f199ae9781930a5b94b284ca2f471140752002a7@google.com
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs