Skip to content

Commit

Permalink
perf bench numa: Fix to show proper convergence stats
Browse files Browse the repository at this point in the history
With commit: e1e455f (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 <srikar@linux.vnet.ibm.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Vinson Lee <vlee@twitter.com>
Fixes:  e1e455f ("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 <acme@redhat.com>
  • Loading branch information
Srikar Dronamraju authored and Arnaldo Carvalho de Melo committed Jun 25, 2015
1 parent 0f02ada commit 2b42b09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/perf/util/cloexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 2b42b09

Please sign in to comment.