module ti.uia.events.UIABenchmark

index URL

UIA Benchmark Events

*       C synopsis

*  Individual elements

*       DETAILS

*       EXAMPLES

The UIABenchmark 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/UIABenchmark.h

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

Constants

extern const Log_Event 

extern const Log_Event 

extern const Log_Event 

extern const Log_Event 

extern const Log_Event 

extern const Log_Event 

extern const Log_Event 

extern const Log_Event 

 

DETAILS

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

The generation of UIABenchmark events is controlled by a module's diagnostics mask, which is described in detail in xdc.runtime.Diags. UIABenchmark 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.

 

config UIABenchmark_start  // module-wide

index URL

Benchmark event used to log the start of an operation

C synopsis

target-domain

extern const Log_Event UIABenchmark_start;

 

VALUES

fmt — a constant string that provides format specifiers for up to 7 additional parameters

EXAMPLE

The following C code shows how to log a simple benchmark 'start' event along with a user-specified format string describing the event.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIABenchmark.h>
  ...
  Log_write1(UIABenchmark_start, (IArg)"My benchmark event");

The following text will be displayed for the event:

  Start: My benchmark event

 

config UIABenchmark_startInstance  // module-wide

index URL

Benchmark event used to log the start of an operation instance

C synopsis

target-domain

extern const Log_Event UIABenchmark_startInstance;

 

VALUES

fmt — a constant string that provides format specifiers for up to 6 additional parameters

instanceId — a unique instance ID that can be used to match benchmark start and stop events

DETAILS

Event parameter provides instance data to differentiate between multiple instances that can run in parallel.

EXAMPLE

The following C code shows how to log a benchmark 'startInstance' event along with a user-specified instance identifier and a format string describing the event.

  #include <xdc/runtime/Gate.h>
  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIABenchmark.h>
  static volatile int gMyGlobalInstanceId = 0;
  ...
  IArg key;
  int localInstanceId;
 
 // protect pre-increment operation from race conditions
  key = Gate_enterSystem();
  localInstanceId = ++gMyGlobalInstanceId;
  Gate_leaveSystem(key);
 
  Log_write2(UIABenchmark_startInstance, (IArg)"My benchmark event: instanceId=%d",localInstanceId);
  ...
  Log_write2(UIABenchmark_stopInstance, (IArg)"My benchmark event: instanceId=%d",localInstanceId);

The following text will be displayed for the event:

  StartInstance: My benchmark event: instanceId=1
  StopInstance: My benchmark event: instanceId=1

 

config UIABenchmark_startInstanceWithAdrs  // module-wide

index URL

Benchmark event used to log the start of an operation instance

C synopsis

target-domain

extern const Log_Event UIABenchmark_startInstanceWithAdrs;

 

VALUES

fmt — a constant string that provides format specifiers for up to 5 additional parameters

instanceId — a unique instance ID that can be used to match benchmark start and stop events

functionAdrs — the address of a function that can differentiate this pair of start and stop events from others

DETAILS

Event parameter provides instance data to differentiate between multiple instances that can run in parallel

EXAMPLE

