From b1908587ee1d78a061cb81e8929cf767b17bead2 Mon Sep 17 00:00:00 2001 From: jpirnay Date: Wed, 20 May 2026 10:57:46 +0200 Subject: [PATCH] Reduce non-sensical logs --- lib/EpdFont/FontDecompressor.cpp | 6 ++++++ lib/EpdFont/SdCardFont.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lib/EpdFont/FontDecompressor.cpp b/lib/EpdFont/FontDecompressor.cpp index 3c05e77e..9694c81c 100644 --- a/lib/EpdFont/FontDecompressor.cpp +++ b/lib/EpdFont/FontDecompressor.cpp @@ -567,6 +567,12 @@ void FontDecompressor::resetStats() { stats = Stats{}; } void FontDecompressor::logStats(const char* label) { const uint32_t total = stats.cacheHits + stats.cacheMisses; + // Suppress the block entirely when the decompressor was untouched this phase + // (e.g. an SD-card font page — FontCacheManager early-returns before invoking us). + if (total == 0 && stats.pageBufferBytes == 0 && stats.decompressTimeMs == 0 && stats.getBitmapCalls == 0) { + resetStats(); + return; + } LOG_DBG("FDC", "[%s] hits=%lu misses=%lu (%.1f%% hit rate)", label, stats.cacheHits, stats.cacheMisses, total > 0 ? 100.0f * stats.cacheHits / total : 0.0f); LOG_DBG("FDC", "[%s] decompress=%lums groups_accessed=%u", label, stats.decompressTimeMs, stats.uniqueGroupsAccessed); diff --git a/lib/EpdFont/SdCardFont.cpp b/lib/EpdFont/SdCardFont.cpp index 725bf8bd..939f6be8 100644 --- a/lib/EpdFont/SdCardFont.cpp +++ b/lib/EpdFont/SdCardFont.cpp @@ -1331,6 +1331,12 @@ void SdCardFont::clearAccumulation() { // --- Stats --- void SdCardFont::logStats(const char* label) { + // Suppress when this font wasn't touched this phase — FontCacheManager iterates every + // registered SD font, but only the active one for the page will have non-zero stats. + if (stats_.prewarmTotalMs == 0 && stats_.sdReadTimeMs == 0 && stats_.seekCount == 0 && stats_.uniqueGlyphs == 0 && + stats_.bitmapBytes == 0) { + return; + } LOG_DBG("SDCF", "[%s] total=%ums sd_read=%ums seeks=%u glyphs=%u bitmap=%u bytes", label, stats_.prewarmTotalMs, stats_.sdReadTimeMs, stats_.seekCount, stats_.uniqueGlyphs, stats_.bitmapBytes); }