From eadd52e8385019b8d441ea1755bd09788cdf7ec9 Mon Sep 17 00:00:00 2001 From: not-matthias Date: Tue, 20 Oct 2026 12:17:58 +0200 Subject: [PATCH] fix(callgrind): suppress L3 warning for explicit LL settings Cache detection logs that the host L3 will be used before command-line overrides are applied. Track whether LL comes from the command line and suppress that misleading warning when --LL or --L2 is supplied. Keep auto-detection and cache simulation unchanged. --- CODSPEED-CHANGELOG.md | 9 +++++++++ cachegrind/cg_arch.c | 10 ++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CODSPEED-CHANGELOG.md b/CODSPEED-CHANGELOG.md index 7e074a9b1..b23161144 100644 --- a/CODSPEED-CHANGELOG.md +++ b/CODSPEED-CHANGELOG.md @@ -2,6 +2,15 @@ This file documents changes made to Valgrind for CodSpeed integration, beyond the baseline Valgrind distribution. +## Fixes + +### Cache simulation: suppress the host L3 warning for explicit LL settings + +Callgrind and Cachegrind no longer print the warning about using the host's +last-level cache when `--LL` (or its `--L2` alias) supplies the cache configuration. +The warning remains when LL is auto-detected. Cache geometry and simulation +results are unchanged. + ## Features ### Skip `.plt.sec` in `--skip-plt` diff --git a/cachegrind/cg_arch.c b/cachegrind/cg_arch.c index f877f95c7..766828d0d 100644 --- a/cachegrind/cg_arch.c +++ b/cachegrind/cg_arch.c @@ -35,7 +35,8 @@ #include "cg_arch.h" static void configure_caches(cache_t* I1c, cache_t* D1c, cache_t* LLc, - Bool all_caches_clo_defined); + Bool all_caches_clo_defined, + Bool ll_clo_defined); // Checks cache config is ok. Returns NULL if ok, or a pointer to an error // string otherwise. @@ -294,7 +295,8 @@ void VG_(post_clo_init_configure_caches)(cache_t* I1c, // Set the cache config (using auto-detection, if supported by the // architecture). - configure_caches( I1c, D1c, LLc, all_caches_clo_defined ); + configure_caches( I1c, D1c, LLc, all_caches_clo_defined, + DEFINED(clo_LLc) ); maybe_tweak_LLc( LLc ); @@ -350,7 +352,7 @@ locate_cache(const VexCacheInfo *ci, VexCacheKind kind, UInt level) // overridden by any cache configurations specified on the command line. static void configure_caches(cache_t *I1c, cache_t *D1c, cache_t *LLc, - Bool all_caches_clo_defined) + Bool all_caches_clo_defined, Bool ll_clo_defined) { VexArchInfo vai; const VexCacheInfo *ci; @@ -368,7 +370,7 @@ configure_caches(cache_t *I1c, cache_t *D1c, cache_t *LLc, VG_(dmsg)("warning: L2 cache not installed, ignore LL results.\n"); } - if (ll && ci->num_levels > 2) { + if (ll && ci->num_levels > 2 && !ll_clo_defined) { VG_(dmsg)("warning: L%u cache found, using its data for the " "LL simulation.\n", ci->num_levels); }