From: Amos Jeffries Date: Sat, 19 Apr 2008 02:04:38 +0000 (-0600) Subject: Author: Henrik Nordstrom X-Git-Tag: SQUID_3_0_STABLE5~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2cda4ac4c08142e5fc4839ac059dba70d701ccd;p=thirdparty%2Fsquid.git Author: Henrik Nordstrom Add x86_64 support to XPROF_STATS --- diff --git a/include/profiling.h b/include/profiling.h index f8311a3b8c..f47074edc8 100644 --- a/include/profiling.h +++ b/include/profiling.h @@ -30,6 +30,17 @@ asm volatile ("rdtsc":"=A" (regs)); /* Note that "rdtsc" is relatively slow OP and stalls the CPU pipes, so use it wisely */ } +#elif defined(__x86_64) || defined(__x86_64__) +static inline hrtime_t +get_tick(void) +{ + uint32_t lo, hi; + // Based on an example in Wikipedia + /* We cannot use "=A", since this would use %rax on x86_64 */ + asm volatile ("rdtsc" : "=a" (lo), "=d" (hi)); + return (hrtime_t)hi << 32 | lo; +} + #elif defined(__alpha) static inline hrtime_t get_tick(void)