perf mem2node: Improve warning if detected no memory nodes
authorLeo Yan <leo.yan@linaro.org>
Mon, 19 Oct 2020 00:36:13 +0000 (08:36 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 4 Nov 2020 12:42:40 +0000 (09:42 -0300)
commit0ee281e1e4e12f8c09b99f80a2482a55cd7d6bca
tree2e8b1741704609daac4f935b94e737be8f3b6673
parenta7c77c4f52c80fffc53b4c616a95f96d57170933
perf mem2node: Improve warning if detected no memory nodes

Some archs (e.g. x86 and Arm64) don't enable the configuration
CONFIG_MEMORY_HOTPLUG by default, if this configuration is not enabled
when build the kernel image, the SysFS for memory nodes will be missed.
This results in perf tool has no chance to catpure the memory nodes
information, when perf tool reports the result and detects no memory
nodes, it outputs "assertion failed at util/mem2node.c:99".

The output log doesn't give out reason for the failure and users have no
clue for how to fix it.  This patch changes to use explicit way for
warning: it tells user that detected no memory nodes and suggests to
enable CONFIG_MEMORY_HOTPLUG for kernel building.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/r/20201019003613.8399-1-leo.yan@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/mem2node.c