Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] [testsuite] Log gdb_do_cache misses only, not hits
@ 2026-06-19  8:16 Luis Machado
  2026-06-19 13:16 ` Guinevere Larsen
  0 siblings, 1 reply; 3+ messages in thread
From: Luis Machado @ 2026-06-19  8:16 UTC (permalink / raw)
  To: gdb-patches

The verbose -log in gdb_do_cache fired unconditionally on every call,
including cache hits.  With many tests calling gdb_caching_procs like
get_compiler_info_1 per compilation, this produced dozens of repeated
identical lines per test file in the log, like so:

gdb_do_cache: get_compiler_info_1 ( c )
gdb_do_cache: get_compiler_info_1 ( c )
gdb_do_cache: get_compiler_info_1 ( c )
gdb_do_cache: get_compiler_info_1 ( c )
gdb_do_cache: get_compiler_info_1 ( c )
gdb_do_cache: get_compiler_info_1 ( c )
gdb_do_cache: get_compiler_info_1 ( c )
gdb_do_cache: get_compiler_info_1 ( c )

Move the log to just before actual computation, after both the
in-memory and on-disk cache checks. This helps keep the logs clean.
---
 gdb/testsuite/lib/cache.exp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gdb/testsuite/lib/cache.exp b/gdb/testsuite/lib/cache.exp
index 71688ee373e..1ba8c881716 100644
--- a/gdb/testsuite/lib/cache.exp
+++ b/gdb/testsuite/lib/cache.exp
@@ -103,8 +103,6 @@ proc gdb_do_cache {name args} {
     global gdb_data_cache objdir
     global GDB_PARALLEL
 
-    verbose -log "gdb_do_cache: $name ( $args )"
-
     # Normally, if we have a cached value, we skip computation and return
     # the cached value.  If set to 1, instead don't skip computation and
     # verify against the cached value.
@@ -195,6 +193,7 @@ proc gdb_do_cache {name args} {
     set old_gdb_nested_caching_proc_calls $::gdb_nested_caching_proc_calls
     set ::gdb_nested_caching_proc_calls {}
 
+    verbose -log "gdb_do_cache: $name ( $args )"
     set real_name gdb_real__$name
     set gdb_data_cache(${cache_name},value) [gdb_do_cache_wrap $real_name {*}$args]
     set gdb_data_cache(${cache_name},exit) $::gdb_exit_called
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-19 13:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-19  8:16 [PATCH] [testsuite] Log gdb_do_cache misses only, not hits Luis Machado
2026-06-19 13:16 ` Guinevere Larsen
2026-06-19 13:34   ` Machado, Luis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox