From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Irina Tirdea <irina.tirdea@gmail.com>,
Irina Tirdea <irina.tirdea@intel.com>,
David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@redhat.com>,
Namhyung Kim <namhyung.kim@lge.com>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Steven Rostedt <rostedt@goodmis.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 06/18] perf tools: Update types definitions for Android
Date: Tue, 11 Sep 2012 20:52:58 -0300 [thread overview]
Message-ID: <1347407590-30960-7-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1347407590-30960-1-git-send-email-acme@infradead.org>
From: Irina Tirdea <irina.tirdea@gmail.com>
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>
---
tools/perf/util/include/linux/compiler.h | 4 ++++
tools/perf/util/include/linux/kernel.h | 9 +++++++++
tools/perf/util/include/linux/types.h | 8 ++++++++
3 files changed, 21 insertions(+)
diff --git a/tools/perf/util/include/linux/compiler.h b/tools/perf/util/include/linux/compiler.h
index 2dc8671..ce2367b 100644
--- a/tools/perf/util/include/linux/compiler.h
+++ b/tools/perf/util/include/linux/compiler.h
@@ -12,4 +12,8 @@
#define __used __attribute__((__unused__))
#define __packed __attribute__((__packed__))
+#ifndef __force
+#define __force
+#endif
+
#endif
diff --git a/tools/perf/util/include/linux/kernel.h b/tools/perf/util/include/linux/kernel.h
index 4af9a10..a978f26 100644
--- a/tools/perf/util/include/linux/kernel.h
+++ b/tools/perf/util/include/linux/kernel.h
@@ -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)
diff --git a/tools/perf/util/include/linux/types.h b/tools/perf/util/include/linux/types.h
index 12de3b8..eb46478 100644
--- a/tools/perf/util/include/linux/types.h
+++ b/tools/perf/util/include/linux/types.h
@@ -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)]
--
1.7.9.2.358.g22243
next prev parent reply other threads:[~2012-09-11 23:54 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-11 23:52 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
2012-09-11 23:52 ` [PATCH 01/18] perf test: Remove die() calls Arnaldo Carvalho de Melo
2012-09-12 0:24 ` Namhyung Kim
2012-09-12 1:03 ` Arnaldo Carvalho de Melo
2012-09-12 1:17 ` Namhyung Kim
2012-09-11 23:52 ` [PATCH 02/18] perf sched: " Arnaldo Carvalho de Melo
2012-09-12 0:37 ` Namhyung Kim
2012-09-11 23:52 ` [PATCH 03/18] perf kmem: " Arnaldo Carvalho de Melo
2012-09-11 23:52 ` [PATCH 04/18] perf tools: include wrapper for magic.h Arnaldo Carvalho de Melo
2012-09-11 23:52 ` [PATCH 05/18] perf tools: Add missing perf_regs.h file to MANIFEST Arnaldo Carvalho de Melo
2012-09-11 23:52 ` Arnaldo Carvalho de Melo [this message]
2012-09-11 23:52 ` [PATCH 07/18] perf tools: include __WORDSIZE definition Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 08/18] perf tools: fix ALIGN redefinition in system headers Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 09/18] perf tools: Do backtrace post unwind only if we regs and stack were captured Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 10/18] perf tools: Add memdup function Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 11/18] perf symbols: Make dsos__find function globally available Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 12/18] perf tools: Back [vdso] DSO with real data Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 13/18] perf tools: Use __maybe_used for unused variables Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 14/18] perf sched: Remove unused thread parameter Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 15/18] perf sched: Use perf_tool as ancestor Arnaldo Carvalho de Melo
2012-09-12 1:04 ` Namhyung Kim
2012-09-11 23:53 ` [PATCH 16/18] perf evsel: Introduce perf_evsel__{str,int}val methods Arnaldo Carvalho de Melo
2012-09-12 1:40 ` Namhyung Kim
2012-09-12 13:47 ` Arnaldo Carvalho de Melo
2012-09-12 2:21 ` Namhyung Kim
2012-09-12 13:48 ` Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 17/18] perf sched: Use perf_evsel__{int,str}val Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 18/18] perf sched: Don't read all tracepoint variables in advance Arnaldo Carvalho de Melo
2012-09-13 15:15 ` [GIT PULL 00/20] perf/core improvements and fixes Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1347407590-30960-7-git-send-email-acme@infradead.org \
--to=acme@infradead.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=irina.tirdea@gmail.com \
--cc=irina.tirdea@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung.kim@lge.com \
--cc=paulus@samba.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).