#include <unistd.h>
#ifdef HAVE_LINUX_PERF_EVENT_H
+# include <sys/syscall.h>
# include <linux/perf_event.h>
-# include <asm/unistd.h>
#endif
#include <mLib/alloc.h>
attr.exclude_kernel = 1;
attr.exclude_hv = 1;
- if ((perf_fd = syscall(__NR_perf_event_open, &attr, 0, -1, -1, 0)) < 0)
+ if ((perf_fd = syscall(SYS_perf_event_open, &attr, 0, -1, -1, 0)) < 0)
moan("failed to open perf event: %s", strerror(errno));
else
cyclecount_active_p = 1;