automotive-dlt
dlt_daemon_offline_logstorage.h File Reference
Include dependency graph for dlt_daemon_offline_logstorage.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DLT_DAEMON_LOGSTORAGE_RESET_LOGLEVEL   -1
 
#define DLT_DAEMON_LOGSTORAGE_RESET_SEND_LOGLEVEL   0
 

Functions

int dlt_daemon_logstorage_get_loglevel (DltDaemon *daemon, int max_device, char *apid, char *ctid)
 
void dlt_daemon_logstorage_reset_application_loglevel (DltDaemon *daemon, int dev_num, int max_device, int verbose)
 
void dlt_daemon_logstorage_update_application_loglevel (DltDaemon *daemon, int dev_num, int verbose)
 
void dlt_daemon_logstorage_write (DltDaemon *daemon, DltDaemonFlags *user_config, unsigned char *data1, int size1, unsigned char *data2, int size2, unsigned char *data3, int size3)
 
int dlt_daemon_logstorage_setup_internal_storage (DltDaemon *daemon, char *path, int verbose)
 
void dlt_daemon_logstorage_set_logstorage_cache_size (unsigned int size)
 
int dlt_daemon_logstorage_cleanup (DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose)
 
int dlt_daemon_logstorage_sync_cache (DltDaemon *daemon, DltDaemonLocal *daemon_local, char *mnt_point, int verbose)
 
DltLogStoragedlt_daemon_logstorage_get_device (DltDaemon *daemon, DltDaemonLocal *daemon_local, char *mnt_point, int verbose)
 

Detailed Description

app begin@ Copyright (C) 2013 - 2015 Advanced Driver Information Technology. This code is developed by Advanced Driver Information Technology. Copyright of Advanced Driver Information Technology, Bosch and DENSO.

DLT offline log storage functionality header file.

Author
Syed Hameed shame.nosp@m.ed@j.nosp@m.p.adi.nosp@m.t-jv.nosp@m..com ADIT 2013 - 2015
Christoph Lipka clipk.nosp@m.a@jp.nosp@m..adit.nosp@m.-jv..nosp@m.com ADIT 2015

For further information see http://www.genivi.org/. end@

Definition in file dlt_daemon_offline_logstorage.h.

Macro Definition Documentation

#define DLT_DAEMON_LOGSTORAGE_RESET_LOGLEVEL   -1
#define DLT_DAEMON_LOGSTORAGE_RESET_SEND_LOGLEVEL   0

Function Documentation

int dlt_daemon_logstorage_cleanup ( DltDaemon daemon,
DltDaemonLocal daemon_local,
int  verbose 
)

Cleanup dlt logstorage

Parameters
daemonPointer to Dlt Daemon structure
daemon_localPointer to Dlt Daemon Local structure
verboseIf set to true verbose information is printed out

Definition at line 579 of file dlt_daemon_offline_logstorage.c.

References DltLogStorage::connection_type, dlt_logstorage_device_disconnected(), DLT_LOGSTORAGE_SYNC_ON_DAEMON_EXIT, DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED, DltDaemonLocal::flags, NULL, DltDaemonFlags::offlineLogstorageMaxDevices, PRINT_FUNCTION_VERBOSE, and DltDaemon::storage_handle.

Referenced by dlt_daemon_local_cleanup().

DltLogStorage* dlt_daemon_logstorage_get_device ( DltDaemon daemon,
DltDaemonLocal daemon_local,
char *  mnt_point,
int  verbose 
)

dlt_logstorage_get_device

Get a Logstorage device handle for given the mount point.

Parameters
daemonPointer to Dlt Daemon structure
daemon_localPointer to Dlt Daemon Local structure
mount_pointLogstorage device mount point
verboseIf set to true verbose information is printed out
Returns
handle to Logstorage device on success, NULL otherwise

Definition at line 658 of file dlt_daemon_offline_logstorage.c.

References DltLogStorage::device_mount_point, DltDaemonLocal::flags, NULL, DltDaemonFlags::offlineLogstorageMaxDevices, PRINT_FUNCTION_VERBOSE, and DltDaemon::storage_handle.

