[Click] click_get_cycles() on x86_64
Salman Abdul Baset
salman at cs.columbia.edu
Tue Jul 24 04:27:36 EDT 2007
In function click_get_cycles() defined in include/click/glue.hh, there is
no #ifdef for x86_64. Consequently, on the machine I am testing (quad
core, x86_64) click_get_cycles() returns zero.
I copied the code from
#if CLICK_LINUXMODULE && HAVE_INT64_TYPES && __i386__
to fix it:
<code>
#elif CLICK_LINUXMODULE && HAVE_INT64_TYPES && __x86_64__
uint64_t x;
__asm__ __volatile__ ("rdtsc" : "=A" (x));
return x;
</code>
Is this a correct way to do this?
Thanks
Salman
More information about the click
mailing list