Skip to contentSkip to conversation

RISC-V: Enable perf events by default

PATCH Superseded Anup Patel 3 participants 3 messages Mar 23, 2022 – Mar 24, 2022 RISC-V

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Anup Patel

author
#0 lore raw

PATCH 1/1 RISC-V: Enable perf events by default

Let us enable perf events by default in RV32 and RV64 defconfigs so that we can use RISC-V PMU drivers on various RISC-V platforms.

---
 arch/riscv/configs/defconfig      | 1 +
 arch/riscv/configs/rv32_defconfig | 1 +
 2 files changed, 2 insertions(+)
arch/riscv/configs/defconfig +1 -0
index f120fcc43d0a..57aaedc7cf74 100644
@@ -15,6 +15,7 @@ CONFIG_CHECKPOINT_RESTORE=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 # CONFIG_SYSFS_SYSCALL is not set
+CONFIG_PERF_EVENTS=y
 CONFIG_SOC_MICROCHIP_POLARFIRE=y
 CONFIG_SOC_SIFIVE=y
 CONFIG_SOC_VIRT=y
arch/riscv/configs/rv32_defconfig +1 -0
index 8b56a7f1eb06..21d422e740d5 100644
@@ -15,6 +15,7 @@ CONFIG_CHECKPOINT_RESTORE=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 # CONFIG_SYSFS_SYSCALL is not set
+CONFIG_PERF_EVENTS=y
 CONFIG_SOC_SIFIVE=y
 CONFIG_SOC_VIRT=y
 CONFIG_ARCH_RV32I=y
Signature · 1 line
2.25.1
#1 lore raw
Quoted 35 lines · Anup Patel

Let us enable perf events by default in RV32 and RV64 defconfigs so that we can use RISC-V PMU drivers on various RISC-V platforms.

---
 arch/riscv/configs/defconfig      | 1 +
 arch/riscv/configs/rv32_defconfig | 1 +
 2 files changed, 2 insertions(+)
arch/riscv/configs/defconfig +1 -0
index f120fcc43d0a..57aaedc7cf74 100644
@@ -15,6 +15,7 @@ CONFIG_CHECKPOINT_RESTORE=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 # CONFIG_SYSFS_SYSCALL is not set
+CONFIG_PERF_EVENTS=y
 CONFIG_SOC_MICROCHIP_POLARFIRE=y
 CONFIG_SOC_SIFIVE=y
 CONFIG_SOC_VIRT=y
arch/riscv/configs/rv32_defconfig +1 -1
index 8b56a7f1eb06..21d422e740d5 100644
@@ -15,6 +15,7 @@ CONFIG_CHECKPOINT_RESTORE=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 # CONFIG_SYSFS_SYSCALL is not set
+CONFIG_PERF_EVENTS=y
 CONFIG_SOC_SIFIVE=y
 CONFIG_SOC_VIRT=y
 CONFIG_ARCH_RV32I=y
--
Quoted 2 lines

2.25.1

I think it is better to enable perf events by adding CONFIG_PROFILING to the defconfig similar to other ISAs.

Signature · 2 lines
Regards,
Atish
#2 lore raw
Quoted 34 lines · Atish Patra
Quoted 32 lines · Anup Patel

Let us enable perf events by default in RV32 and RV64 defconfigs so that we can use RISC-V PMU drivers on various RISC-V platforms.

---
 arch/riscv/configs/defconfig      | 1 +
 arch/riscv/configs/rv32_defconfig | 1 +
 2 files changed, 2 insertions(+)
arch/riscv/configs/defconfig +1 -0
index f120fcc43d0a..57aaedc7cf74 100644
@@ -15,6 +15,7 @@ CONFIG_CHECKPOINT_RESTORE=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 # CONFIG_SYSFS_SYSCALL is not set
+CONFIG_PERF_EVENTS=y
 CONFIG_SOC_MICROCHIP_POLARFIRE=y
 CONFIG_SOC_SIFIVE=y
 CONFIG_SOC_VIRT=y
arch/riscv/configs/rv32_defconfig +1 -0
index 8b56a7f1eb06..21d422e740d5 100644
@@ -15,6 +15,7 @@ CONFIG_CHECKPOINT_RESTORE=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 # CONFIG_SYSFS_SYSCALL is not set
+CONFIG_PERF_EVENTS=y
 CONFIG_SOC_SIFIVE=y
Quoted 8 lines
Quoted 5 lines
arch/riscv/configs/rv32_defconfig +0 -1
 CONFIG_SOC_VIRT=y
 CONFIG_ARCH_RV32I=y
--

2.25.1

I think it is better to enable perf events by adding CONFIG_PROFILING to the defconfig similar to other ISAs.

Sure, I will update this patch like you suggested.

Regards,
Anup

Quoted 4 lines

--
Regards,
Atish