From: Andrew Gabbasov Date: Mon, 10 Dec 2012 18:18:32 +0000 (-0500) Subject: wrapper/perf.h: Fix kernel version condition X-Git-Tag: v2.2.0-rc1~24 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=745dd71eba3a601459b4aa0128b47a31186342e6;p=lttng-modules.git wrapper/perf.h: Fix kernel version condition The pid_t parameter of function perf_event_create_kernel_counter was changed to task_struct pointer starting from 2.6.37.x. Signed-off-by: Andrew Gabbasov Signed-off-by: Mathieu Desnoyers --- diff --git a/wrapper/perf.h b/wrapper/perf.h index 5dfa84b3..5de205cd 100644 --- a/wrapper/perf.h +++ b/wrapper/perf.h @@ -34,7 +34,7 @@ wrapper_perf_event_create_kernel_counter(struct perf_event_attr *attr, } #else /* defined(CONFIG_PERF_EVENTS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,99)) */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) static inline struct perf_event * wrapper_perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu, @@ -43,7 +43,7 @@ wrapper_perf_event_create_kernel_counter(struct perf_event_attr *attr, { return perf_event_create_kernel_counter(attr, cpu, task, callback); } -#else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) */ +#else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */ static inline struct perf_event * wrapper_perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu, @@ -60,8 +60,11 @@ wrapper_perf_event_create_kernel_counter(struct perf_event_attr *attr, return perf_event_create_kernel_counter(attr, cpu, pid, callback); } +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */ + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) #define local64_read(l) atomic64_read(l) -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) */ +#endif #endif /* defined(CONFIG_PERF_EVENTS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,99)) */