perf tools: Fix SMT fallback with large core counts
authorIan Rogers <irogers@google.com>
Wed, 24 Nov 2021 00:12:30 +0000 (16:12 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 12 Jan 2022 17:43:22 +0000 (14:43 -0300)
commit0ce05781f4905fcfbbb489519e36be71c7b0bbcc
tree537f2832a0bd5f26760c18958009ab196e321ddc
parent6d18804b963b78dcd53851f11e9080408b3d85c2
perf tools: Fix SMT fallback with large core counts

strtoull can only read a 64-bit bitmap. On an AMD EPYC core_cpus may look
like:

00000000,00000000,00000000,00000001,00000000,00000000,00000000,00000001

and so the sibling wasn't spotted. Fix by writing a simple hweight string
parser.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Clarke <pc@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20211124001231.3277836-3-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/smt.c