The LoggingSetup module automates the process of configuring an application
to use UIA events, and configures SYS/BIOS modules to capture user-specified
information such as CPU Load, Task Load and Task Execution so that it can
be displayed by System Analyzer. It also automates the creation of
infrastructure modules such as loggers, the ServiceManager and RTA modules
to enable the capture and upload of the events over a user-specified transport.
Both JTAG and Non-JTAG transports are supported.
The following configuration script demonstrates the use of the LoggingSetup
module in the XDC configuration file for the application:
Example 1: Configuring an application to use the default settings provided
by LoggingSetup. The following default settings are automatically applied:
// the Log module provides logging APIs for use by the user's software
var Log = xdc.useModule('xdc.runtime.Log');
// the LoggingSetup module's default settings configure much of the UIA infrastructure.
var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
Example 2: A number of 'template' applications come with the UIA product, that
provide predefined XDC configuration scripts and C code for use in new
projects. These templates provide good examples of how to configure
the various modules that are involved in setting up the UIA infrastructure,
including the LoggingSetup module.
They can also be generated directly by CCS, using the CCS TI Resource
Explorer. The following steps show how to use CCSv5.x.x to generate a
new project that configures the NDK to provide an Ethernet transport for
uploading events from the target to the host. :
enum LoggingSetup.UploadMode |
 |
Modes for uploading events to the host
values of type LoggingSetup.UploadMode
const LoggingSetup.UploadMode_SIMULATOR;
// Simulator
const LoggingSetup.UploadMode_PROBEPOINT;
// Probepoint
const LoggingSetup.UploadMode_JTAGSTOPMODE;
// JTAG Stop Mode
const LoggingSetup.UploadMode_JTAGRUNMODE;
// JTAG Run Mode (C6x only)
const LoggingSetup.UploadMode_NONJTAGTRANSPORT;
// Non-JTAG transport
const LoggingSetup.UploadMode_NONJTAG_AND_JTAGSTOPMODE;
// Non-JTAG transport and
JTAG Stop Mode
const LoggingSetup.UploadMode_STREAMER;
// LoggerStreamer
const LoggingSetup.UploadMode_IDLE;
// Upload in Idle loop
const LoggingSetup.UploadMode_STREAMER2;
// LoggerStreamer2
VALUES
UploadMode_SIMULATOR
Simulator. Events are uploaded when logged. The target is briefly
halted when the event is uploaded. This is equivalent to using
UploadMode_PROBEPOINT.
UploadMode_PROBEPOINT
Probepoint. Events are uploaded over JTAG when logged. The target is briefly
halted when the event is uploaded. This mode can also be used
with a simulator.
UploadMode_JTAGSTOPMODE
Events are uploaded over JTAG when the target halts. This mode can
also be used with a simulator.
UploadMode_JTAGRUNMODE
Events are Uploaded over JTAG while the target is running. This mode is
supported for C6x devices only.
UploadMode_NONJTAGTRANSPORT
Events are uploaded over the non-JTAG transport specified by the
ServiceMgr.transportType
parameter while the target is running.
UploadMode_NONJTAG_AND_JTAGSTOPMODE
Events are uploaded over a non-JTAG transport specified by the
ServiceMgr.transportType
parameter while the target is running. When the target is halted,
events are uploaded over JTAG.
UploadMode_STREAMER
Events are logged to a LoggerStreamer logger.
The application must manage the buffers sent to the host.
UploadMode_STREAMER2
Events are logged to LoggerStreamer2 loggers.
The application must manage the buffers sent to the host.
DETAILS
By default, events are uploaded using the JTAG connection in
stop-mode. Events are uploaded over JTAG when the target halts. This
mode requires that JTAG connections are supported by the target.
If you want to use Ethernet, probe points, a simulator, or some other
method for uploading events, you can specify one of those upload
methods by configuring the
eventUploadMode parameter.
For example, you could use the following if you were running a
simulator:
var LoggingSetup =
xdc.useModule('ti.uia.sysbios.LoggingSetup');
LoggingSetup.eventUploadMode = LoggingSetup.UploadMode_SIMULATOR;
config LoggingSetup.disableMulticoreEventCorrelation // module-wide |
 |
