module ti.uia.runtime.EventHdr

index URL

Module defines the header format to be used when logging an event

*       C synopsis

*  Individual elements

Each event's first word includes the type, length of the event and sequence number. The length includes the first word and is in bytes. [ more ... ]

C synopsis

target-domain

sourced in ti/uia/runtime/EventHdr.h

#include <ti/uia/runtime/EventHdr.h>

Functions

macro UInt32 

EventHdr_genEventHdrWord1// generates the first word to use in an Event header(SizeT numBytesInEventMsg, UInt16 seqCount, Bool isTimestampEnabled);

macro SizeT 

macro UInt16 

macro Void 

macro Void 

macro Void 

Functions common to all target modules

 

Typedefs

typedef enum

 

DETAILS

Each event's first word includes the type, length of the event and sequence number. The length includes the first word and is in bytes.

The following is the desciption of the first word.

  EventHdr
   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  |---------------------------------------------------------------|
  |H H H H H|L L L L L L L L L L L|S S S S S S S S S S S S S S S S|
  |---------------------------------------------------------------|
 
  H = HdrType         (5-bits)
  L = Event Length    (11-bits)
  S = Sequence Number (16-bits)

There are currently 4 different types of events supported in UIA. The following discusses the format of each one of the types.

  HdrType_Event
    word0: EventHdr
    word1: event Id (top 16 bits) & module Id (bottom 16 bits)
 
  HdrType_EventWithTimestamp
    word0: EventHdr
    word1: Timestamp lower 32 bits
    word2: Timestamp upper 32 bits
    word3: event Id (top 16 bits) & module Id (bottom 16 bits)
 
  HdrType_EventWithSnapshotId
    word0: EventHdr
    word1: event Id (top 16 bits) & module Id (bottom 16 bits)
    word2: filename pointer
    word3: linenum
    word4: snapshotId
    word5: address where the data was located
    word6: total length of data (top 16-bits)
           length for this record (bottom 16 bits)
    word7: format pointer
    data:  the rest of the record contains the data
 
  HdrType_EventWithSnapshotIdAndTimestamp: 
    word0: EventHdr
    word1: Timestamp lower 32 bits
    word2: Timestamp upper 32 bits
    word3: event Id (top 16 bits) & module Id (bottom 16 bits)
    word4: filename pointer
    word5: linenum
    word6: snapshotId
    word7: address where the data was located
    word8: total length of data (top 16-bits)
           length for this record (bottom 16 bits)
    word9: format pointer
    data:  the rest of the record contains the data

Snapshot events can span multiple records. The snapshotId is used to correlate the records when this occurs. The length field (word6 or word8) contains two lengths. The bottom 16 bits length of data for this record. The top 16 bits is the sum of all lengths for this specific snapshotId.

The address field points to the location of the data. When the snapshot spans multiple records, the address field is updated accordingly. Therefore this field can be used to detect dropped records. Note the snapshot event data is contiguous.

 

enum EventHdr_HdrType

Enumeration of the various types of events headers

C synopsis

target-domain

typedef enum EventHdr_HdrType {

    EventHdr_HdrType_Event,

    // Event with no timestamp or other optional parameters

    EventHdr_HdrType_EventWithTimestamp,

    // Event with 64 bit Timestamp

    EventHdr_HdrType_EventWithSnapshotId,

    // Snapshot event

    EventHdr_HdrType_EventWithSnapshotIdAndTimestamp,

    // Snapshot event with 64 bit Timestamp

    EventHdr_HdrType_Reserved4,

    // reserved for future use

    EventHdr_HdrType_Reserved5,

    // reserved for future use

    EventHdr_HdrType_Reserved6,

    // reserved for future use

    EventHdr_HdrType_Reserved7,

    // reserved for future use

    EventHdr_HdrType_Reserved8,

    // reserved for future use

    EventHdr_HdrType_Reserved9,

    // reserved for future use

    EventHdr_HdrType_Reserved10,

    // reserved for future use

    EventHdr_HdrType_Reserved11,

    // reserved for future use

    EventHdr_HdrType_Reserved12,

    // reserved for future use

    EventHdr_HdrType_Reserved13,

    // reserved for future use

    EventHdr_HdrType_Reserved14,

    // reserved for future use

    EventHdr_HdrType_Reserved15,

    // reserved for future use

    EventHdr_HdrType_Reserved16,

    // reserved for future use

    EventHdr_HdrType_Reserved17,

    // reserved for future use

    EventHdr_HdrType_Reserved18,

    // reserved for future use

    EventHdr_HdrType_Reserved19,

    // reserved for future use

    EventHdr_HdrType_Reserved20,

    // reserved for future use

    EventHdr_HdrType_Reserved21,

    // reserved for future use

    EventHdr_HdrType_Reserved22,

    // reserved for future use

    EventHdr_HdrType_Reserved23,

    // reserved for future use

    EventHdr_HdrType_Reserved24,

    // reserved for future use

    EventHdr_HdrType_Reserved25,

    // reserved for future use

    EventHdr_HdrType_Reserved26,

    // reserved for future use

    EventHdr_HdrType_Reserved27,

    // reserved for future use

    EventHdr_HdrType_Reserved28,

    // reserved for future use

    EventHdr_HdrType_Reserved29,

    // reserved for future use

    EventHdr_HdrType_Reserved30,

    // reserved for future use

    EventHdr_HdrType_Reserved31

    // reserved for future use

} EventHdr_HdrType;

 

DETAILS

Stored in a 5 bit bitfield (b31-b27) of the first word in the event.

 

EventHdr_genEventHdrWord1()  // module-wide

generates the first word to use in an Event header

C synopsis

target-domain

macro UInt32 EventHdr_genEventHdrWord1(SizeT numBytesInEventMsg, UInt16 seqCount, Bool isTimestampEnabled);

 

ARGUMENTS

numBytesInEventMsg — number of bytes in the event

seqCount — sequence count number to tag the event with

isTimestampEnabled — flag indicating if a 64b timestamp is logged with the event

 

EventHdr_getHdrType()  // module-wide

Gets the message header type from the first word of the event header

C synopsis

target-domain

macro EventHdr_HdrType EventHdr_getHdrType(UInt32 eventWord1);

 

ARGUMENTS

eventWord1 — first word of the event header

RETURNS

HdrType of the event

 

EventHdr_getLength()  // module-wide

gets the event length (in bytes) from the event header

C synopsis

target-domain

macro SizeT EventHdr_getLength(UInt32 eventWord1);

 

ARGUMENTS

eventWord1 — first word of the event header

 

EventHdr_getSeqCount()  // module-wide

gets the sequence count from the message header

C synopsis

target-domain

macro UInt16 EventHdr_getSeqCount(UInt32 eventWord1);

 

ARGUMENTS

eventWord1 — first word of the event header

 

EventHdr_setHdrType()  // module-wide

Sets the header type in the event header

C synopsis

target-domain

macro Void EventHdr_setHdrType(UInt32 eventWord1, EventHdr_HdrType hdrType);

 

ARGUMENTS

eventWord1 — the first word of the event header to be updated

HdrType hdrType — the new header type

 

EventHdr_setLength()  // module-wide

sets the event length (in bytes) in the event header

C synopsis

target-domain

macro Void EventHdr_setLength(UInt32 eventWord1, SizeT eventLength);

 

ARGUMENTS

eventWord1 — first word of the event header

eventLength — the new event length

 

EventHdr_setSeqCount()  // module-wide

sets the sequence count in the message header

C synopsis

target-domain

macro Void EventHdr_setSeqCount(UInt32 eventWord1, UInt16 seqCount);

 

ARGUMENTS

eventWord1 — first word of the event header

seqCount — the new message sequence count

 

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