Referenced by dlt_daemon_logstorage_sync_cache().

int dlt_daemon_logstorage_get_loglevel ( DltDaemon daemon,
int  max_device,
char *  apid,
char *  ctid 
)

dlt_daemon_logstorage_get_loglevel

Obtain log level as a union of all configured storage devices and filters for the provided application id and context id

Parameters
daemonPointer to DLT Daemon structure
max_deviceMaximum storage devices setup by the daemon
apidApplication ID
ctidContext ID
Returns
Log level on success, -1 on error

Definition at line 431 of file dlt_daemon_offline_logstorage.c.

References config, DltLogStorage::config_status, dlt_logstorage_get_config(), DLT_OFFLINE_LOGSTORAGE_CONFIG_DONE, DLT_OFFLINE_LOGSTORAGE_MAX, DltLogStorageConfigData::log_level, NULL, and DltDaemon::storage_handle.

Referenced by dlt_daemon_process_user_message_register_context().

void dlt_daemon_logstorage_reset_application_loglevel ( DltDaemon daemon,
int  dev_num,
int  max_device,
int  verbose 
)

dlt_daemon_logstorage_reset_application_loglevel

Reset storage log level of all running applications with -1

Parameters
daemonPointer to DLT Daemon structure
dev_numNumber of attached DLT Logstorage device
verboseIf set to true verbose information is printed out

dlt_daemon_logstorage_reset_application_loglevel

Reset storage log level of all running applications 2 steps for resetting

  1. Setup storage_loglevel of all contexts configured for the requested device to -1
  2. Re-run update log level for all other configured devices
Parameters
daemonPointer to DLT Daemon structure
dev_numNumber of attached DLT Logstorage device
max_deviceMaximum storage devices setup by the daemon
verboseIf set to true verbose information is printed out

Definition at line 303 of file dlt_daemon_offline_logstorage.c.

References DltLogStorage::config_status, DltLogStorage::connection_type, DLT_DAEMON_LOGSTORAGE_RESET_LOGLEVEL, DLT_DAEMON_LOGSTORAGE_RESET_SEND_LOGLEVEL, dlt_daemon_logstorage_update_application_loglevel(), dlt_log(), dlt_logstorage_update_context_loglevel(), DLT_OFFLINE_LOGSTORAGE_CONFIG_DONE, DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED, DLT_OFFLINE_LOGSTORAGE_MAX_KEY_LEN, DltLogStorage::filter_keys, NULL, DltLogStorage::num_filter_keys, PRINT_FUNCTION_VERBOSE, and DltDaemon::storage_handle.

Referenced by dlt_daemon_control_service_logstorage().

void dlt_daemon_logstorage_set_logstorage_cache_size ( unsigned int  size)

Set max size of logstorage cache. Stored internally in bytes

Parameters
sizeSize of logstorage cache [in KB]

Definition at line 573 of file dlt_daemon_offline_logstorage.c.

References g_logstorage_cache_max.

Referenced by option_file_parser().

int dlt_daemon_logstorage_setup_internal_storage ( DltDaemon daemon,
char *  path,
int  verbose 
)

dlt_daemon_logstorage_setup_internal_storage

Setup user defined path as offline log storage device

Parameters
daemonPointer to Dlt Daemon structure
pathUser configured internal storage path
verboseIf set to true verbose information is printed out

Definition at line 541 of file dlt_daemon_offline_logstorage.c.

References dlt_daemon_logstorage_update_application_loglevel(), dlt_log(), dlt_logstorage_device_connected(), dlt_logstorage_load_config(), NULL, and DltDaemon::storage_handle.

Referenced by main().

int dlt_daemon_logstorage_sync_cache ( DltDaemon daemon,
DltDaemonLocal daemon_local,
char *  mnt_point,
int  verbose 
)

Sync logstorage caches

Parameters
daemonPointer to Dlt Daemon structure
daemon_localPointer to Dlt Daemon Local structure
mount_pointLogstorage device mount point
verboseIf set to true verbose information is printed out
Returns
0 on success, -1 otherwise

