This is an automated email from Gerrit.

"Tormod Volden <[email protected]>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9198

-- gerrit

commit 82d97bd9342505eec11756bfbe01295d31c3b020
Author: Tormod Volden <[email protected]>
Date:   Sat Nov 1 21:59:37 2025 +0100

    rtt: Don't log repeated control block searches
    
    Move the log message from the target function, which will be called
    repeatedly in the case of retries, into the rtt_start() where it can
    be special-cased and rate-limited.
    
    Change-Id: I563a76888146a966d2cdf16be6c5d8f6d5d369be
    Signed-off-by: Tormod Volden <[email protected]>

diff --git a/src/rtt/rtt.c b/src/rtt/rtt.c
index ba818d4234..f5bb1cad0f 100644
--- a/src/rtt/rtt.c
+++ b/src/rtt/rtt.c
@@ -134,11 +134,15 @@ int rtt_start(void)
 {
        int ret;
        target_addr_t addr = rtt.addr;
+       static bool running_search;
 
        if (rtt.started)
                return ERROR_OK;
 
        if (!rtt.found_cb || rtt.changed) {
+               if (!running_search)
+                       LOG_INFO("rtt: Searching for control block '%s'", 
rtt.id);
+
                rtt.source.find_cb(rtt.target, &addr, rtt.size, rtt.id,
                        &rtt.found_cb, NULL);
 
@@ -148,13 +152,16 @@ int rtt_start(void)
                        LOG_INFO("rtt: Control block found at 0x%" 
TARGET_PRIxADDR,
                                addr);
                        rtt.ctrl.address = addr;
+                       running_search = false;
                } else {
                        if (rtt.start_retry_interval) {
+                               running_search = true;
                                
target_register_timer_callback(&rtt_start_retry_callback,
                                        rtt.start_retry_interval, 
TARGET_TIMER_TYPE_ONESHOT, NULL);
                                return ERROR_OK;
                        }
                        LOG_ERROR("rtt: No control block found");
+                       running_search = false;
                        return ERROR_FAIL;
                }
        }
diff --git a/src/target/rtt.c b/src/target/rtt.c
index a8ab24a60b..6eb1ca58e8 100644
--- a/src/target/rtt.c
+++ b/src/target/rtt.c
@@ -248,8 +248,6 @@ int target_rtt_find_control_block(struct target *target,
        size_t id_matched_length = 0;
        const size_t id_length = strlen(id);
 
-       LOG_INFO("rtt: Searching for control block '%s'", id);
-
        for (target_addr_t addr = *address; addr < address_end; addr += 
sizeof(buf)) {
                int ret;
 

-- 

Reply via email to