Skip to content

Commit b876941

Browse files
nordic-krchrlubos
authored andcommitted
[nrf fromtree] arch: riscv: Add support for CPU load measuring
Add sys_trace_idle_exit to RISCV cpu_idle functions and allow enabling CPU_LOAD module for RISCV and disable it for SMP. Signed-off-by: Krzysztof Chruściński <[email protected]> (cherry picked from commit 4026daa)
1 parent 0bfac91 commit b876941

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

arch/riscv/core/cpu_idle.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ void arch_cpu_idle(void)
1212
{
1313
sys_trace_idle();
1414
__asm__ volatile("wfi");
15+
sys_trace_idle_exit();
1516
irq_unlock(MSTATUS_IEN);
1617
}
1718
#endif
@@ -21,6 +22,7 @@ void arch_cpu_atomic_idle(unsigned int key)
2122
{
2223
sys_trace_idle();
2324
__asm__ volatile("wfi");
25+
sys_trace_idle_exit();
2426
irq_unlock(key);
2527
}
2628
#endif

subsys/debug/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,8 @@ config CS_TRACE_DEFMT
434434

435435
config CPU_LOAD
436436
select TRACING
437-
# Currently hooks are added only to Cortex M architecture.
438-
depends on CPU_CORTEX_M
437+
depends on CPU_CORTEX_M || RISCV
438+
depends on !SMP
439439
bool "CPU load measurement"
440440

441441
# Workaround for not being able to have commas in macro arguments

0 commit comments

Comments
 (0)