Set to true for single core applications
LoggingSetup.disableMulticoreEventCorrelation = Bool false;
DETAILS
When set to true, the LoggingSetup module will not automatically
include the LogSync module. The LogSync module is
required in order to enable events from multiple CPU cores
to be correlated with each other.
SEE
config LoggingSetup.eventUploadMode // module-wide |
 |
Event upload mode
DETAILS
See
LoggingSetup.UploadMode for a description of the the
different event upload modes.
EXAMPLE
This script configures the system to stream events from the
target to the host over JTAG while the target is running.
(Note that this mode is only supported for CPUs that
support real-time JTAG accesses such as those in the C6X family,
e.g. C64X+ and C66 CPUs)
var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
LoggingSetup.eventUploadMode = LoggingSetup.UploadMode_JTAGRUNMODE;
config LoggingSetup.loadLogger // module-wide |
 |
Logger used for the Load module Log events
config LoggingSetup.loadLoggerSize // module-wide |
 |
Size (in MAUs) of logger used for the Load module Log events
LoggingSetup.loadLoggerSize = SizeT 512;
config LoggingSetup.loadLogging // module-wide |
 |
Enable the Load module event logging
LoggingSetup.loadLogging = Bool true;
DETAILS
If this is false, the events will be disabled. Otherwise the events
will be enabled.
Use the
loadLoggingRuntimeControl parameter
to determine whether the state can be modified during runtime.
config LoggingSetup.loadLoggingRuntimeControl // module-wide |
 |
Specify whether load logging can be enabled / disabled at runtime
LoggingSetup.loadLoggingRuntimeControl = Bool true;
DETAILS
This determines what diags settings are applied to the module's diags
mask. If 'false', the diags bits will be configured as
ALWAYS_ON, meaning they can't be changed at runtime. If 'true', the
bits will be configured as 'RUNTIME_ON'.
Use the
loadLogging parameter
to determine whether the event is ON or OFF. For example, the
following two lines set the Load module's events to 'ALWAYS_ON'.
LoggingSetup.loadLogging = true;
LoggingSetup.loadLoggingRuntimeControl = false;
config LoggingSetup.mainLogger // module-wide |
 |
Logger used for main and non-XDC modules Log events
config LoggingSetup.mainLoggerSize // module-wide |
 |
Size (in MAUs) of logger used for the main and non-XDC modules Log events
LoggingSetup.mainLoggerSize = SizeT 1024;
config LoggingSetup.mainLogging // module-wide |
 |
Enable main and non-XDC modules event logging
LoggingSetup.mainLogging = Bool true;
DETAILS
If this is false, the events will be disabled. Otherwise the events
will be enabled. Use the
mainLoggingRuntimeControl parameter
to determine whether the state can be modified during runtime.
The table below shows the initial values of the
xdc.runtime.Main Diags mask settings, based on mainLogging and
mainLoggingRuntimeControl configuration. These settins only
apply to Diags masks that have not been set in the application's
configuration file. For example, this configuration code would
cause xdc.runtime.Main's USER1 Diags mask to be unaffected by
the settings of mainLogging and mainLoggingRuntimeControl:
Diags.setMaskMeta('xdc.runtime.Main', Diags.USER1, Diags.RUNTIME_ON);
Diags Mask Settings for xdc.runtime.Main
| mainLoggingRuntimeControl |
true | false |
mainLogging | true | RUNTIME_ON |
ALWAYS_ON |
false | RUNTIME_OFF | ALWAYS_OFF |
config LoggingSetup.mainLoggingRuntimeControl // module-wide |
 |
Specify whether main logging can be enabled / disabled at runtime
LoggingSetup.mainLoggingRuntimeControl = Bool true;
DETAILS
This determines what diags settings are applied to the module's diags
mask. If 'false' and
mainLogging is true, the diags bits will be configured as
ALWAYS_ON, meaning they can't be changed at runtime. If 'true', the
bits will be configured as 'RUNTIME_ON'.
Use the
mainLogging parameter
to determine whether the event is ON or OFF. For example, the
following two lines set the xdc.runtime.Main events to
initially be 'RUNTIME_ON'.
LoggingSetup.mainLogging = true;
LoggingSetup.mainLoggingRuntimeControl = true;
config LoggingSetup.overflowLoggerSize // module-wide |
 |
