path: root/tools/perf/builtin-probe.c
diff options
authorDavid Daney <>2012-01-17 13:41:01 -0800
committerArnaldo Carvalho de Melo <>2012-01-24 20:26:33 -0200
commit2ef1ea3826434bdebe17b2941356a8f764ff5fcd (patch)
tree50e6d1272b370b7a52a3f7a0bffbc0e4908fc979 /tools/perf/builtin-probe.c
parente3e877e79b7c6a322f9f628e87052c13581238cc (diff)
perf tools: Fix broken build by defining _GNU_SOURCE in Makefile
When building on my Debian/mips system, util/util.c fails to build because commit 1aed2671738785e8f5aea663a6fda91aa7ef59b5 (perf kvm: Do guest-only counting by default) indirectly includes stdio.h before the feature selection in util.h is done. This prevents _GNU_SOURCE in util.h from enabling the declaration of getline(), from now second inclusion of stdio.h, and the build is broken. There is another breakage in util/evsel.c caused by include ordering, but I didn't fully track down the commit that caused it. The root cause of all this is an inconsistent definition of _GNU_SOURCE, so I move the definition into the Makefile so that it is passed to all invocations of the compiler and used uniformly for all system header files. All other #define and #undef of _GNU_SOURCE are removed as they cause conflicts with the definition passed to the compiler. All the features.h definitions (_LARGEFILE64_SOURCE _FILE_OFFSET_BITS=64 and _GNU_SOURCE) are needed by the python glue code too, so they are moved to BASIC_CFLAGS, and the misleading comments about BASIC_CFLAGS are removed. This gives me a clean build on x86_64 (fc12) and mips (Debian). Cc: David Daney <> Cc: Ingo Molnar <> Cc: Joerg Roedel <> Cc: Namhyung Kim <> Cc: Paul Mackerras <> Cc: Peter Zijlstra <> Link: Signed-off-by: David Daney <> Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf/builtin-probe.c')
1 files changed, 0 insertions, 2 deletions
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 59d43abfbfec..fb8566181f27 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -20,7 +20,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#define _GNU_SOURCE
#include <sys/utsname.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -31,7 +30,6 @@
#include <stdlib.h>
#include <string.h>
-#undef _GNU_SOURCE
#include "perf.h"
#include "builtin.h"
#include "util/util.h"