aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrina Tirdea <irina.tirdea@gmail.com>2012-09-10 18:14:59 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-09-11 10:46:09 -0400
commit86d5a70c1eeb3d35bcadc94753fd9651df8835a8 (patch)
tree307b48dbbd05bd2bc52800ab83068f8f362bba52
parentfe392c535644b8ee370a219ca63557611e0b0365 (diff)
perf tools: Update types definitions for Android
Some type definitions are missing from Android or are already defined in bionic and lead to redefinition errors. Android defines in types.h __le32. Since perf is wrapping <linux/types.h> with a local version, we need to define this constant in the local version too. Error in Android: In file included from bionic/libc/include/unistd.h:36:0, from external/perf/tools/perf/util/util.h:46, from external/perf/tools/perf/util/cache.h:5, from external/perf/tools/perf/util/abspath.c:1: bionic/libc/kernel/common/linux/capability.h:60:2: error: unknown type name '__le32' roundup() definition is missing: util/symbol.c: In function 'symbols__fixup_end': util/symbol.c:106: warning: implicit declaration of function 'roundup' util/symbol.c:106: warning: nested extern declaration of 'roundup' __force macro defined in perf is also defined in libc which leads to redefinition errors. In order to avoid these, we guard these definition with Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Acked-by: Pekka Enberg <penberg@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Irina Tirdea <irina.tirdea@intel.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1347315303-29906-3-git-send-email-irina.tirdea@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/include/linux/compiler.h4
-rw-r--r--tools/perf/util/include/linux/kernel.h9
-rw-r--r--tools/perf/util/include/linux/types.h8
3 files changed, 21 insertions, 0 deletions
diff --git a/tools/perf/util/include/linux/compiler.h b/tools/perf/util/include/linux/compiler.h
index 2dc867128e4..ce2367b7b3f 100644
--- a/tools/perf/util/include/linux/compiler.h
+++ b/tools/perf/util/include/linux/compiler.h
@@ -12,4 +12,8 @@
12#define __used __attribute__((__unused__)) 12#define __used __attribute__((__unused__))
13#define __packed __attribute__((__packed__)) 13#define __packed __attribute__((__packed__))
14 14
15#ifndef __force
16#define __force
17#endif
18
15#endif 19#endif
diff --git a/tools/perf/util/include/linux/kernel.h b/tools/perf/util/include/linux/kernel.h
index 4af9a10cc2d..a978f269d8d 100644
--- a/tools/perf/util/include/linux/kernel.h
+++ b/tools/perf/util/include/linux/kernel.h
@@ -46,6 +46,15 @@
46 _min1 < _min2 ? _min1 : _min2; }) 46 _min1 < _min2 ? _min1 : _min2; })
47#endif 47#endif
48 48
49#ifndef roundup
50#define roundup(x, y) ( \
51{ \
52 const typeof(y) __y = y; \
53 (((x) + (__y - 1)) / __y) * __y; \
54} \
55)
56#endif
57
49#ifndef BUG_ON 58#ifndef BUG_ON
50#ifdef NDEBUG 59#ifdef NDEBUG
51#define BUG_ON(cond) do { if (cond) {} } while (0) 60#define BUG_ON(cond) do { if (cond) {} } while (0)
diff --git a/tools/perf/util/include/linux/types.h b/tools/perf/util/include/linux/types.h
index 12de3b8112f..eb464786c08 100644
--- a/tools/perf/util/include/linux/types.h
+++ b/tools/perf/util/include/linux/types.h
@@ -3,6 +3,14 @@
3 3
4#include <asm/types.h> 4#include <asm/types.h>
5 5
6#ifndef __bitwise
7#define __bitwise
8#endif
9
10#ifndef __le32
11typedef __u32 __bitwise __le32;
12#endif
13
6#define DECLARE_BITMAP(name,bits) \ 14#define DECLARE_BITMAP(name,bits) \
7 unsigned long name[BITS_TO_LONGS(bits)] 15 unsigned long name[BITS_TO_LONGS(bits)]
8 16