Size of logger used for overflow events when
uploadMode is either JTAGRUNMODE or NONJTAG_AND_JTAGSTOPMODE
LoggingSetup.overflowLoggerSize = SizeT 1024;
config LoggingSetup.sysbiosHwiLogging // module-wide |
 |
Enable SYSBIOS Hwi and Clock modules' event logging
LoggingSetup.sysbiosHwiLogging = Bool false;
DETAILS
If this is false, the events will be disabled. Otherwise the events
will be enabled.
Use the
sysbiosHwiLoggingRuntimeControl parameter
to determine whether the state can be modified during runtime.
config LoggingSetup.sysbiosHwiLoggingRuntimeControl // module-wide |
 |
Specify whether Hwi and Clock logging can be enabled / disabled at runtime
LoggingSetup.sysbiosHwiLoggingRuntimeControl = Bool false;
DETAILS
This determines what diags settings are applied to the module's diags
mask. If 'false', the diags bits will be configured as
ALWAYS_ON, meaning they can't be changed at runtime. If 'true', the
bits will be configured as 'RUNTIME_ON'.
Use the
sysbiosHwiLogging parameter
to determine whether the event is ON or OFF. For example, the
following two lines set the Hwi module's events to 'ALWAYS_ON'.
LoggingSetup.sysbiosHwiLogging = true;
LoggingSetup.sysbiosHwiLoggingRuntimeControl = false;
config LoggingSetup.sysbiosLogger // module-wide |
 |
Logger used for SYSBIOS modules Log events
config LoggingSetup.sysbiosLoggerSize // module-wide |
 |
Size (in MAUs) of the logger used for the SYS/BIOS modules' Log events
LoggingSetup.sysbiosLoggerSize = SizeT 1024;
config LoggingSetup.sysbiosSwiLogging // module-wide |
 |
Enable SYSBIOS Swi module's event logging
LoggingSetup.sysbiosSwiLogging = Bool false;
DETAILS
If this is false, the events will be disabled. Otherwise the events
will be enabled.
Use the
sysbiosSwiLoggingRuntimeControl parameter
to determine whether the state can be modified during runtime.
config LoggingSetup.sysbiosSwiLoggingRuntimeControl // module-wide |
 |
Specify whether Swi logging can be enabled / disabled at runtime
LoggingSetup.sysbiosSwiLoggingRuntimeControl = Bool false;
DETAILS
This determines what diags settings are applied to the module's diags
mask. If 'false', the diags bits will be configured as
ALWAYS_ON, meaning they can't be changed at runtime. If 'true', the
bits will be configured as 'RUNTIME_ON'.
Use the
sysbiosSwiLogging parameter
to determine whether the event is ON or OFF. For example, the
following two lines initialize the Swi module's events to
'RUNTIME_OFF'.
LoggingSetup.sysbiosSwiLogging = false;
LoggingSetup.sysbiosSwiLoggingRuntimeControl = true;
config LoggingSetup.sysbiosTaskLogging // module-wide |
 |
Enable SYSBIOS Task module's event logging
LoggingSetup.sysbiosTaskLogging = Bool true;
DETAILS
If this is false, the events will be disabled. Otherwise the events
will be enabled.
Use the
sysbiosTaskLoggingRuntimeControl parameter
to determine whether the state can be modified during runtime.
config LoggingSetup.sysbiosTaskLoggingRuntimeControl // module-wide |
 |
Specify whether Task logging can be enabled / disabled at runtime
LoggingSetup.sysbiosTaskLoggingRuntimeControl = Bool true;
DETAILS
This determines what diags settings are applied to the module's diags
mask. If 'false', the diags bits will be configured as
ALWAYS_ON, meaning they can't be changed at runtime. If 'true', the
bits will be configured as 'RUNTIME_ON'.
Use the
sysbiosTaskLogging parameter
to determine whether the event is ON or OFF. For example, the
following two lines initialize the Task module's events to
'ALWAYS_ON'.
LoggingSetup.sysbiosTaskLogging = true;
LoggingSetup.sysbiosTaskLoggingRuntimeControl = false;