Texas Instruments TMS320 User Manual page 88

Dsp/bios v5.40
Hide thumbs Also See for TMS320:
Table of Contents

Advertisement

Instrumentation APIs
3.5.4
Trace Manager (TRC Module)
3.5.4.1 Control of Explicit Instrumentation
3-26
The TRC module allows an application to enable and disable the acquisition
of analysis data in real time. For example, the target can use the TRC module
to stop or start the acquisition of data when it discovers an anomaly in the
application's behavior.
Control of data gathering is important because it allows you to limit the effects
of instrumentation on program behavior, ensure that LOG and STS objects
contain the necessary information, and start or stop recording of events and
data values at run time.
For example, by enabling instrumentation when an event occurs, you can use
a fixed log to store the first n events after you enable the log. By disabling
tracing when an event occurs, you can use a circular log to store the last n
events before you disable the log.
You can use the TRC module to control explicit instrumentation as shown in
this code fragment:
if (TRC_query(TRC_USER0) == 0) {
`LOG or STS operation`
}
Note:
TRC_query returns 0 if all trace types in the mask passed to it are enabled,
and is not 0 if any trace types in the mask are disabled.
The overhead of this code fragment is just a few instruction cycles if the
tested bit is not set. If an application can afford the extra program size
required for the test and associated instrumentation calls, it is very practical
to keep this code in the production application simplifying the development
process and enabling field diagnostics. This is, in fact, the model used within
the DSP/BIOS instrumented kernel.

Advertisement

Table of Contents
loading

Table of Contents