Telematics SDK - API Reference  v1.64.0
Diagnostics Services

Data Structures

struct  telux::platform::diag::DiagStatus
 
union  telux::platform::diag::SourceInfo
 
struct  telux::platform::diag::FileMethodConfig
 Represents the config relevant to File method. Logs are saved to a file under the directory specified by platform.diag.diag_output_log_path in tel.conf file. if Key does not exist, log will be stored in default location /tmp/diag. More...
 
struct  telux::platform::diag::DiagConfig
 
class  telux::platform::diag::IDiagLogManager
 IDiagLogManager is a primary interface for Diagnostics. The interface offers APIs to configure log collection method (File or Callback) and configure log mode for selected method (streaming, threshold, or circular). The interface also provides APIs to start and stop diagnostics log collection in configured method and mode. More...
 
class  telux::platform::diag::IDiagListener
 
class  telux::platform::diag::DiagnosticsFactory
 DiagnosticsFactory is the central factory to create Diagnostics manager class. More...
 

Typedefs

using telux::platform::diag::Devices = uint8_t
 
using telux::platform::diag::Peripherals = uint8_t
 

Enumerations

enum  telux::platform::diag::DiagLogMode { telux::platform::diag::DiagLogMode::STREAMING = 0, telux::platform::diag::DiagLogMode::THRESHOLD, telux::platform::diag::DiagLogMode::CIRCULAR_BUFFER }
 
enum  telux::platform::diag::DeviceType { telux::platform::diag::DIAG_DEVICE_NONE = 0, telux::platform::diag::DIAG_DEVICE_EXTERNAL_AP = 1 << 0, telux::platform::diag::DIAG_DEVICE_MDM = 1 << 1 }
 
enum  telux::platform::diag::PeripheralType {
  telux::platform::diag::DIAG_PERIPHERAL_NONE = 0, telux::platform::diag::DIAG_PERIPHERAL_INTEGRATED_AP = 1 << 0, telux::platform::diag::DIAG_PERIPHERAL_MODEM_DSP = 1 << 1, telux::platform::diag::DIAG_PERIPHERAL_SVM = 1 << 2,
  telux::platform::diag::DIAG_PERIPHERAL_LPASS = 1 << 3, telux::platform::diag::DIAG_PERIPHERAL_CDSP = 1 << 4
}
 
enum  telux::platform::diag::LogMethod { telux::platform::diag::LogMethod::NONE = 0, telux::platform::diag::LogMethod::FILE, telux::platform::diag::LogMethod::CALLBACK }
 
enum  telux::platform::diag::SourceType { telux::platform::diag::SourceType::NONE = 0, telux::platform::diag::SourceType::DEVICE, telux::platform::diag::SourceType::PERIPHERAL }
 

Detailed Description

This section contains APIs related to diagnostics services.


Data Structure Documentation

struct telux::platform::diag::DiagStatus

Current diagnostic status

Data Fields
LogMethod logMethod

Current successfully configured logging method

bool isLoggingInProgress

True: If logging has already started. False otherwise

bool isLogDrainInProgress

True: If log drain has already started. False otherwise

union telux::platform::diag::SourceInfo

Configure device(s) or peripheral(s) from which logs to be collected. Logging source can be either device level or peripheral level.

Data Fields
Devices device

telux::platform::diag::Device

Peripherals peripheral

telux::platform::diag::Peripheral

struct telux::platform::diag::FileMethodConfig

Represents the config relevant to File method. Logs are saved to a file under the directory specified by platform.diag.diag_output_log_path in tel.conf file. if Key does not exist, log will be stored in default location /tmp/diag.

Data Fields
uint32_t maxSize

Optional. Maximum file size in MB after which it will create a new file. The maximum size should not exceed MAX_DIAG_FILE_SIZE_MB.

uint32_t maxNumber

Optional. Maximum number of log files. Files are replaced once this number is reached. The maximum value should not exceed MAX_NUM_DIAG_FILES

struct telux::platform::diag::DiagConfig
Data Fields
SourceType srcType

telux::platform::diag::SourceType

SourceInfo srcInfo

telux::platform::diag::SourceInfo. Based on the source type selected in DiagConfig.srcType, the corresponding field in DiagConfig.srcInfo would be valid.

string mdmLogMaskFile

Optional - Full path to file that contains the MDM mask to filter logs. It is generated using QxDM and can be either cfg or cfg2 format. Needed only if logs are generated from MDM device or MDM peripherals

string eapLogMaskFile

Optional - Full path to file that contains the EAP mask to filter logs. It is generated using QxDM and can be either cfg or cfg2 format. Needed only if logs are generated from EAP device or EAP peripherals

DiagLogMode modeType

telux::platform::diag::DiagLogMode

LogMethod method

telux::platform::diag::LogMethod

union MethodConfig methodConfig
class telux::platform::diag::IDiagLogManager

IDiagLogManager is a primary interface for Diagnostics. The interface offers APIs to configure log collection method (File or Callback) and configure log mode for selected method (streaming, threshold, or circular). The interface also provides APIs to start and stop diagnostics log collection in configured method and mode.

Public Member Functions

