mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-24 11:25:43 +00:00
drivers/perf: riscv: Disable PERF_SAMPLE_BRANCH_* while not supported
[ Upstream commitea68731184
] RISC-V perf driver does not yet support branch sampling. Although the specification is in the works [0], it is best to disable such events until support is available, otherwise we will get unexpected results. Due to this reason, two riscv bpf testcases get_branch_snapshot and perf_branches/perf_branches_hw fail. Link: https://github.com/riscv/riscv-control-transfer-records [0] Fixes:f5bfa23f57
("RISC-V: Add a perf core library for pmu drivers") Signed-off-by: Pu Lehui <pulehui@huawei.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20240312012053.1178140-1-pulehui@huaweicloud.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
9aea12275d
commit
041fd5189f
1 changed files with 4 additions and 0 deletions
|
@ -313,6 +313,10 @@ static int riscv_pmu_event_init(struct perf_event *event)
|
|||
u64 event_config = 0;
|
||||
uint64_t cmask;
|
||||
|
||||
/* driver does not support branch stack sampling */
|
||||
if (has_branch_stack(event))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
hwc->flags = 0;
|
||||
mapped_event = rvpmu->event_map(event, &event_config);
|
||||
if (mapped_event < 0) {
|
||||
|
|
Loading…
Reference in a new issue