By default, the system call atexit() or on_exit() invokes the Target Deployment Port (TDP) function that dumps the trace data. You can therefore instrument either all or a portion of the application as required.
When instrumenting embedded or specialized applications that never terminate, it is sometimes impractical to generate a dump on the atexit() or on_exit() functions. If you exit such applications unexpectedly, traces may not be generated.
In this case, you must either:
Specify one or several explicit dump points in your source code, or
Use an external signal to call a dump routine, or
Produce an snapshot when a specific function is encountered.
Code Coverage, Memory Profiling and Performance Profiling allow you to explicitly invoke the TDP dump function by inserting a call to the _ATCPQ_DUMP(1) instrumentation pragma (the parameter 1 is ignored).
Explicit dumps should not be placed in the main loop of the application. The best location for an explicit dump call is in a secondary function, for example called by the user when sending a specific event to the application.
The explicit dump method is sometimes incompatible with watchdog constraints. If such incompatibilities occur, you must:
Deactivate any hardware or software watchdog interruptions
Acknowledge the watchdog during the dump process, by adding a specific call to the Data Retrieval customization point of the TDP.
You can automatically add an explicit dump your C and
C++ source code by clicking the Add Dump
button in the text editor. This inserts the _ATCPQ_DUMP instrumentation pragma into
your source code.
Code Coverage allows you to dump the traces at any point in the source code by using the _ATC_SIGNAL_DUMP environment variable.
When the signal specified by _ATC_SIGNAL_DUMP is received, the Target Deployment Port function dumps the trace data and resets the signal so that the same signal can be used to perform several trace dumps.
Before starting your tests, set _ATC_SIGNAL_DUMP to the number of the signal that is to trigger the trace dump.
The signal must be redirectable signal, such as SIGUSR1 or SIGINT for example.
The Instrumentor snapshot option enables you to specify the functions of your application that will dump the trace information on entry, return or call.
In snapshot mode, the Runtime Tracing feature starts dumping messages only if the Partial Message Dump setting is activated. Code Coverage, Memory Profiling and Performance Profiling features all dump their internal trace data.
Related Topics