58 sep = strchr (key,
':');
70 strncpy(ctxid,(key+1),(len-1));
71 strncpy(appid,
".*",2);
74 else if (key[len-1] ==
':')
79 strncpy(appid,key,(len-1));
80 strncpy(ctxid,
".*",2);
89 tok = strtok(key,
":");
95 tok = strtok(
NULL,
":");
125 int old_log_level = -1;
127 if((daemon == 0) || (
id ==
NULL))
130 if((cmp_flag < 0 ) || (cmp_flag > 2 ))
133 memset(tmp_id, 0,
sizeof(tmp_id));
142 if(strcmp(
id, tmp_id) == 0)
144 if(curr_log_level > 0)
154 dlt_log(LOG_ERR,
"Unable to update loglevel\n");
168 dlt_log(LOG_ERR,
"Unable to reset loglevel\n");
196 int old_log_level = -1;
198 if((daemon == 0) || (apid ==
NULL) || (ctxid ==
NULL))
204 if(curr_log_level > 0)
213 dlt_log(LOG_ERR,
"Unable to update loglevel\n");
226 dlt_log(LOG_ERR,
"Unable to update loglevel\n");
256 if((daemon == 0) || (key ==
NULL))
259 memset(appid, 0,
sizeof(appid));
260 memset(ctxid, 0,
sizeof(ctxid));
264 dlt_log(LOG_ERR,
"Error while updating application log levels (splt key)\n");
268 if(strcmp(ctxid,
".*") == 0)
275 else if(strcmp(appid,
".*") == 0)
308 int num_device_configured = 0;
312 if((daemon == 0) || (dev_num < 0))
314 dlt_log(LOG_ERR,
"Invalid function parameters used for dlt_daemon_logstorage_reset_application_loglevel\n");
326 for(i = 0; i<max_device; i++)
330 num_device_configured += 1;
337 memset(key, 0,
sizeof(key));
341 if(num_device_configured == 1)
350 for(i=0; i<max_device; i++)
383 if((daemon == 0) || (dev_num < 0))
385 dlt_log(LOG_ERR,
"Invalid function parameters used for dlt_daemon_logstorage_update_application_loglevel\n");
401 memset(key, 0,
sizeof(key));
409 dlt_log(LOG_ERR,
"Failed to get log level by key \n");
436 int8_t storage_loglevel = -1;
437 int8_t retrvd_loglevel = -1;
440 if((daemon == 0) || (max_device == 0) || (apid ==
NULL) || (ctid ==
NULL))
443 for(i = 0; i<max_device; i++)
450 for(j = 0; j<num_config; j++)
459 return storage_loglevel;
479 unsigned char *data1,
481 unsigned char *data2,
483 unsigned char *data3,
493 "dlt_daemon_logstorage_write: message type is not log. " 520 "dlt_daemon_logstorage_write: failed. " 521 "Disable storage device\n");
545 if((path ==
NULL) || (daemon ==
NULL))
555 dlt_log(LOG_ERR,
"dlt_daemon_logstorage_setup_emmc_support : Device connect failed\n");
563 dlt_log(LOG_ERR,
"dlt_daemon_logstorage_setup_emmc_support : Loading configuration file failed\n");
587 if (daemon ==
NULL || daemon_local ==
NULL)
617 if (daemon ==
NULL || mnt_point ==
NULL)
622 if (strlen(mnt_point) > 0)
669 if (daemon ==
NULL || daemon_local ==
NULL || mnt_point ==
NULL)
674 len1 = strlen(mnt_point);
685 len1 > len2 ? len2 : len1) == 0)
int dlt_logstorage_split_key(char *key, char *appid, char *ctxid)
#define PRINT_FUNCTION_VERBOSE(_verbose)
int dlt_logstorage_load_config(DltLogStorage *handle)
int dlt_logstorage_write(DltLogStorage *handle, DltLogStorageUserConfig *uconfig, unsigned char *data1, int size1, unsigned char *data2, int size2, unsigned char *data3, int size3)
void dlt_set_id(char *id, const char *text)
unsigned int connection_type
DltLogStorage * storage_handle
int dlt_daemon_logstorage_get_loglevel(DltDaemon *daemon, int max_device, char *apid, char *ctid)
unsigned int offlineLogstorageMaxCounterIdx
char offlineLogstorageDelimiter
int dlt_logstorage_device_disconnected(DltLogStorage *handle, int reason)
DltReturnValue dlt_log(int prio, char *s)
#define DLT_DAEMON_LOGSTORAGE_RESET_SEND_LOGLEVEL
unsigned int logfile_maxcounter
void dlt_daemon_logstorage_reset_application_loglevel(DltDaemon *daemon, int dev_num, int max_device, int verbose)
int dlt_logstorage_update_context(DltDaemon *daemon, char *apid, char *ctxid, int curr_log_level, 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)
DltDaemonContext * contexts
DltLogStorage * dlt_daemon_logstorage_get_device(DltDaemon *daemon, DltDaemonLocal *daemon_local, char *mnt_point, int verbose)
#define DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED
#define DLT_OFFLINE_LOGSTORAGE_MAX(A, B)
void dlt_daemon_logstorage_set_logstorage_cache_size(unsigned int size)
DltLogStorageConfigData ** dlt_logstorage_get_config(DltLogStorage *handle, char *apid, char *ctid, int *num_config)
int dlt_logstorage_update_all_contexts(DltDaemon *daemon, char *id, int curr_log_level, int cmp_flag, int verbose)
unsigned int logfile_counteridxlen
int offlineLogstorageTimestamp
char device_mount_point[DLT_MOUNT_PATH_MAX]
int dlt_daemon_user_send_log_level(DltDaemon *daemon, DltDaemonContext *context, int verbose)
unsigned int config_status
int offlineLogstorageMaxDevices
int dlt_logstorage_sync_caches(DltLogStorage *handle)
#define DLT_LOGSTORAGE_SYNC_ON_DEVICE_DISCONNECT
#define DLT_OFFLINE_LOGSTORAGE_MAX_KEY_LEN
unsigned int g_logstorage_cache_max
unsigned int offlineLogstorageMaxCounter
#define DLT_LOGSTORAGE_SYNC_ON_DAEMON_EXIT
int dlt_daemon_logstorage_setup_internal_storage(DltDaemon *daemon, char *path, int verbose)
int dlt_logstorage_update_context_loglevel(DltDaemon *daemon, char *key, int curr_log_level, int verbose)
void dlt_daemon_logstorage_update_application_loglevel(DltDaemon *daemon, int dev_num, int verbose)
int dlt_logstorage_get_loglevel_by_key(DltLogStorage *handle, char *key)
int dlt_daemon_logstorage_cleanup(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose)
int dlt_logstorage_device_connected(DltLogStorage *handle, char *mount_point)
#define DLT_DAEMON_LOGSTORAGE_RESET_LOGLEVEL
#define DLT_OFFLINE_LOGSTORAGE_CONFIG_DONE
int dlt_daemon_logstorage_sync_cache(DltDaemon *daemon, DltDaemonLocal *daemon_local, char *mnt_point, int verbose)
DltDaemonContext * dlt_daemon_context_find(DltDaemon *daemon, char *apid, char *ctid, int verbose)