[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1287774792-23123-9-git-send-regression-fweisbec@gmail.com>
Date: Fri, 22 Oct 2010 21:13:09 +0200
From: Frederic Weisbecker <fweisbec@...il.com>
To: LKML <linux-kernel@...r.kernel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...e.hu>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Paul Mackerras <paulus@...ba.org>,
Stephane Eranian <eranian@...gle.com>,
Cyrill Gorcunov <gorcunov@...nvz.org>,
Tom Zanussi <tzanussi@...il.com>,
Masami Hiramatsu <mhiramat@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>,
Robert Richter <robert.richter@....com>,
"Frank Ch. Eigler" <fche@...hat.com>
Subject: [RFC PATCH 08/11] perf: Support for error passed over pointers
Export the linux/err.h that carries the ERR_PTR/PTR_ERR/IS_ERR
macros so that they also become usable by perf.
Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Cyrill Gorcunov <gorcunov@...nvz.org>
Cc: Tom Zanussi <tzanussi@...il.com>
Cc: Masami Hiramatsu <mhiramat@...hat.com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Robert Richter <robert.richter@....com>
Cc: Frank Ch. Eigler <fche@...hat.com>
---
tools/perf/Makefile | 1 +
tools/perf/util/include/linux/err.h | 24 ++++++++++++++++++++++++
2 files changed, 25 insertions(+), 0 deletions(-)
create mode 100644 tools/perf/util/include/linux/err.h
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 49432e0..addef2f 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -377,6 +377,7 @@ LIB_H += util/include/linux/prefetch.h
LIB_H += util/include/linux/rbtree.h
LIB_H += util/include/linux/string.h
LIB_H += util/include/linux/types.h
+LIB_H += util/include/linux/err.h
LIB_H += util/include/asm/asm-offsets.h
LIB_H += util/include/asm/bug.h
LIB_H += util/include/asm/byteorder.h
diff --git a/tools/perf/util/include/linux/err.h b/tools/perf/util/include/linux/err.h
new file mode 100644
index 0000000..4e6dc36
--- /dev/null
+++ b/tools/perf/util/include/linux/err.h
@@ -0,0 +1,24 @@
+#ifndef PERF_ERR_H
+#define PERF_ERR_H
+
+
+#define MAX_ERRNO 4095
+
+#define IS_ERR_VALUE(x) ((x) >= (unsigned long)-MAX_ERRNO)
+
+static inline void *ERR_PTR(long err)
+{
+ return (void *) err;
+}
+
+static inline long PTR_ERR(const void *ptr)
+{
+ return (long) ptr;
+}
+
+static inline long IS_ERR(const void *ptr)
+{
+ return IS_ERR_VALUE((unsigned long)ptr);
+}
+
+#endif /* PERF_ERR_H */
--
1.6.2.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists