mirror of
https://github.com/eclipse-threadx/threadx.git
synced 2026-10-06 06:59:08 +08:00
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) <noreply@anthropic.com> --------- Co-authored-by: r <r@r> Co-authored-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
This commit is contained in:
co-authored by
r
Frédéric Desbiens
parent
40db27e843
commit
4d90a0c21c
@@ -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. */
|
||||
|
||||
|
||||
@@ -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. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user