#ifdef USE_XPROF_STATS
#if !defined(_SQUID_SOLARIS_)
-typedef long long hrtime_t;
+typedef int64_t hrtime_t;
#else
#include <sys/time.h>
#endif
asm volatile ("rpcc $0":"=A" (regs)); /* I'm not sure of syntax */
return regs;
}
+#elif defined(_M_IX86) && defined(_MSC_VER) /* x86 platform on Microsoft C Compiler ONLY */
+static __inline hrtime_t
+get_tick(void)
+{
+ hrtime_t regs;
+ __asm {
+ cpuid
+ rdtsc
+ mov eax,DWORD PTR regs[0]
+ mov edx,DWORD PTR regs[4]
+ }
+ return regs;
+}
#else
#warning Unsupported CPU. Define function get_tick(). Disabling USE_XPROF_STATS...
#undef USE_XPROF_STATS
hrtime_t best;
hrtime_t worst;
hrtime_t count;
- long long summ;
+ int64_t summ;
};
struct _xprof_stats_node {
typedef xprof_stats_node TimersArray[1];
/* public Data */
-extern TimersArray *xprof_Timers;
-extern int xprof_nesting;
+SQUIDCEXTERN TimersArray *xprof_Timers;
+SQUIDCEXTERN int xprof_nesting;
/* Exported functions */
SQUIDCEXTERN void xprof_start(xprof_type type, const char *timer);
/*
- * $Id: util.h,v 1.68 2003/01/26 23:23:22 robertc Exp $
+ * $Id: util.h,v 1.69 2003/02/02 22:04:13 robertc Exp $
*
* AUTHOR: Harvest Derived
*
#endif
#if !defined(SQUIDHOSTNAMELEN)
+#if HAVE_SYS_PARAM_H
#include <sys/param.h>
+#endif
+#ifndef _SQUID_MSWIN_
#ifndef _SQUID_NETDB_H_ /* need protection on NEXTSTEP */
#define _SQUID_NETDB_H_
#include <netdb.h>
#endif
+#endif
#if !defined(MAXHOSTNAMELEN) || (MAXHOSTNAMELEN < 128)
#define SQUIDHOSTNAMELEN 128
#else
SQUIDCEXTERN char *xstrdup(const char *);
SQUIDCEXTERN char *xstrndup(const char *, size_t);
SQUIDCEXTERN const char *xstrerror(void);
-extern const char *xbstrerror(int);
SQUIDCEXTERN int tvSubMsec(struct timeval, struct timeval);
SQUIDCEXTERN int tvSubUsec(struct timeval, struct timeval);
SQUIDCEXTERN double tvSubDsec(struct timeval, struct timeval);
SQUIDCEXTERN const char *xitoa(int num);
#if !HAVE_DRAND48
-double drand48(void);
+SQUIDCEXTERN double drand48(void);
#endif
typedef struct {