automotive-dlt
|
Go to the source code of this file.
Data Structures | |
struct | DltLogStorageCacheFooter |
struct | DltLogStorageUserConfig |
struct | DltLogStorageFileList |
struct | DltLogStorageConfigData |
struct | DltLogStorageConfig |
struct | DltLogStorage |
Typedefs | |
typedef struct DltLogStorageFileList | DltLogStorageFileList |
typedef struct DltLogStorageConfigData | DltLogStorageConfigData |
Functions | |
int | dlt_logstorage_device_connected (DltLogStorage *handle, char *mount_point) |
int | dlt_logstorage_load_config (DltLogStorage *handle) |
int | dlt_logstorage_device_disconnected (DltLogStorage *handle, int reason) |
DltLogStorageConfigData ** | dlt_logstorage_get_config (DltLogStorage *handle, char *apid, char *ctid, int *num_config) |
int | dlt_logstorage_get_loglevel_by_key (DltLogStorage *handle, char *key) |
int | dlt_logstorage_write (DltLogStorage *handle, DltLogStorageUserConfig *uconfig, unsigned char *data1, int size1, unsigned char *data2, int size2, unsigned char *data3, int size3) |
int | dlt_logstorage_sync_caches (DltLogStorage *handle) |
Variables | |
unsigned int | g_logstorage_cache_max |
unsigned int | g_logstorage_cache_size |
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.
For further information see http://www.genivi.org/. end@
Definition in file dlt_offline_logstorage.h.
#define DLT_LOGSTORAGE_SYNC_ON_DAEMON_EXIT (1<<1) /* sync on daemon exit */ |
Definition at line 121 of file dlt_offline_logstorage.h.
Referenced by dlt_daemon_logstorage_cleanup(), dlt_logstorage_set_sync_strategy(), and dlt_logstorage_sync_msg_cache().
#define DLT_LOGSTORAGE_SYNC_ON_DEMAND (1<<2) /* sync on demand */ |
Definition at line 122 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_set_sync_strategy(), and dlt_logstorage_sync_caches().
#define DLT_LOGSTORAGE_SYNC_ON_DEVICE_DISCONNECT (1<<3) /* sync on device disconnect*/ |
Definition at line 123 of file dlt_offline_logstorage.h.
Referenced by dlt_daemon_control_service_logstorage(), dlt_daemon_logstorage_write(), dlt_logstorage_device_connected(), and dlt_logstorage_set_sync_strategy().
#define DLT_LOGSTORAGE_SYNC_ON_ERROR -1 /* error case */ |
Definition at line 119 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_prepare_table().
#define DLT_LOGSTORAGE_SYNC_ON_MSG 1 /* default, on message sync */ |
Definition at line 120 of file dlt_offline_logstorage.h.
Referenced by dlt_daemon_setup_filter_properties(), dlt_logstorage_filter_set_strategy(), dlt_logstorage_set_sync_strategy(), dlt_logstorage_sync_on_msg(), and dlt_logstorage_write().
#define DLT_OFFLINE_LOGSTORAGE_APP_INIT (1<<6) |
Definition at line 88 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_validate_filter_value().
#define DLT_OFFLINE_LOGSTORAGE_CONFIG_DIR_PATH_LEN 50 |
Definition at line 102 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_open_log_file().
#define DLT_OFFLINE_LOGSTORAGE_CONFIG_DONE 1 |
Definition at line 66 of file dlt_offline_logstorage.h.
Referenced by dlt_daemon_logstorage_get_loglevel(), dlt_daemon_logstorage_reset_application_loglevel(), dlt_daemon_logstorage_update_application_loglevel(), dlt_daemon_logstorage_write(), dlt_logstorage_device_disconnected(), dlt_logstorage_get_config(), dlt_logstorage_get_loglevel_by_key(), dlt_logstorage_load_config(), and dlt_logstorage_write().
#define DLT_OFFLINE_LOGSTORAGE_CONFIG_FILE_NAME "dlt_logstorage.conf" |
Definition at line 103 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_load_config().
#define DLT_OFFLINE_LOGSTORAGE_CONFIG_SECTION "FILTER" |
Definition at line 115 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_validate_filter_name().
#define DLT_OFFLINE_LOGSTORAGE_CTX_INIT (1<<5) |
Definition at line 89 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_validate_filter_value().
#define DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED 1 |
Definition at line 63 of file dlt_offline_logstorage.h.
Referenced by dlt_daemon_control_service_logstorage(), dlt_daemon_logstorage_cleanup(), dlt_daemon_logstorage_reset_application_loglevel(), dlt_daemon_logstorage_sync_cache(), dlt_daemon_logstorage_update_application_loglevel(), dlt_logstorage_device_connected(), dlt_logstorage_get_config(), dlt_logstorage_get_loglevel_by_key(), dlt_logstorage_load_config(), and dlt_logstorage_write().
#define DLT_OFFLINE_LOGSTORAGE_DEVICE_DISCONNECTED 0 |
Definition at line 65 of file dlt_offline_logstorage.h.
Referenced by dlt_daemon_control_service_logstorage(), and dlt_logstorage_device_disconnected().
#define DLT_OFFLINE_LOGSTORAGE_ECUID (1<<8) |
Definition at line 86 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_validate_filter_value().
#define DLT_OFFLINE_LOGSTORAGE_FILE_EXTENSION_LEN 4 |
Definition at line 73 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_get_idx_of_log_file().
#define DLT_OFFLINE_LOGSTORAGE_FILTER_INIT 0xFD |
Definition at line 96 of file dlt_offline_logstorage.h.
#define DLT_OFFLINE_LOGSTORAGE_FILTER_INITIALIZED | ( | A | ) | ((A) >= DLT_OFFLINE_LOGSTORAGE_FILTER_INIT) |
Definition at line 98 of file dlt_offline_logstorage.h.
Referenced by dlt_daemon_setup_filter_properties().
#define DLT_OFFLINE_LOGSTORAGE_FILTER_PRESENT (1<<7) |
Definition at line 87 of file dlt_offline_logstorage.h.
Referenced by dlt_daemon_setup_filter_properties().
#define DLT_OFFLINE_LOGSTORAGE_FILTER_UNINIT 0 |
Definition at line 85 of file dlt_offline_logstorage.h.
Referenced by dlt_daemon_setup_filter_properties().
#define DLT_OFFLINE_LOGSTORAGE_FREE 0 |
Definition at line 64 of file dlt_offline_logstorage.h.
#define DLT_OFFLINE_LOGSTORAGE_GENERAL_CONFIG_SECTION "GENERAL" |
Definition at line 116 of file dlt_offline_logstorage.h.
#define DLT_OFFLINE_LOGSTORAGE_INDEX_LEN 3 |
Definition at line 74 of file dlt_offline_logstorage.h.
#define DLT_OFFLINE_LOGSTORAGE_INDEX_OFFSET |
Definition at line 77 of file dlt_offline_logstorage.h.
#define DLT_OFFLINE_LOGSTORAGE_INIT_DONE 1 /* For device configuration status */ |
Definition at line 62 of file dlt_offline_logstorage.h.
#define DLT_OFFLINE_LOGSTORAGE_IS_FILTER_PRESENT | ( | A | ) | ((A) & DLT_OFFLINE_LOGSTORAGE_FILTER_PRESENT) |
Definition at line 100 of file dlt_offline_logstorage.h.
Referenced by dlt_daemon_setup_filter_properties().
#define DLT_OFFLINE_LOGSTORAGE_IS_STRATEGY_SET | ( | S, | |
s | |||
) | ((S) & (s)) |
Definition at line 125 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_sync_msg_cache().
#define DLT_OFFLINE_LOGSTORAGE_LOG_LVL_INIT (1<<4) |
Definition at line 90 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_validate_filter_value().
#define DLT_OFFLINE_LOGSTORAGE_MAX | ( | A, | |
B | |||
) | ((A) > (B) ? (A) : (B)) |
Definition at line 109 of file dlt_offline_logstorage.h.
Referenced by dlt_daemon_logstorage_get_loglevel(), dlt_logstorage_update_all_contexts(), and dlt_logstorage_update_context().
#define DLT_OFFLINE_LOGSTORAGE_MAX_FILE_NAME_LEN 50 /* Maximum file name length of the log file */ |
Definition at line 71 of file dlt_offline_logstorage.h.
#define DLT_OFFLINE_LOGSTORAGE_MAX_INDEX 999 |
Definition at line 75 of file dlt_offline_logstorage.h.
#define DLT_OFFLINE_LOGSTORAGE_MAX_KEY_LEN 10 /* Maximum size for key */ |
#define DLT_OFFLINE_LOGSTORAGE_MAX_KEY_NUM 8 |
Definition at line 113 of file dlt_offline_logstorage.h.
Referenced by dlt_daemon_setup_filter_properties().
#define DLT_OFFLINE_LOGSTORAGE_MAX_LOG_FILE_LEN |
Definition at line 80 of file dlt_offline_logstorage.h.
#define DLT_OFFLINE_LOGSTORAGE_MAX_PATH_LEN |
Definition at line 106 of file dlt_offline_logstorage.h.
#define DLT_OFFLINE_LOGSTORAGE_MAX_WRITE_ERRORS 5 |
Definition at line 112 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_write().
#define DLT_OFFLINE_LOGSTORAGE_MAXFILTERS 100 /* Maximum entries in hashmap */ |
Definition at line 60 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_load_config(), and dlt_logstorage_prepare_table().
#define DLT_OFFLINE_LOGSTORAGE_MIN | ( | A, | |
B | |||
) | ((A) < (B) ? (A) : (B)) |
Definition at line 110 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_read_list_of_names().
#define DLT_OFFLINE_LOGSTORAGE_NAME_INIT (1<<3) |
Definition at line 91 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_validate_filter_value().
#define DLT_OFFLINE_LOGSTORAGE_NUM_INIT 1 |
Definition at line 94 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_validate_filter_value().
#define DLT_OFFLINE_LOGSTORAGE_SIZE_INIT (1<<2) |
Definition at line 92 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_validate_filter_value().
#define DLT_OFFLINE_LOGSTORAGE_SYNC_BEHAVIOR (1<<1) |
Definition at line 93 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_validate_filter_value().
#define DLT_OFFLINE_LOGSTORAGE_SYNC_CACHES 2 /* sync logstorage caches */ |
Definition at line 68 of file dlt_offline_logstorage.h.
Referenced by dlt_daemon_control_service_logstorage().
#define DLT_OFFLINE_LOGSTORAGE_TIMESTAMP_LEN 16 |
Definition at line 76 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_get_idx_of_log_file(), and dlt_logstorage_log_file_name().
typedef struct DltLogStorageConfigData DltLogStorageConfigData |
Definition at line 155 of file dlt_offline_logstorage.h.
typedef struct DltLogStorageFileList DltLogStorageFileList |
int dlt_logstorage_device_connected | ( | DltLogStorage * | handle, |
char * | mount_point | ||
) |
dlt_logstorage_device_connected
Initializes DLT Offline Logstorage with respect to device status
handle | DLT Logstorage handle |
mount_point | Device mount path |
Definition at line 561 of file dlt_offline_logstorage.c.
References DltLogStorage::config_data, DltLogStorage::config_status, DltLogStorage::connection_type, DltLogStorage::device_mount_point, dlt_log(), dlt_logstorage_device_disconnected(), DLT_LOGSTORAGE_SYNC_ON_DEVICE_DISCONNECT, DLT_MOUNT_PATH_MAX, DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED, DltLogStorage::filter_keys, NULL, DltLogStorage::num_filter_keys, and DltLogStorage::write_errors.
Referenced by dlt_daemon_control_service_logstorage(), and dlt_daemon_logstorage_setup_internal_storage().
int dlt_logstorage_device_disconnected | ( | DltLogStorage * | handle, |
int | reason | ||
) |
dlt_logstorage_device_disconnected De-Initializes DLT Offline Logstorage with respect to device status
handle | DLT Logstorage handle |
reason | Reason for device disconnection |
dlt_logstorage_device_disconnected
De-Initializes DLT Offline Logstorage with respect to device status
handle | DLT Logstorage handle |
reason | Reason for disconnect |
Definition at line 659 of file dlt_offline_logstorage.c.
References DltLogStorage::config_status, DltLogStorage::connection_type, DltLogStorage::device_mount_point, dlt_logstorage_free(), DLT_MOUNT_PATH_MAX, DLT_OFFLINE_LOGSTORAGE_CONFIG_DONE, DLT_OFFLINE_LOGSTORAGE_DEVICE_DISCONNECTED, NULL, DltLogStorage::num_filter_keys, and DltLogStorage::write_errors.
Referenced by dlt_daemon_control_service_logstorage(), dlt_daemon_logstorage_cleanup(), dlt_daemon_logstorage_write(), and dlt_logstorage_device_connected().
DltLogStorageConfigData** dlt_logstorage_get_config | ( | DltLogStorage * | handle, |
char * | apid, | ||
char * | ctid, | ||
int * | num_config | ||
) |
dlt_logstorage_get_config
Obtain the configuration data of all filters for provided apid and ctid For a given apid and ctid, there can be 3 possiblities of configuration data available in the Hash map, this function will return the address of configuration data for all these 3 combinations
handle | DltLogStorage handle |
appid | application id |
ctxid | context id |
num_config | (o/p) contains the number of filter configration data obtained |
Definition at line 1195 of file dlt_offline_logstorage.c.
References config, DltLogStorage::config_htab, DltLogStorage::config_status, DltLogStorage::connection_type, DLT_ID_SIZE, dlt_logstorage_hash_find(), DLT_OFFLINE_LOGSTORAGE_CONFIG_DONE, DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED, DLT_OFFLINE_LOGSTORAGE_MAX_KEY_LEN, and NULL.
Referenced by dlt_daemon_logstorage_get_loglevel(), and dlt_logstorage_filter().
int dlt_logstorage_get_loglevel_by_key | ( | DltLogStorage * | handle, |
char * | key | ||
) |
dlt_logstorage_get_loglevel_by_key
Obtain the log level for the provided key This function can be used to obtain log level when the actual key stored in the Hash map is availble with the caller
handle | DltLogstorage handle |
key | key to search for in Hash MAP |
Definition at line 1165 of file dlt_offline_logstorage.c.
References config, DltLogStorage::config_htab, DltLogStorage::config_status, DltLogStorage::connection_type, dlt_logstorage_hash_find(), DLT_OFFLINE_LOGSTORAGE_CONFIG_DONE, DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED, DltLogStorageConfigData::log_level, and NULL.
Referenced by dlt_daemon_logstorage_update_application_loglevel().
int dlt_logstorage_load_config | ( | DltLogStorage * | handle | ) |
dlt_logstorage_load_config
Parse dlt_logstorage.conf file in the device and setup internal info table
handle | DltLogStorage handle |
dlt_logstorage_load_config
Read dlt_logstorage.conf file and setup filters in hash table Hash table key consists of "APPID:CTXID", e.g "APP1:CTX1". If wildcards used for application id or context id, the hash table key consists of none wildcard value, e.g. appid=.*, cxtid=CTX1 results in "CTX1".
Combination of two wildcards is not allowed.
input_file | pointer to configuration file stored on device |
Definition at line 1112 of file dlt_offline_logstorage.c.
References DltLogStorage::config_htab, DltLogStorage::config_status, DltLogStorage::connection_type, DltLogStorage::device_mount_point, dlt_log(), dlt_logstorage_hash_create(), dlt_logstorage_store_filters(), DLT_OFFLINE_LOGSTORAGE_CONFIG_DONE, DLT_OFFLINE_LOGSTORAGE_CONFIG_FILE_NAME, DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED, DLT_OFFLINE_LOGSTORAGE_MAXFILTERS, and NULL.
Referenced by dlt_daemon_control_service_logstorage(), and dlt_daemon_logstorage_setup_internal_storage().
int dlt_logstorage_sync_caches | ( | DltLogStorage * | handle | ) |
dlt_logstorage_sync_caches
Sync all caches inside the specified logstorage device.
handle | DltLogStorage handle |
Definition at line 1453 of file dlt_offline_logstorage.c.
References DltLogStorage::config_data, DltLogStorageConfig::data, dlt_log(), DltLogStorageConfigData::dlt_logstorage_sync, DLT_LOGSTORAGE_SYNC_ON_DEMAND, NULL, and DltLogStorage::num_filter_keys.
Referenced by dlt_daemon_logstorage_sync_cache().
int dlt_logstorage_write | ( | DltLogStorage * | handle, |
DltLogStorageUserConfig * | uconfig, | ||
unsigned char * | data1, | ||
int | size1, | ||
unsigned char * | data2, | ||
int | size2, | ||
unsigned char * | data3, | ||
int | size3 | ||
) |
dlt_logstorage_write
Write a message to one or more configured log files, based on filter configuration.
handle | DltLogStorage handle |
uconfig | User configurations for log file |
data1 | Data buffer of message header |
size1 | Size of message header buffer |
data2 | Data buffer of message body |
size2 | Size of message body |
dlt_logstorage_write
Write a message to one or more configured log files, based on filter configuration.
handle | DltLogStorage handle |
config | User configurations for log file |
data1 | Data buffer of message header |
size1 | Size of message header buffer |
data2 | Data buffer of message body |
size2 | Size of message body |
Definition at line 1330 of file dlt_offline_logstorage.c.
References config, DltLogStorage::config_status, DltLogStorage::connection_type, DltLogStorage::device_mount_point, DLT_GET_MSIN_MTIN, DLT_ID_SIZE, DLT_IS_HTYP_WEID, DLT_IS_HTYP_WSID, DLT_IS_HTYP_WTMS, dlt_log(), dlt_logstorage_filter(), DltLogStorageConfigData::dlt_logstorage_prepare, DltLogStorageConfigData::dlt_logstorage_sync, DLT_LOGSTORAGE_SYNC_ON_MSG, DltLogStorageConfigData::dlt_logstorage_write, DLT_OFFLINE_LOGSTORAGE_CONFIG_DONE, DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED, DLT_OFFLINE_LOGSTORAGE_MAX_WRITE_ERRORS, DLT_SIZE_WSID, DLT_SIZE_WTMS, NULL, and DltLogStorage::write_errors.
Referenced by dlt_daemon_logstorage_write().
unsigned int g_logstorage_cache_max |
Definition at line 128 of file dlt_offline_logstorage.h.
Referenced by dlt_daemon_logstorage_set_logstorage_cache_size(), and dlt_logstorage_prepare_msg_cache().
unsigned int g_logstorage_cache_size |
Definition at line 130 of file dlt_offline_logstorage.h.
Referenced by dlt_logstorage_prepare_msg_cache().