This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 56ad0d6837783479d7be99cdedc8d0ac99406cc9 Author: Jukka Laitinen <jukka.laiti...@tii.ae> AuthorDate: Thu Jun 5 08:34:33 2025 +0300 arch: Flag all definitions of up_perf_* functions with CONFIG_ARCH_HAVE_PERF_EVENTS Use the flag CONFIG_ARCH_HAVE_PERF_EVENTS to detect whether the architecture specific code provides the up_perf_* functions. Now it is mixed with CONFIG_ARCH_PERF_EVENTS, which should select just whether the perf events (perf_*) are enabled for the configuration. - drivers/timers/arch_alarm.c: Don't compile the up_perf_* functions here if the CONFIG_ARCH_HAVE_PERF_EVENTS is defined - arch/*/*_perf.c: Change CONFIG_ARCH_PERF_EVENTS -> CONFIG_ARCH_HAVE_PERF_EVENTS to select whether architecture specific up_perf_* functions are provided Signed-off-by: Jukka Laitinen <jukka.laiti...@tii.ae> --- arch/arm/src/armv7-a/arm_perf.c | 2 +- arch/arm/src/armv7-m/arm_perf.c | 2 +- arch/arm/src/armv7-r/arm_perf.c | 2 +- arch/arm/src/armv8-m/arm_perf.c | 2 +- arch/arm/src/armv8-r/arm_perf.c | 2 +- arch/arm64/src/common/arm64_perf.c | 2 +- arch/risc-v/src/common/riscv_perf_cycle.c | 2 +- arch/risc-v/src/common/riscv_perf_time.c | 2 +- arch/risc-v/src/esp32c3-legacy/esp32c3_perf.c | 2 +- arch/x86_64/src/intel64/intel64_perf.c | 2 +- arch/xtensa/src/common/xtensa_perf.c | 2 +- drivers/timers/arch_alarm.c | 2 +- drivers/timers/arch_timer.c | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/arm/src/armv7-a/arm_perf.c b/arch/arm/src/armv7-a/arm_perf.c index 424596acaa..f06785f8c9 100644 --- a/arch/arm/src/armv7-a/arm_perf.c +++ b/arch/arm/src/armv7-a/arm_perf.c @@ -31,7 +31,7 @@ #include "arm_timer.h" #include "sctlr.h" -#ifdef CONFIG_ARCH_PERF_EVENTS +#ifdef CONFIG_ARCH_HAVE_PERF_EVENTS /**************************************************************************** * Private Data diff --git a/arch/arm/src/armv7-m/arm_perf.c b/arch/arm/src/armv7-m/arm_perf.c index 28dd4f236e..a8b58c5ea9 100644 --- a/arch/arm/src/armv7-m/arm_perf.c +++ b/arch/arm/src/armv7-m/arm_perf.c @@ -32,7 +32,7 @@ #include "itm.h" #include "nvic.h" -#ifdef CONFIG_ARCH_PERF_EVENTS +#ifdef CONFIG_ARCH_HAVE_PERF_EVENTS /**************************************************************************** * Private Data diff --git a/arch/arm/src/armv7-r/arm_perf.c b/arch/arm/src/armv7-r/arm_perf.c index 63fe29057c..d32a7a365e 100644 --- a/arch/arm/src/armv7-r/arm_perf.c +++ b/arch/arm/src/armv7-r/arm_perf.c @@ -31,7 +31,7 @@ #include "arm_timer.h" #include "sctlr.h" -#ifdef CONFIG_ARCH_PERF_EVENTS +#ifdef CONFIG_ARCH_HAVE_PERF_EVENTS /**************************************************************************** * Private Data diff --git a/arch/arm/src/armv8-m/arm_perf.c b/arch/arm/src/armv8-m/arm_perf.c index e7b1e56ed6..826d4a31d4 100644 --- a/arch/arm/src/armv8-m/arm_perf.c +++ b/arch/arm/src/armv8-m/arm_perf.c @@ -32,7 +32,7 @@ #include "itm.h" #include "nvic.h" -#ifdef CONFIG_ARCH_PERF_EVENTS +#ifdef CONFIG_ARCH_HAVE_PERF_EVENTS /**************************************************************************** * Private Data diff --git a/arch/arm/src/armv8-r/arm_perf.c b/arch/arm/src/armv8-r/arm_perf.c index 51e04b36f8..5123562d45 100644 --- a/arch/arm/src/armv8-r/arm_perf.c +++ b/arch/arm/src/armv8-r/arm_perf.c @@ -30,7 +30,7 @@ #include "arm_internal.h" #include "sctlr.h" -#ifdef CONFIG_ARCH_PERF_EVENTS +#ifdef CONFIG_ARCH_HAVE_PERF_EVENTS /**************************************************************************** * Private Data diff --git a/arch/arm64/src/common/arm64_perf.c b/arch/arm64/src/common/arm64_perf.c index c1ddeb488c..6d042ee778 100644 --- a/arch/arm64/src/common/arm64_perf.c +++ b/arch/arm64/src/common/arm64_perf.c @@ -28,7 +28,7 @@ #include "arm64_pmu.h" -#ifdef CONFIG_ARCH_PERF_EVENTS +#ifdef CONFIG_ARCH_HAVE_PERF_EVENTS /**************************************************************************** * Private Data diff --git a/arch/risc-v/src/common/riscv_perf_cycle.c b/arch/risc-v/src/common/riscv_perf_cycle.c index 1bceac80b3..5ff5803a9b 100644 --- a/arch/risc-v/src/common/riscv_perf_cycle.c +++ b/arch/risc-v/src/common/riscv_perf_cycle.c @@ -32,7 +32,7 @@ #include "riscv_internal.h" -#ifdef CONFIG_ARCH_PERF_EVENTS +#ifdef CONFIG_ARCH_HAVE_PERF_EVENTS /**************************************************************************** * Private Data diff --git a/arch/risc-v/src/common/riscv_perf_time.c b/arch/risc-v/src/common/riscv_perf_time.c index 2d27eb1842..d7eaff4e75 100644 --- a/arch/risc-v/src/common/riscv_perf_time.c +++ b/arch/risc-v/src/common/riscv_perf_time.c @@ -32,7 +32,7 @@ #include "riscv_internal.h" -#ifdef CONFIG_ARCH_PERF_EVENTS +#ifdef CONFIG_ARCH_HAVE_PERF_EVENTS /**************************************************************************** * Private Data diff --git a/arch/risc-v/src/esp32c3-legacy/esp32c3_perf.c b/arch/risc-v/src/esp32c3-legacy/esp32c3_perf.c index 49c25c35d8..4cb6af9fe4 100644 --- a/arch/risc-v/src/esp32c3-legacy/esp32c3_perf.c +++ b/arch/risc-v/src/esp32c3-legacy/esp32c3_perf.c @@ -35,7 +35,7 @@ #include "hardware/esp32c3_system.h" #include "esp32c3_clockconfig.h" -#ifdef CONFIG_ARCH_PERF_EVENTS +#ifdef CONFIG_ARCH_HAVE_PERF_EVENTS /**************************************************************************** * Pre-processor Definitions diff --git a/arch/x86_64/src/intel64/intel64_perf.c b/arch/x86_64/src/intel64/intel64_perf.c index d744c6f178..cd0c281372 100644 --- a/arch/x86_64/src/intel64/intel64_perf.c +++ b/arch/x86_64/src/intel64/intel64_perf.c @@ -29,7 +29,7 @@ #include "x86_64_internal.h" -#ifdef CONFIG_ARCH_PERF_EVENTS +#ifdef CONFIG_ARCH_HAVE_PERF_EVENTS /**************************************************************************** * Private Data diff --git a/arch/xtensa/src/common/xtensa_perf.c b/arch/xtensa/src/common/xtensa_perf.c index b45b7b6660..9898337afd 100644 --- a/arch/xtensa/src/common/xtensa_perf.c +++ b/arch/xtensa/src/common/xtensa_perf.c @@ -30,7 +30,7 @@ #include "xtensa_counter.h" #include "xtensa.h" -#ifdef CONFIG_ARCH_PERF_EVENTS +#ifdef CONFIG_ARCH_HAVE_PERF_EVENTS /**************************************************************************** * Private Data diff --git a/drivers/timers/arch_alarm.c b/drivers/timers/arch_alarm.c index d2a3b0b8db..8133ec0ff8 100644 --- a/drivers/timers/arch_alarm.c +++ b/drivers/timers/arch_alarm.c @@ -351,7 +351,7 @@ int weak_function up_alarm_tick_start(clock_t ticks) * units. ****************************************************************************/ -#ifndef CONFIG_ARCH_PERF_EVENTS +#ifndef CONFIG_ARCH_HAVE_PERF_EVENTS void up_perf_init(FAR void *arg) { UNUSED(arg); diff --git a/drivers/timers/arch_timer.c b/drivers/timers/arch_timer.c index 8622e6b705..a6caacb59b 100644 --- a/drivers/timers/arch_timer.c +++ b/drivers/timers/arch_timer.c @@ -399,7 +399,7 @@ int weak_function up_timer_tick_start(clock_t ticks) * units. ****************************************************************************/ -#ifndef CONFIG_ARCH_PERF_EVENTS +#ifndef CONFIG_ARCH_HAVE_PERF_EVENTS void up_perf_init(FAR void *arg) { UNUSED(arg);