NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
S3 Safe Logging

Detailed Description

Functions

void NvOsDebugPrintStr (uint16_t module_id, uint8_t severity, const char *str)
 This function logs a string in a log buffer. More...
 
void NvOsDebugPrintStrStr (uint16_t module_id, uint8_t severity, const char *str1, const char *str2)
 This function logs two different strings in a log buffer. More...
 
void NvOsDebugPrintStrInt (uint16_t module_id, uint8_t severity, const char *str, int32_t val)
 This function logs a string and int32_t value in a log buffer. More...
 
void NvOsDebugPrintStrUInt (uint16_t module_id, uint8_t severity, const char *str, uint32_t val)
 This function logs a string and an uint32_t value in a log buffer. More...
 
void NvOsDebugPrintStrSLong (uint16_t module_id, uint8_t severity, const char *str, int64_t val)
 This function logs a string and int64_t value in a log buffer. More...
 
void NvOsDebugPrintStrULong (uint16_t module_id, uint8_t severity, const char *str, uint64_t val)
 This function logs a string and uint64_t value in a log buffer. More...
 
void NvOsDebugPrintStrWith2Int (uint16_t module_id, uint8_t severity, const char *str, int32_t value1, int32_t value2)
 This function logs a string with two int32_t values in a log buffer. More...
 
void NvOsDebugPrintStrWith2SLong (uint16_t module_id, uint8_t severity, const char *str, int64_t value1, int64_t value2)
 This function logs a string with two int64_t values in a log buffer. More...
 
void NvOsDebugPrintStrWith2UInt (uint16_t module_id, uint8_t severity, const char *str, uint32_t value1, uint32_t value2)
 This function logs a string with two uint32_t values in a log buffer. More...
 
void NvOsDebugPrintStrWith2ULong (uint16_t module_id, uint8_t severity, const char *str, uint64_t value1, uint64_t value2)
 This function logs a string with two uint64_t values in a log buffer. More...
 
void NvOsDebugPrintStrHexUInt (uint16_t module_id, uint8_t severity, const char *str, uint32_t val)
 This function logs a string and unsigned int value in hexadecimal to a log buffer. More...
 
void NvOsDebugPrintStrHexULong (uint16_t module_id, uint8_t severity, const char *str, uint64_t val)
 This function logs a string and uint64_t value in hexadecimal to a log buffer. More...
 
void NvOsDebugPrintStrWith2HexULong (uint16_t module_id, uint8_t severity, const char *str, uint64_t val1, uint64_t val2)
 This function logs a string and two uint64_t values in hexadecimal to a log buffer. More...
 
void NvOsDebugPrintStrFloat (uint16_t module_id, uint8_t severity, const char *str, float val)
 This function logs a string and float value to a log buffer. More...
 
void NvOsDebugPrintStrWith2Float (uint16_t module_id, uint8_t severity, const char *str, float val1, float val2)
 This function logs a string and two float values to a log buffer. More...
 
void NvOsDebugPrintStrDouble (uint16_t module_id, uint8_t severity, const char *str, double val)
 This function logs a string and a double value to a log buffer. More...
 
void NvOsDebugPrintStrWith2Double (uint16_t module_id, uint8_t severity, const char *str, double val1, double val2)
 This function logs a string and two double values to a log buffer. More...
 
uint32_t NvOsIsLoggingReady (void)
 Checks if logging via NvOS is available. More...
 
uint32_t NvOsInitializeLogging (const int32_t verbosity, const int32_t buf_size)
 Initialize logging for a client. More...
 

Function Documentation

◆ NvOsDebugPrintStr()

void NvOsDebugPrintStr ( uint16_t  module_id,
uint8_t  severity,
const char *  str 
)

This function logs a string in a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrDouble()

void NvOsDebugPrintStrDouble ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
double  val 
)

This function logs a string and a double value to a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]valThe float value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrFloat()

void NvOsDebugPrintStrFloat ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
float  val 
)

This function logs a string and float value to a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]valThe float value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrHexUInt()

void NvOsDebugPrintStrHexUInt ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
uint32_t  val 
)

This function logs a string and unsigned int value in hexadecimal to a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]valThe unsigned int value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrHexULong()

void NvOsDebugPrintStrHexULong ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
uint64_t  val 
)

This function logs a string and uint64_t value in hexadecimal to a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]valThe uint64_t value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrInt()

void NvOsDebugPrintStrInt ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
int32_t  val 
)

This function logs a string and int32_t value in a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]valThe int32_t value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrSLong()

void NvOsDebugPrintStrSLong ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
int64_t  val 
)

This function logs a string and int64_t value in a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]valThe int64_t value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrStr()

void NvOsDebugPrintStrStr ( uint16_t  module_id,
uint8_t  severity,
const char *  str1,
const char *  str2 
)

