module ti.uia.events.UIAProfile |
 |
 |
 |
UIA Profile Events
The UIAProfile module defines events that allow
tooling to analyze the performance of the software
(processing time, latency, etc.)
[
more ... ]
#include <ti/uia/events/UIAProfile.h>
Functions common to all target modules |
|
|
Constants |
| |
| |
DETAILS
The UIAProfile module defines events that allow
tooling to analyze the performance of the software
(processing time, latency, etc.)
The generation of UIAProfile events is controlled by a module's diagnostics
mask, which is described in detail in
xdc.runtime.Diags.
UIAProfile_enterFunction events are generated only when the Diags.ENTRY bit
in the module's diagnostics mask is set, and 'UIAProfile_exitFunction' events
are generated only when the Diags.EXIT bit is set.
The following configuration script demonstrates how the application might
control the logging of 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 ENTRY and EXIT events.
Without these configuration statements, no events would be generated
by any modules.
EXAMPLES
Example 1: This is part of the XDC configuration file for the application:
var UIAProfile = xdc.useModule('ti.uia.events.UIAProfile');
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_ENTRY = Diags.ALWAYS_ON;
Defaults.common$.diags_EXIT = Diags.ALWAYS_ON;
Defaults.common$.logger = logger;
Example 2: The following example configures a module to support logging
of ENTRY and EXIT 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 UIAProfile = xdc.useModule('ti.uia.events.UIAProfile');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Mod = xdc.useModule('my.pkg.Mod');
Mod.common$.diags_ENTRY = Diags.RUNTIME_OFF;
Mod.common$.diags_EXIT = Diags.RUNTIME_OFF;
This is a part of the C code for the application.
The diags_ENTRY mask is set by "E", and the diags_EXIT mask is set by "X".
// turn on logging of ENTRY and EXIT events in the module
Diags_setMask("my.pkg.Mod+EX");
// turn off logging of ENTRY and EXIT events in the module
Diags_setMask("my.pkg.Mod-EX");
config UIAProfile_enterFunction // module-wide |
 |
Profiling event used to log the entry point of a function
extern const Log_Event UIAProfile_enterFunction;
VALUES
taskHandle
task handle that identifies the currently active task (use 0 if not required)
functionAdrs
the address of a function that can differentiate this pair of start and stop events from others
EXAMPLE
To add entry and exit hook functions to every function
1. Use the following compiler options when compiling the source
--entry_hook=functionEntryHook
--entry_param=address
--exit_hook=functionExitHook
--exit_param=address
2. Add the following c code to implement the hook functions:
The first parameter (the taskHandle) is set to 0 in this example.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAProfile.h>
...
void functionEntryHook(void (*addr)()){
Log_write2(UIAProfile_enterFunction, 0,(IArg)addr);
...
void functionExitHook( void (*addr)() ){
Log_write2(UIAProfile_exitFunction, 0,(IArg)addr);
}
The following text will be displayed for the event:
enterFunction: taskHandle=0x0, adrs=0x820060
exitFunction: taskHandle0x0, adrs=0x820060
SEE
config UIAProfile_exitFunction // module-wide |
 |
Profiling event used to log the exit point of a function
extern const Log_Event UIAProfile_exitFunction;
VALUES
taskHandle
task handle that identifies the currently active task (use 0 if not required)
functionAdrs
the address of a function that can differentiate this pair of start and stop events from others
EXAMPLE
To add entry and exit hook functions to every function
1. Use the following compiler options when compiling the source
--entry_hook=functionEntryHook
--entry_param=address
--exit_hook=functionExitHook
--exit_param=address
2. Add the following c code to implement the hook functions:
Task_selfMacro() is used to get the current task handle in this example.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAProfile.h>
#include <ti/sysbios/knl/Task.h>
...
void functionEntryHook(void (*addr)()){
Log_write2(UIAProfile_enterFunction, (IArg)Task_selfMacro(),(IArg)addr);
...
void functionExitHook( void (*addr)() ){
Log_write2(UIAProfile_exitFunction, (IArg)Task_selfMacro(),(IArg)addr);
}
The following text will be displayed for the event:
enterFunction: taskHandle=0x0, adrs=0x820060
exitFunction: taskHandle=0x0, adrs=0x820060
SEE
Module-Wide Built-Ins |
 |
// Get this module's unique id
Bool UIAProfile_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool UIAProfile_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 UIAProfile_Module_getMask();
// Returns the diagnostics mask for this module
Void UIAProfile_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
var UIAProfile = xdc.useModule('ti.uia.events.UIAProfile');
module-wide config parameters
msg: "enterFunction: taskHandle=0x%x, adrs=0x%x"
};
msg: "exitFunction: taskHandle=0x%x, adrs=0x%x"
};
config UIAProfile.enterFunction // module-wide |
 |
Profiling event used to log the entry point of a function
XDCscript usage |
meta-domain |
msg: "enterFunction: taskHandle=0x%x, adrs=0x%x"
};
VALUES
taskHandle
task handle that identifies the currently active task (use 0 if not required)
functionAdrs
the address of a function that can differentiate this pair of start and stop events from others
EXAMPLE
To add entry and exit hook functions to every function
1. Use the following compiler options when compiling the source
--entry_hook=functionEntryHook
--entry_param=address
--exit_hook=functionExitHook
--exit_param=address
2. Add the following c code to implement the hook functions:
The first parameter (the taskHandle) is set to 0 in this example.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAProfile.h>
...
void functionEntryHook(void (*addr)()){
Log_write2(UIAProfile_enterFunction, 0,(IArg)addr);
...
void functionExitHook( void (*addr)() ){
Log_write2(UIAProfile_exitFunction, 0,(IArg)addr);
}
The following text will be displayed for the event:
enterFunction: taskHandle=0x0, adrs=0x820060
exitFunction: taskHandle0x0, adrs=0x820060
SEE
C SYNOPSIS
config UIAProfile.exitFunction // module-wide |
 |
Profiling event used to log the exit point of a function
XDCscript usage |
meta-domain |
msg: "exitFunction: taskHandle=0x%x, adrs=0x%x"
};
VALUES
taskHandle
task handle that identifies the currently active task (use 0 if not required)
functionAdrs
the address of a function that can differentiate this pair of start and stop events from others
EXAMPLE
To add entry and exit hook functions to every function
1. Use the following compiler options when compiling the source
--entry_hook=functionEntryHook
--entry_param=address
--exit_hook=functionExitHook
--exit_param=address
2. Add the following c code to implement the hook functions:
Task_selfMacro() is used to get the current task handle in this example.
#include <xdc/runtime/Log.h>
#include <ti/uia/events/UIAProfile.h>
#include <ti/sysbios/knl/Task.h>
...
void functionEntryHook(void (*addr)()){
Log_write2(UIAProfile_enterFunction, (IArg)Task_selfMacro(),(IArg)addr);
...
void functionExitHook( void (*addr)() ){
Log_write2(UIAProfile_exitFunction, (IArg)Task_selfMacro(),(IArg)addr);
}
The following text will be displayed for the event:
enterFunction: taskHandle=0x0, adrs=0x820060
exitFunction: taskHandle=0x0, adrs=0x820060
SEE
C SYNOPSIS
metaonly config UIAProfile.common$ // module-wide |
 |
Common module configuration parameters
XDCscript usage |
meta-domain |
DETAILS
All modules have this configuration parameter. Its name
contains the '$' character to ensure it does not conflict with
configuration parameters declared by the module. This allows
new configuration parameters to be added in the future without
any chance of breaking existing modules.
generated on Mon, 28 Jan 2013 17:45:33 GMT