diff options
author | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2012-12-07 14:20:14 +0100 |
---|---|---|
committer | Andrey Konovalov <andrey.konovalov@linaro.org> | 2012-12-10 16:54:04 +0400 |
commit | 05a789f13dad6247198edc55423be09236411b76 (patch) | |
tree | 43fe675b779cf2379f1e6e63b35b5162623821c9 | |
parent | 44e8ca3d20f51ef5b3c2c754ff624446d0eb92aa (diff) |
Fix perf build on Android againtracking-ll-v3.7-misc-fixes-ll-20121213.0tracking-ll-v3.7-misc-fixes-ll-20121210.0
The kernel header shuffling in recent builds broke building
perf again -- add workarounds.
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
-rw-r--r-- | arch/arm/include/asm/bitsperlong.h | 1 | ||||
-rw-r--r-- | arch/arm64/include/asm/bitsperlong.h | 1 | ||||
-rw-r--r-- | tools/perf/compat-android.h | 29 | ||||
-rw-r--r-- | tools/perf/util/pager.c | 1 | ||||
-rw-r--r-- | tools/perf/util/util.h | 2 |
5 files changed, 33 insertions, 1 deletions
diff --git a/arch/arm/include/asm/bitsperlong.h b/arch/arm/include/asm/bitsperlong.h new file mode 100644 index 000000000000..6dc0bb0c13b2 --- /dev/null +++ b/arch/arm/include/asm/bitsperlong.h @@ -0,0 +1 @@ +#include <asm-generic/bitsperlong.h> diff --git a/arch/arm64/include/asm/bitsperlong.h b/arch/arm64/include/asm/bitsperlong.h new file mode 100644 index 000000000000..6dc0bb0c13b2 --- /dev/null +++ b/arch/arm64/include/asm/bitsperlong.h @@ -0,0 +1 @@ +#include <asm-generic/bitsperlong.h> diff --git a/tools/perf/compat-android.h b/tools/perf/compat-android.h index b8fb93679329..fce9573d257b 100644 --- a/tools/perf/compat-android.h +++ b/tools/perf/compat-android.h @@ -20,13 +20,35 @@ #ifndef _COMPAT_ANDROID_H_ #define _COMPAT_ANDROID_H_ 1 +/* Stuff Bionic assumes to be present, but that doesn't exist + * anymore after the uabi kernel header reorg + */ +#include <stdint.h> +#include <stdbool.h> +typedef unsigned short __kernel_nlink_t; +typedef intptr_t phys_addr_t; +#include <linux/types.h> +typedef uint32_t u32; +typedef uint64_t u64; +#ifndef CONFIG_DRAM_BASEUL +#ifdef CONFIG_DRAM_BASE +#define CONFIG_DRAM_BASEUL UL(CONFIG_DRAM_BASE) +#else +#define CONFIG_DRAM_BASEUL 0 +#endif +#endif +#define __deprecated +#include <asm-generic/bitsperlong.h> + +#undef BITS_PER_LONG /* Something seems to define this incorrectly */ +#define BITS_PER_LONG _BITSIZE + #include <stdio.h> #include <signal.h> #include <asm/page.h> /* for PAGE_SIZE */ #include <asm/termios.h> /* for winsize */ #ifndef __WORDSIZE -#include <stdint.h> #define __WORDSIZE _BITSIZE #endif @@ -42,6 +64,11 @@ #define __le32 uint32_t #endif +#ifndef FD_SET +#define FD_SET(fd, fdsetp) (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] |= (1<<((fd) & 31))) +#define FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof (*(fd_set *)(fdsetp)))) +#endif + /* Assorted functions that are missing from Bionic */ /* Android prior to 4.2 lacks psignal(). * What we're doing here is fairly evil - but necessary since diff --git a/tools/perf/util/pager.c b/tools/perf/util/pager.c index 3322b8446e89..cd543418c721 100644 --- a/tools/perf/util/pager.c +++ b/tools/perf/util/pager.c @@ -1,6 +1,7 @@ #include "cache.h" #include "run-command.h" #include "sigchain.h" +#include <sys/select.h> /* * This is split up from the rest of git so that we can do diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 10e8a478ae4c..ebee70529cdc 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -253,11 +253,13 @@ void event_attr_init(struct perf_event_attr *attr); * *not* considered a power of two. */ +#ifndef _LINUX_LOG2_H // defined there too static inline __attribute__((const)) bool is_power_of_2(unsigned long n) { return (n != 0 && ((n & (n - 1)) == 0)); } +#endif size_t hex_width(u64 v); |