OSDN Git Service

Simpleperf: fix build on mac.
authorYabin Cui <yabinc@google.com>
Tue, 14 Jul 2015 04:41:05 +0000 (21:41 -0700)
committerYabin Cui <yabinc@google.com>
Tue, 14 Jul 2015 04:41:05 +0000 (21:41 -0700)
Change-Id: I042fa65347c38879ff9b9f1027b8ae39ec26da62

simpleperf/Android.mk
simpleperf/perf_event.h
simpleperf/perf_regs.h

index e433880..278b96e 100644 (file)
@@ -19,7 +19,7 @@ LOCAL_PATH := $(call my-dir)
 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 \
index a91eb6b..7e7e48d 100644 (file)
 #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_
index aa31868..97e230f 100644 (file)
 #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>