perf tools: Fix LIBNUMA build with glibc 2.12 and older.
authorVinson Lee <vlee@twitter.com>
Wed, 13 Mar 2013 22:34:24 +0000 (15:34 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 14 Mar 2013 11:06:21 +0000 (08:06 -0300)
commitd1398ccfec56e54010476efd6a316427d29045a6
tree7bfb7c9196c77f004eb23248f62c851dbbeb46c2
parent3bf7b07ece6e00747602938f68c1db8001b9925f
perf tools: Fix LIBNUMA build with glibc 2.12 and older.

The tokens MADV_HUGEPAGE and MADV_NOHUGEPAGE are not available with
glibc 2.12 and older. Define these tokens if they are not already
defined.

This patch fixes these build errors with older versions of glibc.

CC bench/numa.o
bench/numa.c: In function ‘alloc_data’:
bench/numa.c:334: error: ‘MADV_HUGEPAGE’ undeclared (first use in this function)
bench/numa.c:334: error: (Each undeclared identifier is reported only once
bench/numa.c:334: error: for each function it appears in.)
bench/numa.c:341: error: ‘MADV_NOHUGEPAGE’ undeclared (first use in this function)
make: *** [bench/numa.o] Error 1

Signed-off-by: Vinson Lee <vlee@twitter.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Irina Tirdea <irina.tirdea@intel.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1363214064-4671-2-git-send-email-vlee@twitter.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/bench/bench.h