Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86d5a70c authored by Irina Tirdea's avatar Irina Tirdea Committed by Arnaldo Carvalho de Melo
Browse files

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: default avatarIrina Tirdea <irina.tirdea@intel.com>
Acked-by: default avatarPekka 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent fe392c53
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -12,4 +12,8 @@
#define __used		__attribute__((__unused__))
#define __packed	__attribute__((__packed__))

#ifndef __force
#define __force
#endif

#endif
+9 −0
Original line number Diff line number Diff line
@@ -46,6 +46,15 @@
	_min1 < _min2 ? _min1 : _min2; })
#endif

#ifndef roundup
#define roundup(x, y) (                                \
{                                                      \
	const typeof(y) __y = y;		       \
	(((x) + (__y - 1)) / __y) * __y;	       \
}                                                      \
)
#endif

#ifndef BUG_ON
#ifdef NDEBUG
#define BUG_ON(cond) do { if (cond) {} } while (0)
+8 −0
Original line number Diff line number Diff line
@@ -3,6 +3,14 @@

#include <asm/types.h>

#ifndef __bitwise
#define __bitwise
#endif

#ifndef __le32
typedef __u32 __bitwise __le32;
#endif

#define DECLARE_BITMAP(name,bits) \
	unsigned long name[BITS_TO_LONGS(bits)]