Phosphor
phosphor::TraceEvent Class Reference

Classes

class  ToJsonResult
 

Public Types

enum  Type : char {
  AsyncStart, AsyncEnd, SyncStart, SyncEnd,
  Instant, GlobalInstant
}
 

Public Member Functions

 TraceEvent ()=default
 
 TraceEvent (const tracepoint_info *_tpi, Type _type, uint32_t _thread_id, std::array< TraceArgument, arg_count > &&_args, std::array< TraceArgument::Type, arg_count > &&_arg_types)
 
std::string to_string () const
 
std::string to_json () const
 
const char * getName () const
 
const char * getCategory () const
 
Type getType () const
 
uint64_t getThreadID () const
 
const std::array< TraceArgument, arg_count > & getArgs () const
 
const std::array< TraceArgument::Type, arg_count > & getArgTypes () const
 
const std::array< const char *, arg_count > & getArgNames () const
 
int64_t getTime () const
 

Static Public Member Functions

static const char * typeToString (Type type)
 

Protected Member Functions

ToJsonResult typeToJSON () const
 

Member Enumeration Documentation

enum phosphor::TraceEvent::Type : char
strong

The enumeration representing the different types of TraceEvents

Constructor & Destructor Documentation

phosphor::TraceEvent::TraceEvent ( )
default

Default constructor for efficient TraceChunk initialisation

phosphor::TraceEvent::TraceEvent ( const tracepoint_info _tpi,
Type  _type,
uint32_t  _thread_id,
std::array< TraceArgument, arg_count > &&  _args,
std::array< TraceArgument::Type, arg_count > &&  _arg_types 
)

Constructor for creating new events

Parameters
_tpiTracepoint info for the event
_typeThe event type
_argsAn array of Value
_arg_typesAn array of argument types

Member Function Documentation

const std::array< const char *, arg_count > & phosphor::TraceEvent::getArgNames ( ) const
Returns
the names of the arguments of the event
const std::array< TraceArgument, arg_count > & phosphor::TraceEvent::getArgs ( ) const
Returns
the arguments of the event
const std::array< TraceArgument::Type, arg_count > & phosphor::TraceEvent::getArgTypes ( ) const
Returns
the types of the arguments of the event
const char * phosphor::TraceEvent::getCategory ( ) const
Returns
the category of the event
const char * phosphor::TraceEvent::getName ( ) const
Returns
the name of the event
uint64_t phosphor::TraceEvent::getThreadID ( ) const
Returns
the thread id of the event
int64_t phosphor::TraceEvent::getTime ( ) const
Returns
the timestamp of the event measured in nanoseconds from an undefined epoch
TraceEvent::Type phosphor::TraceEvent::getType ( ) const
Returns
the type of the event
std::string phosphor::TraceEvent::to_json ( ) const

Used to get a JSON object representation of the TraceEvent

Returns
JSON object representing the TraceEvent
std::string phosphor::TraceEvent::to_string ( ) const

Used to get a string representation of the TraceEvent

Returns
string representation of the TraceEvent
TraceEvent::ToJsonResult phosphor::TraceEvent::typeToJSON ( ) const
protected

Get the required JSON parts for the type of the object. i.e. the event type character and any bonus strings.

Returns
pair where first is the type character and the second is any bonus parts of the JSON row
const char * phosphor::TraceEvent::typeToString ( Type  type)
static

Converts a TraceEvent::Type to a cstring

Returns
cstring representing the given event type

The documentation for this class was generated from the following files: