From: Srikar Dronamraju Date: Wed, 24 Jun 2015 11:10:04 +0000 (+0530) Subject: perf bench numa: Fix to show proper convergence stats X-Git-Tag: v4.1.12-92~198^2~21 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1a414b56f77c7e8a6c84d0d1a4b117f41aa837fb;p=users%2Fjedix%2Flinux-maple.git perf bench numa: Fix to show proper convergence stats With commit: e1e455f4f4d3 (perf tools: Work around lack of sched_getcpu in glibc < 2.6), perf_bench numa mem with -c or -m option is not able to correctly calculate convergence. With the above commit, sched_getcpu always seems to return -1. The intention of commit e1e455f was to add a sched_getcpu in glibc < 2.6. Hence keep the sched_getcpu definition under an ifdef. This regression happened occurred between v4.0 and v4.1 Signed-off-by: Srikar Dronamraju Acked-by: Ingo Molnar Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Vinson Lee Fixes: e1e455f4f4d3 ("perf tools: Work around lack of sched_getcpu in glibc < 2.6") Link: http://lkml.kernel.org/r/20150624111004.GA5220@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo (cherry picked from commit 2b42b09b88c831ba4da2d669581dde371c38c2af) Signed-off-by: Babu Moger Orabug:22175225 (cherry picked from commit 7e39c25e52d3f4e88d2c95fcc0af053ce009b8a6) --- diff --git a/tools/perf/util/cloexec.c b/tools/perf/util/cloexec.c index 85b523885f9d..2babddaa2481 100644 --- a/tools/perf/util/cloexec.c +++ b/tools/perf/util/cloexec.c @@ -7,11 +7,15 @@ static unsigned long flag = PERF_FLAG_FD_CLOEXEC; +#ifdef __GLIBC_PREREQ +#if !__GLIBC_PREREQ(2, 6) int __weak sched_getcpu(void) { errno = ENOSYS; return -1; } +#endif +#endif static int perf_flag_probe(void) {