module ti.uia.events.UIAProfile

index URL

UIA Profile Events

*       C synopsis

*  Individual elements

*       DETAILS

*       EXAMPLES

The UIAProfile module defines events that allow tooling to analyze the performance of the software (processing time, latency, etc.) more ... ]

C synopsis

target-domain

sourced in ti/uia/events/UIAProfile.h

#include <ti/uia/events/UIAProfile.h>

Constants

extern const Log_Event 

extern const Log_Event 

 

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 diagnostics mask is set, and 'UIAProfile_exitFunction' events are generated only when the Diags.EXIT bit is set.

EXAMPLES

Example 1: The following example shows how to turn on or off logging of ENTRY and EXIT events from the application source code. See the Diags_setMask() function for details on specifying the control string.

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

index URL

Profiling event used to log the entry point of a function

C synopsis

target-domain

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

for an example of how to log the current task ID, task-aware function profiling.

 

config UIAProfile_exitFunction  // module-wide

index URL

Profiling event used to log the exit point of a function

C synopsis

target-domain

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

for an example of how to save CPU by logging 0, of the task handle if task-aware profiling is not required.

generated on Wed, 14 Mar 2012 16:46:04 GMT