logging: Fix backoff calculation to use K_CYC instead of K_TICK

The backoff timeout calculation in z_log_msg_claim_oldest() was
incorrectly using K_TICK macro. Changed to K_CYC to properly convert
cycle-based timing differences to kernel timeouts for accurate backoff
in multi-domain message processing.

Signed-off-by: Supper Thomas <78900636@qq.com>
This commit is contained in:
Supper Thomas
2025-12-31 07:38:48 +00:00
committed by Carles Cufí
parent c84a5eb24f
commit bd9bf13a0e

View File

@@ -759,9 +759,9 @@ union log_msg_generic *z_log_msg_claim_oldest(k_timeout_t *backoff)
* long processing shall back off.
*/
if (timestamp_freq == sys_clock_hw_cycles_per_sec()) {
*backoff = K_TICKS(diff);
*backoff = K_CYC(diff);
} else {
*backoff = K_TICKS((diff * sys_clock_hw_cycles_per_sec()) /
*backoff = K_CYC((diff * sys_clock_hw_cycles_per_sec()) /
timestamp_freq);
}