NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
User:DVT/UserDocumentation/DVT SoC Analyzer/DVT Event Log
Contents
DVT Event Log Format for [SoCAnalyzer][edit]
DVT Event Logging uses the existing DSP/BIOS logging services and enables application developers to instrument their target side application and provide more granular logs on top of what DSP/BIOS’ implicit system logs provides.
Using a simple macro definition on target for a predefined set of event types and data types and using DSP/BIOS Log_Printf4 feature information has to be logged in a DSP/BIOS log buffer called DVTEvent_Log.
Log_Printf4 is a new logging API comparable to Log_Printf but is 8 words size instead of 4 words. This is to make room for 2 extra Arguments and a 2 word Timestamp inserted by DSP/BIOS.
SoC Analyzer on host side decodes all the DSP/BIOS logs and shows them in a table view but the logs in DVTEvent_Log buffer get decoded further and to generate a set of predefined visualization for:
- Event Tracking
- Latency
- Throughput
- Bandwidth
To achieve these visualization and analysis, SoCAnalyzer relies on target application developers to follow a pattern for logging an event.
Note: The logs may be transferred to host by any means like:
- DSP/BIOS LogServer over HTTP
- CCS Socket Plugin over JTAG/TCPIP
- Or just reside in a binary file
Word0,Word1 | Word2 | Word3 | Word4 | Word5 | Word6 | Word7 |
Timestamp | Seq # | Source Name | Even Descriptor | Data1 | Data 2 | Data 3 |
BIOS: Log_Prinf4(LogBuffer, Format String, arg0, arg1, arg2, arg3)
DVT Usage: Log_Printf4(&DVTEvent_Log, EventSource, Event Descriptor, arg1, arg2, arg3)
LogPrintf4() |
DVT Usage |
Description |
---|---|---|
Timestamp |
Timestamp |
Automatically inserted |
Seq # |
Seq # |
Automatically inserted. (use by DVT to detect data loss) |
LogBuffer |
&DVTEvent_Log |
All DVT events must be logged in the DVTEvent_Log buffer ( Note: this log buffer must be created by the application) |
Format String |
Source Name |
Name of the Source logging the event. ( Limitation: Name has to be a static global string). ( Recommendation: Use short descriptive name, e.g. TI_UART_DRV). ( Note: the SoCAnalyzer will further qualify the source with Instance and/or ChannelID is specified in the data field) |
Arg0 |
Event Descriptor |
Specifies the event and three data types. Use the DVT_DESC macro and the Event and Data Types below to specify this work |
Arg1 |
Arg1 |
1st Data field |
Arg2 |
Arg2 |
2nd Data field |
Arg3 |
Arg3 |
3rd Data field |
Event Desc Macro: DVT_DESC(EventType, Arg1Type, Arg2Type, Arg3Type)
Event Types
enum |
Event Type |
Description |
0 |
DVT_eINT |
Interrupt Event. Use this only is logging that the interrupt occurred. |
1 |
DVT_eINT_START |
Enter Interrupt service routine |
2 |
DVT_eINT_END |
Exit Interrupt service routine |
3 |
DVT_eFUNC |
Interrupt Event. Use this only is logging that the function was called. |
4 |
DVT_eFUNC_START |
Enter function service routine |
5 |
DVT_eFUNC_END |
Exit function service routine |
6 |
DVT_ePACKET_START |
Start of a Packet |
7 |
DVT_ePACKET_END |
End of a Packet |
8 |
DVT_eDATA_SND |
A send event without corresponding END event |
9 |
DVT_eDATA_SND_START |
A send Event that has a corresponding END event |
10 |
DVT_eDATA_SND_END |
End of a START send event |
11 |
DVT_eDATA_RCV |
A receive Event without corresponding END event |
12 |
DVT_eDATA_RCV_START |
A receive event that has a corresponding |
13 |
DVT_eDATA_RCV_END |
End of a STARTVALUE event |
14 |
DVT_eSMPL_COUNTER |
Sample some free running counter |
15 |
DVT_eEVENT |
Events not explicitly defined above |
16 |
DVT_eEVENT_START |
The start of an event other than those above |
17 |
DVT_eEVENT_END |
The end of an event other than those above |
Argument Types
enum |
Data Type |
Description |
0 |
DVT_dNONE |
No Data |
1 |
DVT_dINST |
ID for this instance of the driver. This is necessary if separate analysis is required for different instances of a multiple instance driver. |
2 |
DVT_dINITIATOR |
ID of the component that initiated this driver request |
3 |
DVT_dMSG_ID |
ID use to correlate START and END events. This is not necessary if events are sequenced, i.e. no more than 1 START is pending at any given time. |
4 |
DVT_dCOUNTER |
Value of a free running counter value is included |
5 |
DVT_dSIZE_BYTES |
Size in number of bytes |
6 |
DVT_dSIZE_WORDS |
Size in number of words |
7 |
DVT_dPADD |
Program Address |
8 |
DVT_dDADD |
Data address |
9 |
DVT_dDATA |
Some Data |
10 |
DVT_dPACKET_ID |
Packet ID |
11 |
DVT_dCHANNEL_ID |
Channel ID |
12 |
DVT_dCHANNEL_ID_INST |
16 bit Channel ID, followed by 16 bit Instance |
Target Setup[edit]
Header File[edit]
A sample header file is included in DVT installation see:
''<DVDP_Install_dir>\ PSP_0_05_02\pspdrivers\inc\ psp_log.h''
Here's all that that needs to be defined in the header file for the SoCAnalyzer:
extern far LOG_Obj DVTEvent_Log;
typedef enum {
DVT_eINT,
DVT_eINT_START,
DVT_eFUNC,
DVT_eFUNC_START,
DVT_eFUNC_END,
DVT_ePACKET_START,
DVT_eDATA_SND,
DVT_eDATA_SND_START,
DVT_eDATA_SND_END,
DVT_eDATA_RCV,
DVT_eRCV_START,
DVT_eRCV_END,
DVT_eSMPL_COUNTER,
DVT_eEVENT,
DVT_eEVENT_START,
DVT_eEVENT_END
} PSP_logEventType;
typedef enum {
DVT_dNONE,
DVT_dINST,
DVT_dINITIATOR,
DVT_dMSG_ID,
DVT_dCOUNTER,
DVT_dSIZE_BYTES,
DVT_dSIZE_WORDS,
DVT_dPADD,
DVT_dDATA,
DVT_dPACKET_ID,
DVT_dCHANNEL_ID,
DVT_dCHANNEL_ID_INST
} PSP_logDataDesc;
#define ARG1(arg1) (arg1 << 8)
#define ARG2(arg2) (arg2 << 16)
#define ARG3(arg3) (arg3 << 24)
#define CHANNELID_INSTANCEID(channelId, instanceId) ((channelId << 16) | instanceId)
#define DVT_DESC(event, arg1, arg2, arg3) (event | ARG1(arg1) | ARG2(arg2) | ARG3(arg3))
Creating/Configuring the log buffer DVTEvent_Log[edit]
DVT Event Logging uses the existing DSP/BIOS logging services and enables application developers to instrument their target side application and provide more granular logs on top of what DSP/BIOS' implicit system logs provides.
Use standard BIOS mechanism to create a log buffer name DVTEvent_Log. Set buffer to appropriate size to store data for the duration required.
e.g. of tcf file content:
/* Create LOG for the SoC Analyser: */
bios.LOG.create("DVTEvent_Log");
bios.LOG.instance("DVTEvent_Log").bufSeg = prog.get("DDR2");
bios.LOG.instance("DVTEvent_Log").bufLen = 65536;
/* to enable time stamp logging */
bios.LOG.TS = true;
Logging Rules / Patterns[edit]
The [SoCAnalyzer] follows a set of basic rules to perform CPU Tracking, Latency, Bandwidth and/or Throughput analysis:
- The Event Name is created as a composite of the Source Name, Event Type, Instance (only if present in log) and Channel_ID (only if present in log):
<Event_Type>+<Source Name>+<Instance>+<Channel_ID>
Example: The following Log will result in an Event Name "INT_UART Inst:1 Ch:0"
Log_Printf4(&DVTEvent_Log, "UART", DVT_DESC(DVT_INT_eSTART, DVT_dINST, DVT_dCHANNEL_ID, DVT_dNONE), 1, 0)
If a PacketId is present, it will be used to group the related events together for Latency, Throughput and bandwidth
<Event_Type>+<Source Name>+<Instance>+<Channel_ID>+<Packet_ID>
- START and END logs are used for CPU tracking
- FUNC or INT START followed by a SND_STARTor RCV_START are used for Latency
- eSIZE_BYTES in any log other than END is used for Throughput measurement
- eSIZE_BYTES in an END log is used for Bandwidth
See below for details on CPU Tracking, Latency, Throughput and Bandwidth analysis.
CPU Tracking[edit]
Any START and END event pairs of the same Event Name will automatically be displayed in the Event Tracking Graph showing when the event is running/active.
Example: of start/end event pairs:
DVT_eINT_START and DVT_eINT_END DVT_eFUNC_START and DVT_eFUNC_END DVT_eEVENT_START and DVT_eEVENT_END DVT_ePACKET_START and DVT_ePACKET_END DVT_eDATA_SND_START and DVT_eDATA_SND_END DVT_eDATA_RCV_START and DVT_eDATA_RCV_END
Example of CPU Tracking Graph:
Latency[edit]
Latency is calculate for any Event Name that logs a
DVT_eINT_START or DVT_eFUNC_START
Followed by
DVT_eDATA_SND_START or DVT_eDATA_RCV_START
The latency is calculated as SND_START/RCV_START - INT_START/FUNC_START.
Throughput[edit]
Throughput is calculated for any Event Name (except END log types) that logs an argument of type:
DVT_dSIZE_BYTES
Throughput is calculated as bytes/sec.
Notes:
- DVT_dSIZE_BYTES logged on an END event type is ignored for throughput analysis
- DVT_dSIZE_BYTES should only be logged once (except if logged on an END log) per Event Name to avoid double counting.
Bandwidth[edit]
Bandwidth is calculated for any Event Name that logs an argument of the following type in a DVT_SND_eEND or DVT_RCV_eEND event:
DVT_dSIZE_BYTES
Bandwidth is calculated as the # Bytes/Duration. Where Duration = DVT_SND_eSTART - DVT_SND_eEND or DVT_RCV_eSTART - DVT_RCV_eEND.