]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: perf: Correct the event index in sysfs
authorShaokun Zhang <zhangshaokun@hisilicon.com>
Thu, 18 Jun 2020 13:35:44 +0000 (21:35 +0800)
committerWill Deacon <will@kernel.org>
Mon, 20 Jul 2020 10:24:08 +0000 (11:24 +0100)
commit5764e423f1f90eb7a3170cb1d8cb1c53a6f817c9
tree520aa34f0c88681f3363010797f8105586f9ce94
parent798cdd9c1fdca94d205ad4bb70dbf11b7d9c53fb
arm64: perf: Correct the event index in sysfs

When PMU event ID is equal or greater than 0x4000, it will be reduced
by 0x4000 and it is not the raw number in the sysfs. Let's correct it
and obtain the raw event ID.

Before this patch:
cat /sys/bus/event_source/devices/armv8_pmuv3_0/events/sample_feed
event=0x001
After this patch:
cat /sys/bus/event_source/devices/armv8_pmuv3_0/events/sample_feed
event=0x4001

Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/1592487344-30555-3-git-send-email-zhangshaokun@hisilicon.com
[will: fixed formatting of 'if' condition]
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/perf_event.c