Definition at line 607 of file dlt_daemon_offline_logstorage.c.

References DltLogStorage::connection_type, dlt_daemon_logstorage_get_device(), dlt_logstorage_sync_caches(), DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED, DltDaemonLocal::flags, NULL, DltDaemonFlags::offlineLogstorageMaxDevices, PRINT_FUNCTION_VERBOSE, and DltDaemon::storage_handle.

Referenced by dlt_daemon_control_service_logstorage().

void dlt_daemon_logstorage_update_application_loglevel ( DltDaemon daemon,
int  dev_num,
int  verbose 
)

dlt_daemon_logstorage_update_application_loglevel

Update log level of all running applications with new filter configuration available due to newly attached DltLogstorage device. The log level is only updated when the current application log level is less than the log level obtained from the storage configuration file

Parameters
daemonPointer to DLT Daemon structure
dev_numNumber of attached DLT Logstorage device
verboseif set to true verbose information is printed out

dlt_daemon_logstorage_update_application_loglevel

Update log level of all running applications with new filter configuration available due to newly attached DltLogstorage device. The log level is only updated when the current application log level is less than the log level obtained from the storage configuration file

Parameters
daemonPointer to DLT Daemon structure
dev_numNumber of attached DLT Logstorage device
verboseIf set to true verbose information is printed out

Definition at line 374 of file dlt_daemon_offline_logstorage.c.

References DltLogStorage::config_status, DltLogStorage::connection_type, dlt_log(), dlt_logstorage_get_loglevel_by_key(), dlt_logstorage_update_context_loglevel(), DLT_OFFLINE_LOGSTORAGE_CONFIG_DONE, DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED, DLT_OFFLINE_LOGSTORAGE_MAX_KEY_LEN, DltLogStorage::filter_keys, NULL, DltLogStorage::num_filter_keys, PRINT_FUNCTION_VERBOSE, and DltDaemon::storage_handle.

Referenced by dlt_daemon_control_service_logstorage(), dlt_daemon_logstorage_reset_application_loglevel(), and dlt_daemon_logstorage_setup_internal_storage().

void dlt_daemon_logstorage_write ( DltDaemon daemon,
DltDaemonFlags user_config,
unsigned char *  data1,
int  size1,
unsigned char *  data2,
int  size2,
unsigned char *  data3,
int  size3 
)

dlt_daemon_logstorage_write

Write log message to all attached storage device. If the called dlt_logstorage_write function is not able to write to the device, DltDaemon will disconnect this device.

Parameters
daemonPointer to Dlt Daemon structure
user_configDltDaemon configuration
apidapplication id
ctidcontext id
log_levellog level
data1message header buffer
size1message header buffer size
data2message data buffer
size2message data size

dlt_daemon_logstorage_write

Write log message to all attached storage device. If the called dlt_logstorage_write function is not able to write to the device, DltDaemon will disconnect this device.

Parameters
daemonPointer to Dlt Daemon structure
user_configDltDaemon configuration
data1message header buffer
size1message header buffer size
data2message extended header buffer
size2message extended header size
data3message data buffer
size3message data size

Definition at line 477 of file dlt_daemon_offline_logstorage.c.

References DltLogStorage::config_status, dlt_log(), dlt_logstorage_device_disconnected(), DLT_LOGSTORAGE_SYNC_ON_DEVICE_DISCONNECT, dlt_logstorage_write(), DLT_OFFLINE_LOGSTORAGE_CONFIG_DONE, DltLogStorageUserConfig::logfile_counteridxlen, DltLogStorageUserConfig::logfile_delimiter, DltLogStorageUserConfig::logfile_maxcounter, DltLogStorageUserConfig::logfile_timestamp, NULL, DltDaemonFlags::offlineLogstorageDelimiter, DltDaemonFlags::offlineLogstorageMaxCounter, DltDaemonFlags::offlineLogstorageMaxCounterIdx, DltDaemonFlags::offlineLogstorageMaxDevices, DltDaemonFlags::offlineLogstorageTimestamp, and DltDaemon::storage_handle.

Referenced by dlt_daemon_client_send().