From: Arnaldo Carvalho de Melo Date: Wed, 23 Jul 2014 21:15:09 +0000 (-0300) Subject: perf tools: Fix build on gcc 4.4.7 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0524798cc3d74546e83ebd795e9a5ed44481eaa6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git perf tools: Fix build on gcc 4.4.7 [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 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 Cc: David Ahern Cc: Don Zickus Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Mike Galbraith Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-qt7h2g5fcf42qiw5hv7mgpjk@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- 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);