Advanced runtime tracing

On some platforms or for some specific applications, these settings might be useful.

Multithreaded programs

Runtime tracing can be configured for use in a multithreaded environment such as Windows. Multithread mode protects target deployment port global variables against concurrent access. This causes a significant increase in target deployment port size as well as an impact on performance.

To enable multithreaded mode, change the Maximum number of threads and Record and display thread info configuration settings. See Changing runtime tracing settings for more information about these settings.

Partial trace flush

When using this mode, the target deployment port only sends messages related to instance creation and destruction, or user notes. All other events are ignored. This can be useful to reduce the volume of the trace dump file. When partial trace flush mode is enabled, message dump can be toggled on and off during trace execution. The partial trace flush settings are located in the runtime tracing settings.

To do this manually, use the runtime tracing pragma user directives:
For example, add the following line to the source code to toggle the trace dump on or off:
#pragma attol insert _ATT_TOGGLE_DUMP

Trace item buffer

Buffering allows you to reduce formatting and processing at time-critical steps by instructing the target deployment port to only output trace information when its buffer is full or at explicitly specified points in the program. This can prove useful when using runtime tracing on embedded platforms with limited resources.

A smaller buffer optimizes memory usage on the target platform, whereas a larger buffer improves performance of the real-time trace. The default value is 64.

It can be useful to flush the buffer before entering a time-critical part of the application-under-trace. You can do this by adding the _ATT_FLUSH_ITEMS user directive to the source-under-trace. For example:
#pragma attol insert _ATT_FLUSH_ITEMS

Splitting trace files

During execution, runtime tracing generates a dynamic trace file (.tdf). When a large application is instrumented, the size of the trace file can impact the display of the sequence diagram.

Splitting trace files allows you to produce multiple smaller files, resulting in better performance of the sequence diagram viewer and lower memory usage. However, split trace files cannot be used simultaneously with the on-the-fly tracing mode.

When displaying split trace files, synchronization elements are added to the UML sequence diagram to ensure that all instance lifelines are synchronized.

Note: The total size of split trace files is slightly larger than the size of a single trace file because each file contains additional context information.