[PATCH 21/27] perf tools: Fix build on gcc 4.4.7

From: Arnaldo Carvalho de Melo
Date: Fri Jul 25 2014 - 11:38:52 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

[acme@sandy linux]$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[acme@sandy linux]$ make O=/tmp/build/perf -C tools/perf install-bin
<SNIP>
CC /tmp/build/perf/builtin-trace.o
builtin-trace.c: In function âperf_evlist__add_pgfaultâ:
builtin-trace.c:1997: error: unknown field âsample_periodâ specified in initializer
make[1]: *** [/tmp/build/perf/builtin-trace.o] Error 1
make: *** [install-bin] Error 2
make: Leaving directory `/home/acme/git/linux/tools/perf'
[acme@sandy linux]$ make O=/tmp/build/perf -C tools/perf install-bin
make O=/tmp/build/perf -C tools/perf install-bin
make: Entering directory `/home/acme/git/linux/tools/perf'

Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Don Zickus <dzickus@xxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-qt7h2g5fcf42qiw5hv7mgpjk@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/builtin-trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index c4a5a7d7b2cf..a6c375224f46 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1994,10 +1994,10 @@ static int perf_evlist__add_pgfault(struct perf_evlist *evlist,
struct perf_event_attr attr = {
.type = PERF_TYPE_SOFTWARE,
.mmap_data = 1,
- .sample_period = 1,
};

attr.config = config;
+ attr.sample_period = 1;

event_attr_init(&attr);

--
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/