BUG/MEDIUM: trace.c: rdtsc() is defined in two files

The rdtsc() function provided in standard.h forbid trace.c to compile
because it's already defined there.
This commit is contained in:
William Lallemand 2016-04-09 21:27:21 +02:00 committed by Willy Tarreau
parent 0e00dca58b
commit 0567fa3af5

View File

@ -162,22 +162,6 @@ static char *emit_hex(unsigned long h, char *out)
return out;
}
#if defined(__i386__) || defined(__x86_64__)
static inline unsigned long long rdtsc()
{
unsigned int a, d;
asm volatile("rdtsc" : "=a" (a), "=d" (d));
return a + ((unsigned long long)d << 32);
}
#else
static inline unsigned long long rdtsc()
{
struct timeval tv;
gettimeofday(&tv, NULL);
return tv.tv_sec * 1000000 + tv.tv_usec;
}
#endif
static void make_line(void *from, void *to, int level, char dir)
{
char *p = line;