From f0ca40f9aaa5ba9c39ffcefc39e450443603db44 Mon Sep 17 00:00:00 2001 From: Alexander Lochmann Date: Wed, 6 Jul 2016 13:55:07 +0200 Subject: [PATCH 1/3] Definition of cputime_to_usecs in Linux kernel 3.0 is broken The above macro is definined with a semicolon at the end. Using it as a function argument leads to a compiler error. Hence, the necessary braces have been added. --- tapset/linux/task_time.stp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tapset/linux/task_time.stp b/tapset/linux/task_time.stp index f86f984..f3c276c 100644 --- a/tapset/linux/task_time.stp +++ b/tapset/linux/task_time.stp @@ -27,8 +27,12 @@ * Yet note some kernels (RHEL6) may already have both... */ #if defined(cputime_to_usecs) #if !defined(cputime_to_msecs) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,0,200) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) +#define cputime_to_msecs(__ct) _stp_div64(NULL, ({cputime_to_usecs(__ct)}), 1000ULL) +#else #define cputime_to_msecs(__ct) _stp_div64(NULL, cputime_to_usecs(__ct), 1000ULL) #endif +#endif /* Kernels before 2.6.37 have cputime_to_msecs, but not usecs. */ #elif defined(cputime_to_msecs) -- 2.7.4