From af930d50f89c1a22e5a6b1cb8252ed6d62a5d99f Mon Sep 17 00:00:00 2001 From: Spencer Oliver Date: Fri, 28 Aug 2026 09:31:46 +0100 Subject: [PATCH 1/3] win32: do not always enable trace or performance metrics in tx_port.h if these are required they can be enabled in tx_user.h --- ports/win32/vs_2019/inc/tx_port.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/win32/vs_2019/inc/tx_port.h b/ports/win32/vs_2019/inc/tx_port.h index 5dd656534..f7342d8d8 100644 --- a/ports/win32/vs_2019/inc/tx_port.h +++ b/ports/win32/vs_2019/inc/tx_port.h @@ -155,7 +155,7 @@ extern TEST_FLAG test_forced_mutex_timeout; #endif - +#if 0 /* Define performance metric symbols. */ #ifndef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO @@ -196,6 +196,7 @@ extern TEST_FLAG test_forced_mutex_timeout; #define TX_ENABLE_EVENT_TRACE #endif +#endif /* Define ThreadX basic types for this port. */ From 39c218a648372733fc6bfbbb7e9bcb4b51bafd30 Mon Sep 17 00:00:00 2001 From: Spencer Oliver Date: Thu, 3 Sep 2026 17:27:20 +0100 Subject: [PATCH 2/3] win64: do not always enable performance metrics in tx_port.h if required they can be enabled in tx_user.h --- ports/win64/vs_2022/inc/tx_port.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/win64/vs_2022/inc/tx_port.h b/ports/win64/vs_2022/inc/tx_port.h index 2a44237d8..3beb4434a 100644 --- a/ports/win64/vs_2022/inc/tx_port.h +++ b/ports/win64/vs_2022/inc/tx_port.h @@ -160,6 +160,7 @@ extern TEST_FLAG test_forced_mutex_timeout; #endif +#if 0 /* Define performance metric symbols. */ @@ -195,7 +196,7 @@ extern TEST_FLAG test_forced_mutex_timeout; #define TX_TIMER_ENABLE_PERFORMANCE_INFO #endif - +#endif /* Define ThreadX basic types for this port. */ From 976f7942e30eaabbb60b88708f882b6f1044a0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Desbiens?= Date: Wed, 9 Sep 2026 13:20:46 -0400 Subject: [PATCH 3/3] Removed the disabled blocks rather than commenting them out The win32 and win64 ports were the only two that turned performance metrics on for the application, and win32 the only one that turned event trace on. Leaving those to tx_user.h is right: the symbols extend the control blocks, so a port that sets them behind the application's back changes structures the application also sees. The blocks were disabled with #if 0 rather than deleted. That is the form MISRA C:2012 Directive 4.4 is about -- sections of code should not be commented out -- and it leaves two copies of a list that now has no reader. They are removed, and a short note in their place says where the symbols belong and why the port does not set them. No behaviour change beyond what this pull request already made. Checked that the preprocessor nesting in both headers is still balanced. Worth recording for whoever looks next: with this in, no port defines either symbol. The linux port carries the same list commented out, which reads at a glance like a third case but is not one. Assisted-by: Claude Code (Opus 5) --- ports/win32/vs_2019/inc/tx_port.h | 48 ++++--------------------------- ports/win64/vs_2022/inc/tx_port.h | 43 ++++----------------------- 2 files changed, 12 insertions(+), 79 deletions(-) diff --git a/ports/win32/vs_2019/inc/tx_port.h b/ports/win32/vs_2019/inc/tx_port.h index f7342d8d8..655a2f697 100644 --- a/ports/win32/vs_2019/inc/tx_port.h +++ b/ports/win32/vs_2019/inc/tx_port.h @@ -155,48 +155,12 @@ extern TEST_FLAG test_forced_mutex_timeout; #endif -#if 0 -/* Define performance metric symbols. */ - -#ifndef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO -#define TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO -#endif - -#ifndef TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO -#define TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO -#endif - -#ifndef TX_EVENT_FLAGS_ENABLE_PERFORMANCE_INFO -#define TX_EVENT_FLAGS_ENABLE_PERFORMANCE_INFO -#endif - -#ifndef TX_MUTEX_ENABLE_PERFORMANCE_INFO -#define TX_MUTEX_ENABLE_PERFORMANCE_INFO -#endif - -#ifndef TX_QUEUE_ENABLE_PERFORMANCE_INFO -#define TX_QUEUE_ENABLE_PERFORMANCE_INFO -#endif - -#ifndef TX_SEMAPHORE_ENABLE_PERFORMANCE_INFO -#define TX_SEMAPHORE_ENABLE_PERFORMANCE_INFO -#endif - -#ifndef TX_THREAD_ENABLE_PERFORMANCE_INFO -#define TX_THREAD_ENABLE_PERFORMANCE_INFO -#endif - -#ifndef TX_TIMER_ENABLE_PERFORMANCE_INFO -#define TX_TIMER_ENABLE_PERFORMANCE_INFO -#endif - -/* Enable trace info. */ - -#ifndef TX_ENABLE_EVENT_TRACE -#define TX_ENABLE_EVENT_TRACE -#endif - -#endif +/* Performance metrics and event trace are left to the application. Set the + TX_*_ENABLE_PERFORMANCE_INFO symbols, or TX_ENABLE_EVENT_TRACE, in + tx_user.h or on the command line when they are wanted. They extend the + control blocks, so a port that turns them on behind the application's + back changes structures the application also sees. This port and the + win64 one were the only two that did. */ /* Define ThreadX basic types for this port. */ diff --git a/ports/win64/vs_2022/inc/tx_port.h b/ports/win64/vs_2022/inc/tx_port.h index 3beb4434a..eeabf651c 100644 --- a/ports/win64/vs_2022/inc/tx_port.h +++ b/ports/win64/vs_2022/inc/tx_port.h @@ -160,43 +160,12 @@ extern TEST_FLAG test_forced_mutex_timeout; #endif -#if 0 - -/* Define performance metric symbols. */ - -#ifndef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO -#define TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO -#endif - -#ifndef TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO -#define TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO -#endif - -#ifndef TX_EVENT_FLAGS_ENABLE_PERFORMANCE_INFO -#define TX_EVENT_FLAGS_ENABLE_PERFORMANCE_INFO -#endif - -#ifndef TX_MUTEX_ENABLE_PERFORMANCE_INFO -#define TX_MUTEX_ENABLE_PERFORMANCE_INFO -#endif - -#ifndef TX_QUEUE_ENABLE_PERFORMANCE_INFO -#define TX_QUEUE_ENABLE_PERFORMANCE_INFO -#endif - -#ifndef TX_SEMAPHORE_ENABLE_PERFORMANCE_INFO -#define TX_SEMAPHORE_ENABLE_PERFORMANCE_INFO -#endif - -#ifndef TX_THREAD_ENABLE_PERFORMANCE_INFO -#define TX_THREAD_ENABLE_PERFORMANCE_INFO -#endif - -#ifndef TX_TIMER_ENABLE_PERFORMANCE_INFO -#define TX_TIMER_ENABLE_PERFORMANCE_INFO -#endif - -#endif +/* Performance metrics and event trace are left to the application. Set the + TX_*_ENABLE_PERFORMANCE_INFO symbols, or TX_ENABLE_EVENT_TRACE, in + tx_user.h or on the command line when they are wanted. They extend the + control blocks, so a port that turns them on behind the application's + back changes structures the application also sees. This port and the + win32 one were the only two that did. */ /* Define ThreadX basic types for this port. */