OVS_CHECK_RUNDIR
OVS_CHECK_DBDIR
OVS_CHECK_BACKTRACE
+OVS_CHECK_PERF_EVENT
OVS_CHECK_VALGRIND
OVS_CHECK_SOCKET_LIBS
OVS_CHECK_XENSERVER_VERSION
*/
/* This implementation only applies to the Linux platform. */
-#ifdef __linux__
+
+#include <config.h>
+#if defined(__linux__) && defined(HAVE_PERF_EVENT_H)
#include <stddef.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <linux/perf_event.h>
#include <asm/unistd.h>
-#include <config.h>
#include "dynamic-string.h"
#include "openvswitch/vlog.h"
#include "perf-counter.h"
* will work just fine.
*/
-#ifdef __linux__
+#if defined(__linux__) && defined(HAVE_PERF_EVENT_H)
struct perf_counter {
const char *name;
bool once;
#else
-#define PERF_FUNCTON_COUNT_BEGIN
-#define PERF_FUNCTON_COUNT_END
+#define PERF_FUNCTON_BEGIN
+#define PERF_FUNCTON_END
static inline void perf_counters_init(void) {}
static inline void perf_counters_destroy(void) {}
static inline char *
perf_counters_to_string(void)
{
- return xstrdup("Not Supported on this platform. Only available on Linux.");
+ return xstrdup("Not Supported on this platform. Only available on Linux (version >= 2.6.32)");
}
#endif
[AC_DEFINE([HAVE_BACKTRACE], [1],
[Define to 1 if you have backtrace(3).])])])
+dnl Defines HAVE_PERF_EVENT if linux/perf_event.h is found.
+AC_DEFUN([OVS_CHECK_PERF_EVENT],
+ [AC_CHECK_HEADERS([linux/perf_event.h])])
+
dnl Checks for valgrind/valgrind.h.
AC_DEFUN([OVS_CHECK_VALGRIND],
[AC_CHECK_HEADERS([valgrind/valgrind.h])])