Unit tests "corrupted database log" and "database log with bad
transaction" will fail without this patch.
Reported-by: Ansis Atteka <aatteka@nicira.com>¬
Signed-off-by: Andy Zhou <azhou@nicira.com>
/* This implementation only applies to the Linux platform. */
#include <config.h>
-#if defined(__linux__) && defined(HAVE_PERF_EVENT_H)
+#if defined(__linux__) && defined(HAVE_LINUX_PERF_EVENT_H)
#include <stddef.h>
#include <sys/types.h>
pe.exclude_hv = 1;
fd__ = perf_event_open(&pe, 0, -1, -1, 0);
- if (fd__ == -1) {
- VLOG_INFO("Peformance counter is not available on this platform.");
- } else {
+ if (fd__ > 0) {
ioctl(fd__, PERF_EVENT_IOC_RESET, 0);
ioctl(fd__, PERF_EVENT_IOC_ENABLE, 0);
}
* will work just fine.
*/
-#if defined(__linux__) && defined(HAVE_PERF_EVENT_H)
+#if defined(__linux__) && defined(HAVE_LINUX_PERF_EVENT_H)
struct perf_counter {
const char *name;
bool once;