/* * 模块名称:主机侧单测桩 - dbg_log.h(soe_store 套件专用) * 模块功能:DBG_* 换成计数,让"post 侧一条日志都不许打、drain 侧按差值只打一次" * 成为可断言的行为。 * * ⚠ 仅供 test/host/soe_store/ 使用,不参与 MCU 构建。 * * 为什么这条计数在本模块**尤其**重要(App/log/soe_store.c 的函数头原话): * soe_store_post() 由 protectTask 调用,该任务的静态最坏链 = 经 s_log_active_edge * 的 console 尾链(872 B,B5 实测),post 里任何日志调用点都会再垫高一帧 * (stack_report 实测 +320 B → FAIL)。所以"post 零 DBG"不是风格问题, * 是栈预算硬约束;真实宏展开成 snprintf + 192 B 行缓冲,只有把宏换成计数 * 才能在主机上把这条钉住。 * * 创建日期:2026-10-24 */ #ifndef DBG_LOG_H #define DBG_LOG_H /* 计数定义在 soe_store_test.c */ extern int g_soe_err_count; extern int g_soe_info_count; extern int g_soe_debug_count; #define DBG_INFO(fmt, ...) do { (void)(fmt); g_soe_info_count++; } while (0) #define DBG_DEBUG(fmt, ...) do { (void)(fmt); g_soe_debug_count++; } while (0) #define DBG_ERROR(fmt, ...) do { (void)(fmt); g_soe_err_count++; } while (0) #endif /* DBG_LOG_H */