This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit d82891cc6fb986c9efc17cb39acd4cd45e220597
Author: Marco Casaroli <[email protected]>
AuthorDate: Tue Nov 17 14:03:00 2026 +0100

    arch/x86_64/intel64: Build intel64_perf.c only with CONFIG_ARCH_PERF_EVENTS.
    
    Make.defs put "#ifdef CONFIG_ARCH_PERF_EVENTS" around the line that adds
    intel64_perf.c.  Make reads a line that starts with "#" as a comment, so
    the Make build compiled intel64_perf.c in every configuration.
    CMakeLists.txt already adds the file only with CONFIG_ARCH_PERF_EVENTS.
    Use ifeq, as for the other optional files.
    
    The CONFIG_ARCH_HAVE_PERF_EVENTS check in intel64_perf.c is then always
    true, because CONFIG_ARCH_PERF_EVENTS depends on it: remove it.
    
    [skip-cmake-parity]: CMakeLists.txt already has this condition.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 arch/x86_64/src/intel64/Make.defs      | 4 ++--
 arch/x86_64/src/intel64/intel64_perf.c | 4 ----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/x86_64/src/intel64/Make.defs 
b/arch/x86_64/src/intel64/Make.defs
index e7c536e7772..9f54fae2dfe 100644
--- a/arch/x86_64/src/intel64/Make.defs
+++ b/arch/x86_64/src/intel64/Make.defs
@@ -51,9 +51,9 @@ ifeq ($(CONFIG_STACK_COLORATION),y)
   CMN_CSRCS += intel64_checkstack.c
 endif
 
-#ifdef CONFIG_ARCH_PERF_EVENTS
+ifeq ($(CONFIG_ARCH_PERF_EVENTS),y)
   CMN_CSRCS += intel64_perf.c
-#endif
+endif
 
 ifeq ($(CONFIG_MM_PGALLOC),y)
 CHIP_CSRCS += intel64_pgalloc.c
diff --git a/arch/x86_64/src/intel64/intel64_perf.c 
b/arch/x86_64/src/intel64/intel64_perf.c
index 67954bfe903..1a57bb49860 100644
--- a/arch/x86_64/src/intel64/intel64_perf.c
+++ b/arch/x86_64/src/intel64/intel64_perf.c
@@ -29,8 +29,6 @@
 
 #include "x86_64_internal.h"
 
-#ifdef CONFIG_ARCH_HAVE_PERF_EVENTS
-
 /****************************************************************************
  * Private Data
  ****************************************************************************/
@@ -66,5 +64,3 @@ void up_perf_convert(clock_t elapsed, struct timespec *ts)
   left        = elapsed - ts->tv_sec * g_x86_64_timer_freq;
   ts->tv_nsec = NSEC_PER_SEC * left / g_x86_64_timer_freq;
 }
-#endif
-

Reply via email to