NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release
stm_logging.h File Reference

Detailed Description

STM Logging APIs.

Overview:

The logging APIs provide alternative path to log STM runtime data if desired.

STM Logger:

Logger correspond to a single process controlling logging execution. Logger is expected to launch and connect with Master before any Client connect to Master.

Alongside STM clients, STM master expects a Logger process to connect with it. STM Logger will block at the call to stmLoggerInit() until the STM master process has been launched.

Definition in file stm_logging.h.

Go to the source code of this file.

Data Structures

struct  stmElementInfo_t
 A singular event. More...
 
struct  stmPerfInfo_t
 A singular perfInfo event. More...
 
struct  stmStateInfo_t
 A singular State Manager event. More...
 
struct  stmHeaderInfo_t
 STM Log Header Information needed by STM Analytics. More...
 

Macros

#define STM_RESOURCE_NAME_MAX   (41)
 
#define STM_MAX_SCHEDULES   (8)
 

Typedefs

typedef enum stmEventType_t stmEventType_t
 Types of Events logged by STM. More...
 
typedef uint16_t stmElementOptionalVal
 
typedef uint64_t stmElementTimestamp
 
typedef int(* stmLoggingEventCallback_t) (void *userdata, stmElementInfo_t *buf, size_t size)
 Function signature for STM event log callbacks. More...
 
typedef int(* stmLoggingStateCallback_t) (void *userdata, stmStateInfo_t *buf, size_t size)
 Function signature for STM state manager log callbacks. More...
 
typedef int(* stmLoggingPerfInfoCallback_t) (void *userdata, stmPerfInfo_t *buf, size_t size)
 Function signature for perfInfo log Callbacks. More...
 

Enumerations

enum  stmClockInfo_t {
  stmClock_HW = 0,
  stmClock_REALTIME,
  stmClock_PTP_IOCTL_NVPPS,
  stmClock_DGPU,
  stmClock_THREAD_CPU
}
 Types of Clocks used by STM. More...
 
enum  stmEventType_t {
  STM_EVENT_EXECUTION_START = 0,
  STM_EVENT_EXECUTION_END,
  STM_EVENT_FRAME_SKIPPED,
  STM_EVENT_CLIENT_CONNECT,
  STM_EVENT_CLIENT_DISCONNECT,
  STM_EVENT_CLIENT_CRASH,
  STM_EVENT_FENCE_TIMESTAMP_CF,
  STM_EVENT_FENCE_TIMESTAMP_SF,
  STM_EVENT_RUNNABLE_START,
  STM_EVENT_RUNNABLE_END,
  STM_EVENT_COLLECT_RTC,
  STM_EVENT_COLLECT_TSC,
  STM_EVENT_STATE_UPDATE,
  STM_EVENT_PERFORMANCE,
  STM_EVENT_CUSUB_OVERHEAD,
  STM_EVENT_CUF_OVERHEAD,
  STM_EVENT_VPUSUB_OVERHEAD,
  STM_EVENT_VPUF_OVERHEAD,
  STM_EVENT_CUDLASUB_OVERHEAD,
  STM_EVENT_CUDLAF_OVERHEAD,
  STM_EVENT_VULKANSUB_OVERHEAD,
  STM_EVENT_VULKANF_OVERHEAD,
  STM_EVENT_LDCSUB_OVERHEAD,
  STM_EVENT_LDCF_OVERHEAD,
  STM_EVENT_NV2DSUB_OVERHEAD,
  STM_EVENT_NV2DF_OVERHEAD,
  STM_EVENT_TIMESTAMP_COLLECTION_OVERHEAD,
  STM_EVENT_THREAD_START,
  STM_EVENT_THREAD_END,
  STM_EVENT_ERROR,
  STM_EVENT_MAX
}
 Types of Events logged by STM. More...
 
enum  stmPerformanceEvent_t {
  INIT_TIME_START = 0,
  INIT_TIME_DONE,
  ARG_PARSING_TIME_START,
  ARG_PARSING_TIME_DONE,
  SCHED_PARSING_TIME_START,
  SCHED_PARSING_TIME_DONE,
  COMMAND_RESOURCE_TIME_START,
  COMMAND_RESOURCE_TIME_DONE,
  SYNC_TIME_START,
  SYNC_TIME_DONE,
  SCHED_START_INIT,
  SCHED_START_DONE,
  SCHED_STOP_INIT,
  SCHED_STOP_DONE,
  SCHED_ROLLOVER_INIT,
  SCHED_ROLLOVER_DONE,
  SCHED_CALLBACK_START,
  SCHED_CALLBACK_DONE,
  INIT_MEMORY_OVERHEAD,
  SYNC_MEMORY_OVERHEAD,
  COMMAND_RESOURCE_MEMORY_OVERHEAD,
  SHM_COMM_SETUP_TIME_START,
  SHM_COMM_SETUP_TIME_STOP,
  LOGGER_SETUP_TIME_START,
  LOGGER_SETUP_TIME_STOP,
  MANAGED_CLIENT_SPAWN_START,
  MANAGED_CLIENT_SPAWN_STOP
}
 Type of event being logged for STM_EVENT_PERFORMANCE events. More...
 

Functions

STM_API stmErrorCode_t stmLoggerInit (stmHeaderInfo_t *header)
 Initialize STM logger context. More...
 
STM_API stmErrorCode_t stmLoggerInitWithDiscriminator (int32_t discriminator, stmHeaderInfo_t *header)
 Initialize STM logger context with a discriminator. More...
 
STM_API stmErrorCode_t stmRegisterEventCallBack (stmLoggingEventCallback_t func, void *userdata)
 Registers a callback function with the Logger to be invoked during a event buffer write. More...
 
STM_API stmErrorCode_t stmRegisterStateCallBack (stmLoggingStateCallback_t func, void *userdata)
 Registers a callback function with the Logger to be invoked during a state buffer write. More...
 
STM_API stmErrorCode_t stmRegisterPerfInfoCallBack (stmLoggingPerfInfoCallback_t func, void *userdata)
 Registers a callback function with the Logger to be invoked during a perfInfo buffer write. More...
 
STM_API stmErrorCode_t stmEnterLoggingLoop ()
 Enters logging loop which logs at a set frequency. More...
 
STM_API stmErrorCode_t stmLoggerFlush (void)
 Flush all buffers to the callbacks. More...
 
STM_API stmErrorCode_t stmLoggerExit (void)
 Cleans up STM logger context. More...