virtual DiagStatus getStatus ()=0
 
virtual telux::common::Status registerListener (std::weak_ptr< IDiagListener > listener)=0
 
virtual telux::common::Status deregisterListener (std::weak_ptr< IDiagListener > listener)=0
 
virtual telux::common::ErrorCode setConfig (const DiagConfig config)=0
 
virtual DiagConfig getConfig ()=0
 
virtual telux::common::ErrorCode startDrainingLogs ()=0
 
virtual telux::common::ErrorCode stopDrainingLogs ()=0
 
virtual telux::common::ErrorCode startLogCollection ()=0
 
virtual telux::common::ErrorCode stopLogCollection ()=0
 
virtual ~IDiagLogManager ()
 

Constructor & Destructor Documentation

virtual telux::platform::diag::IDiagLogManager::~IDiagLogManager ( )
virtual

Destructor for IDiagLogManager

Member Function Documentation

virtual DiagStatus telux::platform::diag::IDiagLogManager::getStatus ( )
pure virtual

Returns the current status of logging subsystem.

Returns
Status of logging subsystem telux::platform::diag::DiagStatus
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::platform::diag::IDiagLogManager::registerListener ( std::weak_ptr< IDiagListener listener)
pure virtual

Register a listener for specific events in the Diag log Manager like availability of logs, checking for unexpected error.

Parameters
[in]listenerPointer of IDiagListener object that processes the notification
Returns
Status of registerListener success or suitable status code
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::platform::diag::IDiagLogManager::deregisterListener ( std::weak_ptr< IDiagListener listener)
pure virtual

Removes a previously added listener.

Parameters
[in]listenerPointer of IDiagListener object that needs to be removed
Returns
Status of deregisterListener success or suitable status code
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::ErrorCode telux::platform::diag::IDiagLogManager::setConfig ( const DiagConfig  config)
pure virtual

Sets the logging configurations.

This API must be called when logging is not in progress. Calling this API while logging has already started will return telux::common::ErrorCode::INVALID_STATE error. If error is returned, clients need to invoke the API again with the correct parameters.

On platforms with Access control enabled, Caller needs to have TELUX_DIAG_OPS permission to invoke this API successfully.

Parameters
[in]configtelux::platform::diag::DiagConfig
Returns
Return code for whether the operation succeeded or failed telux::common::ErrorCode
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual DiagConfig telux::platform::diag::IDiagLogManager::getConfig ( )
pure virtual

Get current configuration settings

Returns
current log configuration telux::platform::diag::DiagConfig.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::ErrorCode telux::platform::diag::IDiagLogManager::startDrainingLogs ( )
pure virtual

Starts draining the logs from the circular buffer. Until telux::platform::diag::stopDrainingLogsLogs is called, logs will continue to be written to circular buffer, getting flushed and written to log file or provided to client via telux::platform::diag::IDiagListener::onAvailableLogs based on selected logging method telux::platform::diag::LogMethod. If this API is called while logging has not started, telux::common::ErrorCode::INVALID_STATE error is returned. Attempt to call this API while draining log is already in progress, will not affect the state of logging and will return telux::common::ErrorCode::NO_EFFECT error.

This API should be used only in circular buffering mode.

On platforms with Access control enabled, Caller needs to have TELUX_DIAG_OPS permission to invoke this API successfully.

Returns
Return code for whether the operation succeeded or failed telux::common::ErrorCode
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::ErrorCode telux::platform::diag::IDiagLogManager::stopDrainingLogs ( )
pure virtual

Stops the draining of logs and continues collecting logs in circular buffer mode. This API should be used only in circular buffering mode. If this API is called while logging has not started telux::common::ErrorCode::INVALID_STATE error is returned. Attempt to call this API while draining log is not in progress, will not affect the state of logging and will return telux::common::ErrorCode::NO_EFFECT error.

On platforms with Access control enabled, Caller needs to have TELUX_DIAG_OPS permission to invoke this API successfully.

Returns
Return code for whether the operation succeeded or failed telux::common::ErrorCode
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::ErrorCode telux::platform::diag::IDiagLogManager::startLogCollection ( )
pure virtual

Start the Log collection session This API starts the log collection. It is expected the configuration to be set successfully via telux::platform::diag::IDiagLogManager::setConfig before calling this API. Calling this API after logging has already started will not affect logging state and will return telux::common::ErrorCode::NO_EFFECT error.

On platforms with Access control enabled, Caller needs to have TELUX_DIAG_OPS permission to invoke this API successfully.

Returns
Return code for whether the operation succeeded or failed telux::common::ErrorCode Error is returned if configuration is not set correctly.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::ErrorCode telux::platform::diag::IDiagLogManager::stopLogCollection ( )
pure virtual

Stop the Log collection session

On platforms with Access control enabled, Caller needs to have TELUX_DIAG_OPS permission to invoke this API successfully.

Returns
Return code for whether the operation succeeded or failed telux::common::ErrorCode
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
class telux::platform::diag::IDiagListener

Interface for Diag listener object. Client needs to implement this interface to get access to diag log service notifications like onAvailableLogs, onError.

The methods in listener can be invoked from multiple different threads. The implementation should be thread safe.

