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 04/18] perf tools: include wrapper for magic.h
Date: Tue, 11 Sep 2012 20:52:56 -0300 [thread overview]
Message-ID: <1347407590-30960-5-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>
perf is currently including magic.h directly from the kernel. If the
glibc magic.h is also included, this leads to warnings that the
constants are redefined. This happens on some systems (e.g. Android).
Redefinition errors on Android:
In file included from util/util.h:79:0,
from util/cache.h:5,
from util/abspath.c:1:
util/../../../include/linux/magic.h:5:0:
error: "AFFS_SUPER_MAGIC" redefined [-Werror]
bionic/libc/include/sys/vfs.h:53:0:
note: this is the location of the previous definition
util/../../../include/linux/magic.h:19:0:
error: "EFS_SUPER_MAGIC" redefined [-Werror]
bionic/libc/include/sys/vfs.h:61:0:
note: this is the location of the previous definition
util/../../../include/linux/magic.h:26:0:
error: "HPFS_SUPER_MAGIC" redefined [-Werror]
bionic/libc/include/sys/vfs.h:67:0:
note: this is the location of the previous definition
Only two constants from magic.h are used by perf (DEBUGFS_MAGIC and
SYSFS_MAGIC). This fix provides a wrapper for magic.h that includes only
these constants instead of including the kernel header file directly.
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-2-git-send-email-irina.tirdea@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Makefile | 1 +
tools/perf/util/include/linux/magic.h | 12 ++++++++++++
tools/perf/util/util.h | 2 +-
3 files changed, 14 insertions(+), 1 deletion(-)
create mode 100644 tools/perf/util/include/linux/magic.h
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index e4b2e8f..1d2723c 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -264,6 +264,7 @@ LIB_H += util/include/linux/ctype.h
LIB_H += util/include/linux/kernel.h
LIB_H += util/include/linux/list.h
LIB_H += util/include/linux/export.h
+LIB_H += util/include/linux/magic.h
LIB_H += util/include/linux/poison.h
LIB_H += util/include/linux/prefetch.h
LIB_H += util/include/linux/rbtree.h
diff --git a/tools/perf/util/include/linux/magic.h b/tools/perf/util/include/linux/magic.h
new file mode 100644
index 0000000..58b64ed
--- /dev/null
+++ b/tools/perf/util/include/linux/magic.h
@@ -0,0 +1,12 @@
+#ifndef _PERF_LINUX_MAGIC_H_
+#define _PERF_LINUX_MAGIC_H_
+
+#ifndef DEBUGFS_MAGIC
+#define DEBUGFS_MAGIC 0x64626720
+#endif
+
+#ifndef SYSFS_MAGIC
+#define SYSFS_MAGIC 0x62656572
+#endif
+
+#endif
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 67a3713..70fa70b 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -70,7 +70,7 @@
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <inttypes.h>
-#include "../../../include/linux/magic.h"
+#include <linux/magic.h>
#include "types.h"
#include <sys/ttydefaults.h>
--
1.7.9.2.358.g22243
next prev parent reply other threads:[~2012-09-11 23:55 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 ` Arnaldo Carvalho de Melo [this message]
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 ` [PATCH 06/18] perf tools: Update types definitions for Android Arnaldo Carvalho de Melo
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-5-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).