]> git.baikalelectronics.ru Git - kernel.git/commit
perf tools: Allow ability to map cpus to nodes easily
authorDon Zickus <dzickus@redhat.com>
Mon, 7 Apr 2014 18:55:21 +0000 (14:55 -0400)
committerJiri Olsa <jolsa@redhat.com>
Tue, 22 Apr 2014 15:39:12 +0000 (17:39 +0200)
commita5386e12e4ed2a139ad46924d61b4b091a8029c9
treed829ae6b0a4f48152326e79c0927f52f23e4a660
parent0a83437f996ae2c23903e58558511adce2f7a5d0
perf tools: Allow ability to map cpus to nodes easily

This patch figures out the max number of cpus and nodes that are on the
system and creates a map of cpu to node.  This allows us to provide a cpu
and quickly get the node associated with it.

It was mostly copied from builtin-kmem.c and tweaked slightly to use less memory
(use possible cpus instead of max).  It also calculates the max number of nodes.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1396896924-129847-2-git-send-email-dzickus@redhat.com
[ Removing out label code in init_cpunode_map ]
[ Adding check for snprintf error ]
[ Removing unneeded returns ]
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
tools/perf/util/cpumap.c
tools/perf/util/cpumap.h