[PATCH 2/3] perf: use hweight64 instead of hweight_long

From: Mao Han
Date: Fri Mar 08 2019 - 00:30:59 EST


On C-SKY platform, there are 38 registers inside pt_regs. The same
layout is directly used by perf to keep uniformity. The mask is 64
bits, but hweight_long can only handle 32 bits, which will casue
perf.data analysis mismatch on C-SKY.

Signed-off-by: Mao Han <han_mao@xxxxxxxxx>
---
tools/perf/util/evsel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index dbc0466..89b87a0 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2305,7 +2305,7 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
if (data->user_regs.abi) {
u64 mask = evsel->attr.sample_regs_user;

- sz = hweight_long(mask) * sizeof(u64);
+ sz = hweight64(mask) * sizeof(u64);
OVERFLOW_CHECK(array, sz, max_size);
data->user_regs.mask = mask;
data->user_regs.regs = (u64 *)array;
--
2.7.4


--opJtzjQTFsWo+cga
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0003-perf-add-C-SKY-dwarf-support.patch"