RDTSC (was Re: FreeBSD & Linux)

Tigran Aivazian (tigran@sco.COM)
Mon, 9 Nov 1998 09:45:52 +0000 (GMT)


You wrote:
> ps: anyone have a better inline asm for rdtsc? The above was constructed
> after minimal reading of the gcc info files. I'd like something that looks
> like a function that returns the time ("var = cc()").

Sure thing! (I stole it from somewhere - can't remember):

#define get_profiler_timestamp() \
( { \
register unsigned long long __res; \
asm volatile ("rdtsc" : "=A"(__res)); \
__res; \
} )

regards,
------ -------- --------- -------- -- - -- ---- --
Tigran A. Aivazian | http://www.sco.com
Escalations Research Group | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd | Email: tigran@sco.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/