The following C code shows how to log a benchmark 'startInstanceWithAdrs' event along with a task handle as the instance identifier, the function address and a format string describing the event.

  #include <ti/sysbios/knl/Task.h>
  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIABenchmark.h>
  ...
 Void myFunction(){
   Task_Handle hTsk = Task_selfMacro();
 
   Log_write3(UIABenchmark_startInstanceWithAdrs, (IArg)"My benchmark event: task=0x%x, fnAdrs=0x%x",(IArg)hTsk,(IArg)&myFunc);
   ...
   Log_write3(UIABenchmark_stopInstanceWithAdrs, (IArg)"My benchmark event: task=0x%x", fnAdrs=0x%x",(IArg)hTsk,(IArg)&myFunc);
 }

The following text will be displayed for the event:

  StartInstanceWithAdrs: My benchmark event: task=0x893230, fnAdrs=0x820060
  StopInstanceWithAdrs: My benchmark event: task=0x893230, fnAdrs=0x820060

 

config UIABenchmark_startInstanceWithStr  // module-wide

index URL

Benchmark event used to log the start of an operation instance

C synopsis

target-domain

extern const Log_Event UIABenchmark_startInstanceWithStr;

 

VALUES

fmt — a constant string that provides format specifiers for up to 5 additional parameters

instanceId — a unique instance ID that can be used to match benchmark start and stop events

str — a constant string reference

DETAILS

Event parameter provides instance data to differentiate between multiple instances that can run in parallel

EXAMPLE

The following C code shows how to log a benchmark 'startInstanceWithStr' event along with a unique instance identifier and a string reference used only by the pair of start / stop events.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIABenchmark.h>
  ...
 Void packetHdlr(Int packetId){
 
   Log_write3(UIABenchmark_startInstanceWithStr, (IArg)"My benchmark event: packetId=0x%x",packetId,(IArg)"(routing)");
   ...
   Log_write3(UIABenchmark_stopInstanceWithStr, (IArg)"My benchmark event: packetId=0x%x",packetId,(IArg)"(routing)");
 }

The following text will be displayed for the event:

  StartInstanceWithStr: My benchmark event: packetId=0x3bc3 (routing)
  StopInstanceWithStr: My benchmark event: packetId=0x3bc3 (routing)

Event parameter provides instance data to differentiate between multiple instances that can run in parallel

 

config UIABenchmark_stop  // module-wide

index URL

Benchmark event used to log the end of an operation

C synopsis

target-domain

extern const Log_Event UIABenchmark_stop;

 

VALUES

fmt — a constant string that provides format specifiers for up to 7 additional parameters

EXAMPLE

The following C code shows how to log a simple benchmark 'stop' event along with a user-specified format string describing the event.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIABenchmark.h>
  ...
  Log_write1(UIABenchmark_stop, (IArg)"My benchmark event");

The following text will be displayed for the event:

  Stop: My benchmark event

 

config UIABenchmark_stopInstance  // module-wide

index URL

Benchmark event used to log the end of an operation instance

C synopsis

target-domain

extern const Log_Event UIABenchmark_stopInstance;

 

VALUES

fmt — a constant string that provides format specifiers for up to 6 additional parameters

instanceId — a unique instance ID that can be used to match benchmark start and stop events

DETAILS

Event parameter provides instance data to differentiate between multiple instances that can run in parallel.

EXAMPLE

The following C code shows how to log a benchmark 'stopInstance' event along with a user-specified instance identifier and a format string describing the event.

  #include <xdc/runtime/Gate.h>
  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIABenchmark.h>
  static volatile int gMyGlobalInstanceId = 0;
  ...
  IArg key;
  int localInstanceId;
 
 // protect pre-increment operation from race conditions
  key = Gate_enterSystem();
  localInstanceId = ++gMyGlobalInstanceId;
  Gate_leaveSystem(key);
 
  Log_write2(UIABenchmark_startInstance, (IArg)"My benchmark event: instanceId=%d",localInstanceId);
  ...
  Log_write2(UIABenchmark_stopInstance, (IArg)"My benchmark event: instanceId=%d",localInstanceId);

The following text will be displayed for the event:

  StartInstance: My benchmark event: instanceId=1
  StopInstance: My benchmark event: instanceId=1

 

config UIABenchmark_stopInstanceWithAdrs  // module-wide

index URL

Benchmark event used to log the end of an operation instance

C synopsis

target-domain

extern const Log_Event UIABenchmark_stopInstanceWithAdrs;

 

VALUES

fmt — a constant string that provides format specifiers for up to 5 additional parameters

instanceId — a unique instance ID that can be used to match benchmark start and stop events

functionAdrs — the address of a function that can differentiate this pair of start and stop events from others

EXAMPLE

The following C code shows how to log a benchmark 'stopInstanceWithAdrs' event along with a task handle as the instance identifier, the function address and a format string describing the event.

  #include <ti/sysbios/knl/Task.h>
  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIABenchmark.h>
  ...
 Void myFunction(){
   Task_Handle hTsk = Task_selfMacro();
 
   Log_write3(UIABenchmark_startInstanceWithAdrs, (IArg)"My benchmark event: task=0x%x, fnAdrs=0x%x",(IArg)hTsk,(IArg)&myFunc);
   ...
   Log_write3(UIABenchmark_stopInstanceWithAdrs, (IArg)"My benchmark event: task=0x%x", fnAdrs=0x%x",(IArg)hTsk,(IArg)&myFunc);
 }

The following text will be displayed for the event:

  StartInstanceWithAdrs: My benchmark event: task=0x893230, fnAdrs=0x820060
  StopInstanceWithAdrs: My benchmark event: task=0x893230, fnAdrs=0x820060

 

config UIABenchmark_stopInstanceWithStr  // module-wide

index URL

Benchmark event used to log the end of an operation instance

C synopsis

target-domain

extern const Log_Event UIABenchmark_stopInstanceWithStr;

 

VALUES

fmt — a constant string that provides format specifiers for up to 5 additional parameters

instanceId — a unique instance ID that can be used to match benchmark start and stop events

str — a constant string reference

DETAILS

Event parameter provides instance data to differentiate between multiple instances that can run in parallel

EXAMPLE

The following C code shows how to log a benchmark 'stopInstanceWithStr' event along with a unique instance identifier and a string reference used only by the pair of start / stop events.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIABenchmark.h>
  ...
 Void packetHdlr(Int packetId){
 
   Log_write3(UIABenchmark_startInstanceWithStr, (IArg)"My benchmark event: packetId=0x%x",packetId,(IArg)"(routing)");
   ...
   Log_write3(UIABenchmark_stopInstanceWithStr, (IArg)"My benchmark event: packetId=0x%x",packetId,(IArg)"(routing)");
 }

The following text will be displayed for the event:

  StartInstanceWithStr: My benchmark event: packetId=0x3bc3 (routing)
  StopInstanceWithStr: My benchmark event: packetId=0x3bc3 (routing)

Event parameter provides instance data to differentiate between multiple instances that can run in parallel

 

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