module ti.uia.events.UIAChanCtx |
 |
 |
 |
UIA Channel Context Instrumentation
The UIAChanCtx module defines context change events
and methods that allow tooling to identify channel context
switches and to enable channel-aware filtering, trace and
analysis.
[
more ... ]
#include <ti/uia/events/UIAChanCtx.h>
Functions |
UInt | |
UInt | |
Bool | |
Void | |
UInt | |
Functions common to all target modules |
|
|
Typedefs |
typedef Bool | |
Constants |
| |
extern const Bits16 | |
| |
extern const Bits16 | |
DETAILS
The UIAChanCtx module defines context change events
and methods that allow tooling to identify channel context
switches and to enable channel-aware filtering, trace and
analysis.
It inherits IUIACtx, which defines a function pointer to
an isLoggingEnabled function which, if configured to point to
a function, will evaluate the function prior to logging the context
change event and will determine whether to log the event based on the
return value of the function. If the function is not configured,
logging will be conditional upon ti_uia_runtime_CtxFilter_module->mIsLoggingEnabled.
The generation of UIAChanCtx events is also controlled by a module's diagnostics
mask, which is described in details in
xdc.runtime.Diags.
UIAChanCtx` events are generated only when the Diags.ANALYSIS bit is set
in the module's diagnostics mask.
The following configuration script demonstrates how the application might
control the logging of ANALYSIS events embedded in the Mod module at configuration
time. In this case, the configuration script arranges for the Log
statements within modules to always generate ANALYSIS events.
Without these configuration statements, no ANALYSIS events would be generated
by any modules.
EXAMPLES
Example 1: This is part of the XDC configuration file for the application:
var LogCtxChg = xdc.useModule('ti.uia.runtime.LogCtxChg');
var Diags = xdc.useModule('xdc.runtime.Diags');
var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var logger = LoggerSys.create();
Defaults.common$.diags_ANALYSIS = Diags.ALWAYS_ON;
Defaults.common$.logger = logger;
Example 2: The following example configures a module to support logging
of ANALYSIS events, but defers the actual activation and deactivation of the
logging until runtime. See the
Diags_setMask()
function for details on specifying the control string.
This is a part of the XDC configuration file for the application:
var LogCtxChg = xdc.useModule('ti.uia.runtime.LogCtxChg');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Mod = xdc.useModule('my.pkg.Mod');
Mod.common$.diags_ANALYSIS = Diags.RUNTIME_OFF;
This is a part of the C code for the application:
// turn on logging of ANALYSIS events in the module
Diags_setMask("my.pkg.Mod+Z");
// turn off logging of ANALYSIS events in the module
Diags_setMask("my.pkg.Mod-Z");
typedef UIAChanCtx_IsLoggingEnabledFxn |
 |
typedef Bool (*UIAChanCtx_IsLoggingEnabledFxn)(Int);
config UIAChanCtx_ENABLEMASK // module-wide |
 |
Ctx Filter Enable Mask
extern const Bits16 UIAChanCtx_ENABLEMASK;
DETAILS
configures which bit of the ti_uia_runtime_CtxFilter_gFlags
is assigned to control context aware filtering for
frame context changes. Must be configured with a
value that is 2**SYNCID.
config UIAChanCtx_SYNCID // module-wide |
 |
Trace Synchronization ID
extern const Bits16 UIAChanCtx_SYNCID;
DETAILS
configures the value to be written into the
4 bit context change type field used by the
UIASync trace synchronization
config UIAChanCtx_ctxChg // module-wide |
 |
Channel Context Change event
VALUES
fmt
a constant string that describes the context change and provides a format specifier for newAppId
newChanId
an integer which uniquely identifies the new context
DETAILS
Used to log the start of a new channel
Note that the previous channel Id is logged automatically by the ti_uia_runtime_LogCtxChg_thread
API.
EXAMPLE
The following C code shows how to log a Context Change
event that identifies a new channel ID
#include <ti/uia/runtime/LogCtxChg.h>
...
Void processChannel(Int chanId){
...
LogCtxChg_channel("New chan ID=0x%x",chanId);
...
}
This event prints the Log call site (%$F) and a format string (%$S)
which is recursively formatted with any addition arguments.
The following text is an example of what will be displayed for the event:
"Channel Ctx Change at Line 123 in demo.c [Prev. chan ID=0x1234] New chan ID=0x1235"
config UIAChanCtx_isLoggingEnabledFxn // module-wide |
 |
UIAChanCtx_getCtxId() // module-wide |
 |
Get the ID for the current channel
UInt UIAChanCtx_getCtxId();
RETURNS
returns the channel ID logged by the last call to UIAChanCtx_logCtxChg.
UIAChanCtx_getEnableOnValue() // module-wide |
 |
Get the EnableOn value
UInt UIAChanCtx_getEnableOnValue();
RETURNS
returns the channel ID value that logging will be enabled for.
UIAChanCtx_isLoggingEnabled() // module-wide |
 |
returns true if the new context matches the value to enable logging with
Bool UIAChanCtx_isLoggingEnabled(UInt newChanId);
ARGUMENTS
newChanId
the new channel ID
DETAILS
Default implementation of the IUIACtx_IsLoggingEnabledFxn for user context.
To enable context-aware filtering, in the .cfg script assign
UIAChanCtx_isLoggingEnabledFxn = '&UIAChanCtx_isLoggingEnabled'
or assign your own implementation of this function.
RETURNS
true if logging is enabled
UIAChanCtx_setEnableOnValue() // module-wide |
 |
Set the EnableOn value
Void UIAChanCtx_setEnableOnValue(UInt value);
ARGUMENTS
value
the CtxId value that logging will be enabled for.
UIAChanCtx_setOldValue() // module-wide |
 |
sets ti_uia_events_UIAChanCtx_gLastValue to the new value and returns the old value before it was updated
UInt UIAChanCtx_setOldValue(UInt newValue);
ARGUMENTS
newValue
the new value to save in the global variable
(return0 the original value of the global variable before it was updated.
Module-Wide Built-Ins |
 |
// Get this module's unique id
Bool UIAChanCtx_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool UIAChanCtx_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 UIAChanCtx_Module_getMask();
// Returns the diagnostics mask for this module
Void UIAChanCtx_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
var UIAChanCtx = xdc.useModule('ti.uia.events.UIAChanCtx');
module-wide config parameters
msg: "Channel Ctx Change at %$F [Prev. chan ID=0x%x] %$S"
};
generated on Tue, 14 Feb 2017 00:15:09 GMT