Compilation error in _txm_module_manager_stop.c when TX_ENABLE_EVENT_TRACE is defined

HugPeter-9392 246 Reputation points
2023-01-04T10:15:05.887+00:00

Hello
I'm uncertain how _txm_module_manager_stop.c should be compiled when TraceX is in use.

I defined TX_ENABLE_EVENT_TRACE. Then I observe IAR compiler errors when compiling _txm_module_manager_stop.c. The identifiers '_tx_trace_buffer_current_ptr' and '_tx_trace_header_ptr' are undefined. I think including of the file tx_trace.h is missing.

Questions:

  1. Is it safe to include tx_trace.h after tx_api.h on top of file _txm_module_manager_stop.c?
  2. Is it intended to modify the ThreadX source code in this situation? Or am I missing something like a configuration option?

May you judge this as a bug. Then it would be helpful to resolve it in next release of TraceX/ThreadX.

Thanks
Peter

Azure RTOS
Azure RTOS
An Azure embedded development suite including a small but powerful operating system for resource-constrained devices.
331 questions
{count} votes

1 answer

Sort by: Most helpful
  1. LeelaRajeshSayana-MSFT 14,831 Reputation points Microsoft Employee
    2023-01-04T21:21:22.233+00:00

    Hi @HugPeter-9392 , thank you for posting this question. I have looked into the ThreadX GitHub repository to check the dependency between tx_trace.h and TX_ENABLE_EVENT_TRACE. I have found a file tx_block_allocate.c in which they define TX_ENABLE_EVENT_TRACE. From the header's section it looks like the program needs tx_trace.h to be included when we define this parameter.

    Please refer the following code snippet for your reference

    #include "tx_api.h"  
    #ifdef TX_ENABLE_EVENT_TRACE  
    #include "tx_trace.h"  
    #endif  
    #include "tx_thread.h"  
    #include "tx_block_pool.h"  
    

    Since the headers here include both "tx_api.h" and "tx_trace.h", I hope this answers your question 1.

    You can modify the code per your needs and define the features and addons you need. Please refer to point 3 of Building and Using library section.

    Kindly let us know if the above shared information is useful. Please reach out to us if you need further clarification or assistance on this.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.