]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: trace.c: rdtsc() is defined in two files
authorWilliam Lallemand <wlallemand@irq6.net>
Sat, 9 Apr 2016 19:27:21 +0000 (21:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 9 Apr 2016 20:27:01 +0000 (22:27 +0200)
The rdtsc() function provided in standard.h forbid trace.c to compile
because it's already defined there.

src/trace.c

index ab3827d31a833e1d6e81a4de0f50121190fdff76..4bbbc302abe2a48cc3b648fd216b86623d37f2af 100644 (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;