X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=share%2Fkernelcompat.h;h=2a8e0f253d1158e637d53f130eea3ca49de8b241;hb=3158b808d3a8c45995ac7a40b022f9d569290b49;hp=57d12f83aef1a85d713402984611cedcaf269833;hpb=d6355fb2296dad2a7523630a3ab2cb7ff287d969;p=lttng-ust.git diff --git a/share/kernelcompat.h b/share/kernelcompat.h index 57d12f83..2a8e0f25 100644 --- a/share/kernelcompat.h +++ b/share/kernelcompat.h @@ -92,8 +92,6 @@ static inline long IS_ERR(const void *ptr) /* ATTRIBUTES */ #define ____cacheline_aligned -#define __init -#define __exit /* MATH */ @@ -152,18 +150,19 @@ static __inline__ int get_count_order(unsigned int count) /* TRACE CLOCK */ -//ust// static inline u64 trace_clock_read64(void) -//ust// { -//ust// uint32_t low; -//ust// uint32_t high; -//ust// uint64_t retval; -//ust// __asm__ volatile ("rdtsc\n" : "=a" (low), "=d" (high)); -//ust// -//ust// retval = high; -//ust// retval <<= 32; -//ust// return retval | low; -//ust// } +static inline u64 trace_clock_read64(void) +{ + uint32_t low; + uint32_t high; + uint64_t retval; + __asm__ volatile ("rdtsc\n" : "=a" (low), "=d" (high)); + + retval = high; + retval <<= 32; + return retval | low; +} +#if 0 static inline u64 trace_clock_read64(void) { struct timeval tv; @@ -176,6 +175,7 @@ static inline u64 trace_clock_read64(void) return retval; } +#endif static inline u64 trace_clock_frequency(void) {