[PATCH 05/14] perf bench numa: Make sure dprintf() is not defined

From: Arnaldo Carvalho de Melo
Date: Wed Feb 15 2017 - 14:05:03 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

When building with clang we get this error:

bench/numa.c:46:9: error: 'dprintf' macro redefined [-Werror,-Wmacro-redefined]
#define dprintf(x...) do { if (g && g->p.show_details >= 1) printf(x); } while (0)
^
/usr/include/bits/stdio2.h:145:12: note: previous definition is here
# define dprintf(fd, ...) \
^
CC /tmp/build/perf/tests/parse-no-sample-id-all.o
1 error generated.

So, make sure it is undefined before using that name.

Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Davidlohr Bueso <dbueso@xxxxxxx>
Cc: Hitoshi Mitake <mitake@xxxxxxxxxxxxxxxxxxxxx>
Cc: Jakub Jelen <jjelen@xxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Wang Nan <wangnan0@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-f654o2svtrutamvxt7igwz74@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/bench/numa.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
index 9e5a02d6b9a9..3083fc36282b 100644
--- a/tools/perf/bench/numa.c
+++ b/tools/perf/bench/numa.c
@@ -43,6 +43,7 @@
/*
* Debug printf:
*/
+#undef dprintf
#define dprintf(x...) do { if (g && g->p.show_details >= 1) printf(x); } while (0)

struct thread_data {
--
2.9.3