simpleperf_common_cppflags := -std=c++11 -Wall -Wextra -Werror -Wunused
simpleperf_host_common_cppflags := $(simpleperf_common_cppflags) \
- -I bionic/libc/kernel/uapi \
+ -DUSE_BIONIC_UAPI_HEADERS -I bionic/libc/kernel \
simpleperf_host_darwin_cppflags := $(simpleperf_host_common_cppflags) \
-I $(LOCAL_PATH)/darwin_support \
#ifndef SIMPLE_PERF_PERF_EVENT_H_
#define SIMPLE_PERF_PERF_EVENT_H_
+#if defined(USE_BIONIC_UAPI_HEADERS)
+#include <uapi/linux/perf_event.h>
+#else
#include <linux/perf_event.h>
+#endif
#endif // SIMPLE_PERF_PERF_EVENT_H_
#ifndef SIMPLE_PERF_PERF_REGS_H_
#define SIMPLE_PERF_PERF_REGS_H_
+#if defined(USE_BIONIC_UAPI_HEADERS)
+#include <uapi/asm-x86/asm/perf_regs.h>
+#include <uapi/asm-arm/asm/perf_regs.h>
+#define perf_event_arm_regs perf_event_arm64_regs
+#include <uapi/asm-arm64/asm/perf_regs.h>
+#else
#include <asm-x86/asm/perf_regs.h>
#include <asm-arm/asm/perf_regs.h>
#define perf_event_arm_regs perf_event_arm64_regs
#include <asm-arm64/asm/perf_regs.h>
+#endif
+
#include <stdint.h>
#include <string>