From 63201d44372eccff025d267ee13ec139d4d52495 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 16 Mar 2026 21:55:53 -1000 Subject: [PATCH] Fix CodSpeed: use CODSPEED_ANALYSIS not CODSPEED_SIMULATION CodSpeed's CMake uses CODSPEED_ANALYSIS (not CODSPEED_SIMULATION) for simulation mode. This define gates all the actual benchmark measurement hooks in benchmark_runner.cpp and benchmark.h. Without it, benchmarks run normally but CodSpeed doesn't detect them as instrumented. --- script/cpp_benchmark.py | 2 +- script/setup_codspeed_lib.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script/cpp_benchmark.py b/script/cpp_benchmark.py index d349c41a8d..e26668a055 100755 --- a/script/cpp_benchmark.py +++ b/script/cpp_benchmark.py @@ -54,7 +54,7 @@ def run_benchmarks(selected_components: list[str], build_only: bool = False) -> project_root = Path(__file__).resolve().parent.parent codspeed_flags = [ "-DCODSPEED_ENABLED", - "-DCODSPEED_SIMULATION", + "-DCODSPEED_ANALYSIS", f'-DCODSPEED_ROOT_DIR=\\"{project_root}\\"', ] pio_options = { diff --git a/script/setup_codspeed_lib.py b/script/setup_codspeed_lib.py index b590587268..dbe703ff63 100755 --- a/script/setup_codspeed_lib.py +++ b/script/setup_codspeed_lib.py @@ -140,7 +140,7 @@ def _write_library_json( # CodSpeed instrumentation flags # https://codspeed.io/docs/benchmarks/cpp#custom-build-systems "-DCODSPEED_ENABLED", - "-DCODSPEED_SIMULATION", + "-DCODSPEED_ANALYSIS", f'-DCODSPEED_VERSION=\\"{version}\\"', f'-DCODSPEED_ROOT_DIR=\\"{project_root}\\"', '-DCODSPEED_MODE_DISPLAY=\\"simulation\\"',