mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-02 01:20:49 +00:00
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:
parent
0e00dca58b
commit
0567fa3af5
16
src/trace.c
16
src/trace.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user