The notification delivery mechanism uses the same thread to deliver all the queued notifications to ensure they are delivered in order. Considering this, the thread on which the notifications are delivered should not be blocked for longer operations since this would result in delay in delivery of further notifications that are in the queue waiting to be dispatched.

Public Member Functions

virtual void onAvailableLogs (uint8_t *ptr, int len)
 
virtual ~IDiagListener ()
 

Constructor & Destructor Documentation

virtual telux::platform::diag::IDiagListener::~IDiagListener ( )
virtual

Destructor for IDiagListener

Member Function Documentation

virtual void telux::platform::diag::IDiagListener::onAvailableLogs ( uint8_t *  ptr,
int  len 
)
virtual

Invoked when logs are available in callback method to when they are available.

Parameters
[in]ptrPointer to the log data
[in]lenLength of the data
class telux::platform::diag::DiagnosticsFactory

DiagnosticsFactory is the central factory to create Diagnostics manager class.

Public Member Functions

virtual std::shared_ptr< IDiagLogManagergetDiagLogManager (telux::common::InitResponseCb clientCallback=nullptr)=0
 

Static Public Member Functions

static DiagnosticsFactorygetInstance ()
 

Protected Member Functions

 DiagnosticsFactory ()
 
virtual ~DiagnosticsFactory ()
 

Constructor & Destructor Documentation

telux::platform::diag::DiagnosticsFactory::DiagnosticsFactory ( )
protected
virtual telux::platform::diag::DiagnosticsFactory::~DiagnosticsFactory ( )
protectedvirtual

Member Function Documentation

static DiagnosticsFactory& telux::platform::diag::DiagnosticsFactory::getInstance ( )
static

Get Diagnostics Factory instance.

virtual std::shared_ptr<IDiagLogManager> telux::platform::diag::DiagnosticsFactory::getDiagLogManager ( telux::common::InitResponseCb  clientCallback = nullptr)
pure virtual

Get Diagnostics Manager

Returns
instance of IDiagLogManager

Typedef Documentation

using telux::platform::diag::Devices = typedef uint8_t
using telux::platform::diag::Peripherals = typedef uint8_t

This is a bitmask which takes the peripherals from telux::platform::diag::PeripheralType using Peripheral.

Enumeration Type Documentation

Specifies the mode of logging to be used (Streaming, threshold, circular buffer)

Enumerator
STREAMING 

Logs are flushed immediately from the buffer when available. Logs are saved to a file (in file method) or passed to the client in real time through listener IDiagListener::onAvailableLogs() (in callback method)

THRESHOLD 

Can be used to conserve power. Logs are flushed out when the buffer is full. This is only applicable to peripherals with its own buffer such as Modem DSP. It is not recommended to enable too many logs in logmask file passed to telux::platform::diag::setConfig API. Too many logs will cause frequent processor wake ups and consequently result in the threshold being crossed and logs being flushed frequently resembling streaming mode.

CIRCULAR_BUFFER 

Can be used to conserve power. Logs are continuously written to a buffer until client triggers buffer drain command to collect the logs. This is only applicable to peripherals with its own buffer such as Modem DSP. Old logs are overwritten when buffer is full. Logs in the buffer will be flushed only upon client's request.

Enables log collection from selected device(s) which includes logs from Integrated AP and all peripherals on the device. Note: If device logging is enabled, peripheral logging must be disabled.

Enumerator
DIAG_DEVICE_NONE 

Device logging is disabled. Only peripheral logging on device application is running on is enabled

DIAG_DEVICE_EXTERNAL_AP 

Log collection from External Application Processor is enabled

DIAG_DEVICE_MDM 

Log collection from MDM is enabled

Enables log collection from selected peripheral (if it exists) and/or application processor in the device where the client of the API is running. Note: If peripheral logging is enabled, device logging must be disabled.

Enumerator
DIAG_PERIPHERAL_NONE 

Disable peripherals log collection

DIAG_PERIPHERAL_INTEGRATED_AP 

Enable integrated AP log collection. On platforms where hypervisor is present, this indicates logs from PVM

DIAG_PERIPHERAL_MODEM_DSP 

Enable modem DSP log collection

DIAG_PERIPHERAL_SVM 

Enable log collection on all SVMs

DIAG_PERIPHERAL_LPASS 

Enable LPASS log collection

DIAG_PERIPHERAL_CDSP 

Enable CDSP log collection

Diagnostic logging methods. Only one logging method can be selected

Enumerator
NONE 

No valid logging method

FILE 

File logging method. Collected Logs will be saved to file located under platform.diag.diag_output_log_path key in tel.conf file or under /tmp/diag if such key does not exist

CALLBACK 

Callback logging method. Collected logs are provided to clients via telux::platform::diag::IDiagListener::onAvailableLogs

Diagnostic log source. When device level logging is selected from telux::platform::diag::Device and logs from all peripherals in such device will be collected. When peripheral logging is selected from telux::platform::diag::Peripheral, logs from selected peripherals will be collected.

Enumerator
NONE 

No valid logging source

DEVICE 

Device level logging source.

PERIPHERAL 

Peripheral level logging source