OpenCSD - CoreSight Trace Decode Library  0.9.0
Classes | Typedefs | Enumerations | Functions
OpenCSD Library : Generic Trace Elements

Generic trace elements output by the PE trace decode and SW stim decode stages. More...

Classes

class  OcsdTraceElement
 Generic trace element class. More...
 
struct  _trace_event_t
 
struct  _ocsd_generic_trace_elem
 

Typedefs

typedef enum _ocsd_gen_trc_elem_t ocsd_gen_trc_elem_t
 
typedef enum _trace_on_reason_t trace_on_reason_t
 
typedef struct _trace_event_t trace_event_t
 
typedef struct _ocsd_generic_trace_elem ocsd_generic_trace_elem
 
typedef enum _event_t event_t
 

Enumerations

enum  _ocsd_gen_trc_elem_t {
  OCSD_GEN_TRC_ELEM_UNKNOWN = 0, OCSD_GEN_TRC_ELEM_NO_SYNC, OCSD_GEN_TRC_ELEM_TRACE_ON, OCSD_GEN_TRC_ELEM_EO_TRACE,
  OCSD_GEN_TRC_ELEM_PE_CONTEXT, OCSD_GEN_TRC_ELEM_INSTR_RANGE, OCSD_GEN_TRC_ELEM_ADDR_NACC, OCSD_GEN_TRC_ELEM_ADDR_UNKNOWN,
  OCSD_GEN_TRC_ELEM_EXCEPTION, OCSD_GEN_TRC_ELEM_EXCEPTION_RET, OCSD_GEN_TRC_ELEM_TIMESTAMP, OCSD_GEN_TRC_ELEM_CYCLE_COUNT,
  OCSD_GEN_TRC_ELEM_EVENT, OCSD_GEN_TRC_ELEM_SWTRACE, OCSD_GEN_TRC_ELEM_CUSTOM
}
 
enum  _trace_on_reason_t { TRACE_ON_NORMAL = 0, TRACE_ON_OVERFLOW, TRACE_ON_EX_DEBUG }
 
enum  _event_t { EVENT_UNKNOWN = 0, EVENT_TRIGGER, EVENT_NUMBERED }
 

Functions

 OcsdTraceElement::OcsdTraceElement (ocsd_gen_trc_elem_t type)
 
 OcsdTraceElement::OcsdTraceElement ()
 
void OcsdTraceElement::setCycleCount (const uint32_t cycleCount)
 
void OcsdTraceElement::setEvent (const event_t ev_type, const uint16_t number)
 
void OcsdTraceElement::setAddrRange (const ocsd_vaddr_t st_addr, const ocsd_vaddr_t en_addr, const int num_instr=1)
 
void OcsdTraceElement::setLastInstrInfo (const bool exec, const ocsd_instr_type last_i_type, const ocsd_instr_subtype last_i_subtype, const uint8_t size)
 
void OcsdTraceElement::setType (const ocsd_gen_trc_elem_t type)
 set type and init flags More...
 
void OcsdTraceElement::updateType (const ocsd_gen_trc_elem_t type)
 change type only - no init More...
 
void OcsdTraceElement::init ()
 
void OcsdTraceElement::setTraceOnReason (const trace_on_reason_t reason)
 
void OcsdTraceElement::setISA (const ocsd_isa isa_update)
 
void OcsdTraceElement::setTS (const uint64_t ts, const bool freqChange=false)
 
void OcsdTraceElement::setExtendedDataPtr (const void *data_ptr)
 

Detailed Description

Generic trace elements output by the PE trace decode and SW stim decode stages.

Typedef Documentation

◆ event_t

typedef enum _event_t event_t

◆ ocsd_gen_trc_elem_t

Enum for generic element types

◆ ocsd_generic_trace_elem

◆ trace_event_t

typedef struct _trace_event_t trace_event_t

◆ trace_on_reason_t

Enumeration Type Documentation

◆ _event_t

enum _event_t
Enumerator
EVENT_UNKNOWN 
EVENT_TRIGGER 
EVENT_NUMBERED 

Definition at line 118 of file trc_gen_elem_types.h.

◆ _ocsd_gen_trc_elem_t

Enum for generic element types

Enumerator
OCSD_GEN_TRC_ELEM_UNKNOWN 

Unknown trace element - default value or indicate error in stream to client

OCSD_GEN_TRC_ELEM_NO_SYNC 

Waiting for sync - either at start of decode, or after overflow / bad packet

OCSD_GEN_TRC_ELEM_TRACE_ON 

Start of trace - beginning of elements or restart after discontinuity (overflow, trace filtering).

OCSD_GEN_TRC_ELEM_EO_TRACE 

end of the available trace in the buffer.

OCSD_GEN_TRC_ELEM_PE_CONTEXT 

PE status update / change (arch, ctxtid, vmid etc).

OCSD_GEN_TRC_ELEM_INSTR_RANGE 

traced N consecutive instructions from addr (no intervening events or data elements), may have data assoc key

OCSD_GEN_TRC_ELEM_ADDR_NACC 

tracing in inaccessible memory area

OCSD_GEN_TRC_ELEM_ADDR_UNKNOWN 

address currently unknown - need address packet update

OCSD_GEN_TRC_ELEM_EXCEPTION 

exception - start address may be exception target, end address may be preferred ret addr.

OCSD_GEN_TRC_ELEM_EXCEPTION_RET 

expection return

OCSD_GEN_TRC_ELEM_TIMESTAMP 

Timestamp - preceding elements happeded before this time.

OCSD_GEN_TRC_ELEM_CYCLE_COUNT 

Cycle count - cycles since last cycle count value - associated with a preceding instruction range.

OCSD_GEN_TRC_ELEM_EVENT 

Event - trigger or numbered event

OCSD_GEN_TRC_ELEM_SWTRACE 

Software trace packet - may contain data payload.

OCSD_GEN_TRC_ELEM_CUSTOM 

Fully custom packet type - used by none-ARM architecture decoders

Definition at line 47 of file trc_gen_elem_types.h.

◆ _trace_on_reason_t

Enumerator
TRACE_ON_NORMAL 

Trace on at start of trace or filtering discontinuity

TRACE_ON_OVERFLOW 

Trace on due to prior trace overflow discontinuity

TRACE_ON_EX_DEBUG 

Trace restarted due to debug exit

Definition at line 67 of file trc_gen_elem_types.h.

Function Documentation

◆ init()

void OcsdTraceElement::init ( )
inline

Definition at line 153 of file trc_gen_elem.h.

Here is the caller graph for this function:

◆ OcsdTraceElement() [1/2]

OcsdTraceElement::OcsdTraceElement ( )
inline

Definition at line 108 of file trc_gen_elem.h.

◆ OcsdTraceElement() [2/2]

OcsdTraceElement::OcsdTraceElement ( ocsd_gen_trc_elem_t  type)
inline

Definition at line 103 of file trc_gen_elem.h.

◆ setAddrRange()

void OcsdTraceElement::setAddrRange ( const ocsd_vaddr_t  st_addr,
const ocsd_vaddr_t  en_addr,
const int  num_instr = 1 
)
inline

Definition at line 125 of file trc_gen_elem.h.

Here is the caller graph for this function:

◆ setCycleCount()

void OcsdTraceElement::setCycleCount ( const uint32_t  cycleCount)
inline

Definition at line 113 of file trc_gen_elem.h.

Here is the caller graph for this function:

◆ setEvent()

void OcsdTraceElement::setEvent ( const event_t  ev_type,
const uint16_t  number 
)
inline

Definition at line 119 of file trc_gen_elem.h.

Here is the caller graph for this function:

◆ setExtendedDataPtr()

void OcsdTraceElement::setExtendedDataPtr ( const void *  data_ptr)
inline

Definition at line 197 of file trc_gen_elem.h.

Here is the caller graph for this function:

◆ setISA()

void OcsdTraceElement::setISA ( const ocsd_isa  isa_update)
inline

Definition at line 183 of file trc_gen_elem.h.

Here is the caller graph for this function:

◆ setLastInstrInfo()

void OcsdTraceElement::setLastInstrInfo ( const bool  exec,
const ocsd_instr_type  last_i_type,
const ocsd_instr_subtype  last_i_subtype,
const uint8_t  size 
)
inline

Definition at line 132 of file trc_gen_elem.h.

Here is the caller graph for this function:

◆ setTraceOnReason()

void OcsdTraceElement::setTraceOnReason ( const trace_on_reason_t  reason)
inline

Definition at line 178 of file trc_gen_elem.h.

Here is the caller graph for this function:

◆ setTS()

void OcsdTraceElement::setTS ( const uint64_t  ts,
const bool  freqChange = false 
)
inline

Definition at line 190 of file trc_gen_elem.h.

Here is the caller graph for this function:

◆ setType()

void OcsdTraceElement::setType ( const ocsd_gen_trc_elem_t  type)
inline

set type and init flags

Definition at line 140 of file trc_gen_elem.h.

Here is the caller graph for this function:

◆ updateType()

void OcsdTraceElement::updateType ( const ocsd_gen_trc_elem_t  type)
inline

change type only - no init

Definition at line 148 of file trc_gen_elem.h.

Here is the caller graph for this function: