From: Mathieu Desnoyers Date: Thu, 18 Aug 2016 18:21:46 +0000 (-0400) Subject: Fix: perf counters build against kernel headers < 3.12 X-Git-Tag: v2.9.0-rc1~24 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=77d7fa989f79f3c2cb14d26576cbbb54b0637594;hp=77d7fa989f79f3c2cb14d26576cbbb54b0637594;p=lttng-ust.git Fix: perf counters build against kernel headers < 3.12 Copy Linux kernel perf_event.h installed headers into lttng-ust to know the recent ABI layout, and use the bit description detailed in the following Linux kernel commit: https://github.com/torvalds/linux/commit/fa7315871046b9a4c48627905691dbde57e51033 to check whether the kernel supports rdpmc. Fall-back on the perf read system call for kernels prior to 3.12, because older kernels have an ABI bug where a union was used for both cap_usr_time and cap_usr_rdpmc. Ensure setup_perf set the pc pointer value before checking whether we need to the file descriptor open or not. Signed-off-by: Mathieu Desnoyers ---