views:

436

answers:

3

In an older linux distro I could call get_cycle() after including asm/timex.h. Now I changed to Kubuntu 9.04 and there is no asm/timex.h, plus in sys/timex.h there is no get_cycle(). Does anyone know why this changed, how to access this fuction/macro or a replacement for it? Or, even better, where to read information about it? Thanks in advance.

+1  A: 
/usr/src/linux-headers-2.6.24-23-generic/include/asm$ grep get_cycle *.h
system_32.h: * (or get_cycles or vread that possibly accesses the TSC) in a defined
system_64.h: * (or get_cycles or vread that possibly accesses the TSC) in a defined
tsc.h:static inline cycles_t get_cycles(void)
tsc.h:static inline cycles_t vget_cycles(void)
vmi_time.h:     u64 (*get_cycle_frequency)(void);
vmi_time.h:     u64 (*get_cycle_counter)(int);

So, try including <tsc.h>.

unwind
Thanks, that worked. I only grepped inside /usr/include...
Chris
+1  A: 

It should be under asm-i386/timex.h

dsm
A: 

/usr/src/linux-headers-2.6.28-11/arch/x86/include/asm/tsc.h