summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpencer Oliver <[email protected]>2026-09-09 18:39:13 +0100
committerGitHub <[email protected]>2026-09-09 13:39:13 -0400
commit4d90a0c21c2eea06aee1d43705ff8a02f393421f (patch)
treeeb82384432194f4b4d1337e6a520cd8536913db7
parent40db27e843e06657e5320049a2c10e215cc95dc4 (diff)
Stopped the win32 and win64 ports from enabling performance metrics and event trace (#676)
* 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 * win64: do not always enable performance metrics in tx_port.h if required they can be enabled in tx_user.h * 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) <[email protected]> --------- Co-authored-by: r <r@r> Co-authored-by: Frédéric Desbiens <[email protected]>
-rw-r--r--ports/win32/vs_2019/inc/tx_port.h47
-rw-r--r--ports/win64/vs_2022/inc/tx_port.h42
2 files changed, 12 insertions, 77 deletions
diff --git a/ports/win32/vs_2019/inc/tx_port.h b/ports/win32/vs_2019/inc/tx_port.h
index 5dd65653..655a2f69 100644
--- a/ports/win32/vs_2019/inc/tx_port.h
+++ b/ports/win32/vs_2019/inc/tx_port.h
@@ -155,47 +155,12 @@ extern TEST_FLAG test_forced_mutex_timeout;
#endif
-
-/* 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
-
+/* 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 2a44237d..eeabf651 100644
--- a/ports/win64/vs_2022/inc/tx_port.h
+++ b/ports/win64/vs_2022/inc/tx_port.h
@@ -160,42 +160,12 @@ extern TEST_FLAG test_forced_mutex_timeout;
#endif
-
-/* 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
-
-
+/* 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. */