This function logs two different strings in a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]str1The string that should be logged.
[in]str2The string that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrUInt()

void NvOsDebugPrintStrUInt ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
uint32_t  val 
)

This function logs a string and an uint32_t value in a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]valThe unsigned int value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrULong()

void NvOsDebugPrintStrULong ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
uint64_t  val 
)

This function logs a string and uint64_t value in a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]valThe uint64_t value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrWith2Double()

void NvOsDebugPrintStrWith2Double ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
double  val1,
double  val2 
)

This function logs a string and two double values to a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]val1The double value that should be logged.
[in]val2The double value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrWith2Float()

void NvOsDebugPrintStrWith2Float ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
float  val1,
float  val2 
)

This function logs a string and two float values to a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]val1The float value that should be logged.
[in]val2The float value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrWith2HexULong()

void NvOsDebugPrintStrWith2HexULong ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
uint64_t  val1,
uint64_t  val2 
)

This function logs a string and two uint64_t values in hexadecimal to a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]val1The uint64_t value that should be logged.
[in]val2The uint64_t value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrWith2Int()

void NvOsDebugPrintStrWith2Int ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
int32_t  value1,
int32_t  value2 
)

This function logs a string with two int32_t values in a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]value1The int32_t value that should be logged.
[in]value2The int32_t value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrWith2SLong()

void NvOsDebugPrintStrWith2SLong ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
int64_t  value1,
int64_t  value2 
)

This function logs a string with two int64_t values in a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]value1The int64_t value that should be logged.
[in]value2The int64_t value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrWith2UInt()

void NvOsDebugPrintStrWith2UInt ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
uint32_t  value1,
uint32_t  value2 
)

This function logs a string with two uint32_t values in a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]value1The uint32_t value that should be logged.
[in]value2The uint32_t value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsDebugPrintStrWith2ULong()

void NvOsDebugPrintStrWith2ULong ( uint16_t  module_id,
uint8_t  severity,
const char *  str,
uint64_t  value1,
uint64_t  value2 
)

This function logs a string with two uint64_t values in a log buffer.

Parameters
[in]module_idThe user specific code that is associated the message.
[in]severityThe severity level of this log.
[in]strThe string that should be logged.
[in]value1The uint64_t value that should be logged.
[in]value2The uint64_t value that should be logged.
Returns
N/A


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ NvOsInitializeLogging()

uint32_t NvOsInitializeLogging ( const int32_t  verbosity,
const int32_t  buf_size 
)

Initialize logging for a client.

Parameters
[in]verbosityThe minimum severity to log. The verbosity is one of the following severity levels. If it is not one of the below, it is set to NVOS_LOG_SEVERITY_INFO as default verbosity.
  • NVOS_LOG_SEVERITY_SHUTDOWN (=0U)
  • NVOS_LOG_SEVERITY_CRITICAL (=1U)
  • NVOS_LOG_SEVERITY_ERROR (=2U)
  • NVOS_LOG_SEVERITY_WARNING (=3U)
  • NVOS_LOG_SEVERITY_NOTICE (=4U)
  • NVOS_LOG_SEVERITY_INFO (=5U)
  • NVOS_LOG_SEVERITY_DEBUG1 (=6U)
  • NVOS_LOG_SEVERITY_DEBUG2 (=7U)
[in]buf_sizeLog buffer size for calling process (in kilobytes) that is a multiple of 4. Valid range: [4..256]. The buffer size is determined based on the below. 1) If buf_size <= 0, obtain the buffer size from the envrionment, LOG_BUFFER_SIZE_KB. 2) If buf_size is in the valid range, use it as it is 3) If bug_size is out of the valid range, use NVOS_LOG_BUF_SZ_DEFAULT, which is 28. This parameter is only effective in QNX build.
Returns
NvBoolTrue Initialization for logging is successful
NvBoolFalse Initialization for logging is failed or buf_size is out of the range [NVOS_LOG_BUF_SZ_MIN..NVOS_LOG_BUF_SZ_MAX]
  • NVOS_LOG_BUF_SZ_MIN: 4
  • NVOS_LOG_BUF_SZ_MAX: 256
Note
Logging measure for a client is initialized by default when NvOS S3 is loaded into the client execution environment. To prepare the possibility of an error durint that initialization, client should check the status of logging activation by calling NvOsIsLoggingReady() at client's initialization step. Client should call this function to initialize if NvOsIsLoggingReady() does not return NvSuccess.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: No
    • De-Init: No

◆ NvOsIsLoggingReady()

uint32_t NvOsIsLoggingReady ( void  )

Checks if logging via NvOS is available.

Returns
NvBoolTrue Logging is available
NvBoolFalse Logging it not available


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required Privileges: N/A
  • API Group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes