Dan Searle <dan@censornet.com>
Dan Searle <dan.searle@censornet.com>
Dave Dykstra <dwd@fnal.gov>
+ David Carlier <devnexen@gmail.com>
David Hill <david.hill@ubisoft.com>
David Isaacs <david.isaacs@sbhs.nsw.edu.au>
David J N Begley
AC_CACHE_CHECK([for operational CPU clock access],
squid_cv_cpu_profiler_works,
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
+#include <ctime>
#if defined(__GNUC__) && ( defined(__i386) || defined(__i386__) )
// okay
#elif defined(__GNUC__) && ( defined(__x86_64) || defined(__x86_64__) )
// okay
#elif defined(_M_IX86) && defined(_MSC_VER) /* x86 platform on Microsoft C Compiler ONLY */
// okay
+#elif defined(HAVE_CLOCK_GETTIME_NSEC_NP) && defined(CLOCK_MONOTONIC_RAW)
+// okay
#else
#error This CPU is unsupported. No profiling available here.
#endif
])
# Default OFF. This is a debug feature. Only check and enable if forced ON.
if test "x$enable_cpu_profiling" = "xyes"; then
+ AC_CHECK_FUNCS(clock_gettime_nsec_np)
SQUID_CHECK_FUNCTIONAL_CPU_PROFILER
if test "x$squid_cv_cpu_profiler_works" = "xno"; then
AC_MSG_ERROR([CPU profiling will not be functional in this build.])
#define _PROFILER_GET_TICK_H_
#if USE_XPROF_STATS
+#include <ctime>
/*
* Ensure that any changes here are synchronised with SQUID_CHECK_FUNCTIONAL_CPU_PROFILER
return regs;
}
+#elif defined(HAVE_CLOCK_GETTIME_NSEC_NP) && defined(CLOCK_MONOTONIC_RAW)
+
+static inline hrtime_t
+get_tick()
+{
+ return clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW);
+}
+
#else
/* This CPU is unsupported. Short-circuit, no profiling here */
// #error for configure tests to prevent library construction