34 #if !defined (__WIN32__) 36 #include <semaphore.h> 51 #include <sys/prctl.h> 54 #include <sys/types.h> 66 #ifdef DLT_FATAL_LOG_RESET_ENABLE 67 #define DLT_LOG_FATAL_RESET_TRAP(LOGLEVEL) \ 69 if (LOGLEVEL == DLT_LOG_FATAL) { \ 75 #define DLT_LOG_FATAL_RESET_TRAP(LOGLEVEL) 98 #define DLT_MAX_TRACE_SEGMENT_SIZE 1024 99 #define DLT_MESSAGE_QUEUE_NAME "/dlt_message_queue" 100 #define DLT_DELAYED_RESEND_INDICATOR_PATTERN 0xFFFF 108 int32_t lock_mutex_result = pthread_mutex_lock(mutex);
109 if (lock_mutex_result == EOWNERDEAD)
111 pthread_mutex_consistent(mutex);
112 lock_mutex_result = 0;
114 else if ( lock_mutex_result != 0 )
116 snprintf(
str,
DLT_USER_BUFFER_LENGTH,
"Mutex lock failed unexpected pid=%i with result %i!\n", getpid(), lock_mutex_result);
123 pthread_mutex_unlock(mutex);
173 if( (strcmp(lib_major_version,user_major_version) != 0) || (strcmp(lib_minor_version,user_minor_version) != 0))
176 "DLT Library version check failed! Installed DLT library version is %s.%s - Application using DLT library version %s.%s\n",
220 #ifdef DLT_SHM_ENABLE 221 memset(&(dlt_user.dlt_shm),0,
sizeof(
DltShm));
232 ret=mkdir(
dlt_user_dir, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH | S_ISVTX );
233 if (ret==-1 && errno != EEXIST)
243 ret=chmod(
dlt_user_dir, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH | S_ISGID | S_ISVTX );
257 ret=mkfifo(filename, S_IRUSR | S_IWUSR | S_IWGRP | S_IRGRP );
265 ret=chmod(filename, S_IRUSR | S_IWUSR | S_IWGRP | S_IRGRP );
292 #ifdef DLT_SHM_ENABLE 317 pthread_mutexattr_t attr;
318 if (pthread_mutexattr_init(&attr) != 0)
324 if ( pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST) != 0 )
330 pthread_mutex_init(&
mq_mutex, &attr);
331 pthread_mutexattr_destroy(&attr);
368 dlt_user.
dlt_log_handle = open(name,O_WRONLY|O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
390 char queue_name[NAME_MAX];
394 struct mq_attr mqatr;
396 mqatr.mq_maxmsg = 10;
398 mqatr.mq_curmsgs = 0;
405 S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, &mqatr);
410 dlt_log(LOG_WARNING,
"Old message queue exists, trying to delete.\n");
411 if(mq_unlink(queue_name) < 0)
413 dlt_vnlog(LOG_CRIT, 256,
"Could not delete existing message queue!: %s \n", strerror(errno));
418 S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, &mqatr);
423 dlt_vnlog(LOG_CRIT, 256,
"Can't create message queue read handle!: %s \n", strerror(errno));
433 dlt_vnlog(LOG_CRIT, 256,
"Can't open message queue write handle!: %s \n", strerror(errno));
445 char *env_local_print;
446 char * env_initial_log_level;
447 char *env_buffer_min;
449 char *env_buffer_max;
451 char *env_buffer_step;
497 if (strcmp(env_local_print,
"AUTOMATIC")==0)
501 else if (strcmp(env_local_print,
"FORCE_ON")==0)
505 else if (strcmp(env_local_print,
"FORCE_OFF")==0)
511 env_initial_log_level = getenv(
"DLT_INITIAL_LOG_LEVEL");
512 if( env_initial_log_level !=
NULL )
516 snprintf(
str,
DLT_USER_BUFFER_LENGTH,
"Unable to parse initial set of log-levels from environment! Env:\n%s\n", getenv(
"DLT_INITIAL_LOG_LEVEL"));
532 if (env_buffer_min !=
NULL)
534 buffer_min = (uint32_t) strtol(env_buffer_min,
NULL, 10);
535 if (errno == EINVAL || errno == ERANGE)
538 "Wrong value specified for %s. Using default\n",
544 if (env_buffer_max !=
NULL)
546 buffer_max = (uint32_t) strtol(env_buffer_max,
NULL, 10);
547 if (errno == EINVAL || errno == ERANGE)
550 "Wrong value specified for %s. Using default\n",
556 if (env_buffer_step !=
NULL)
558 buffer_step = (uint32_t) strtol(env_buffer_step,
NULL, 10);
559 if (errno == EINVAL || errno == ERANGE)
562 "Wrong value specified for %s. Using default\n",
579 signal(SIGPIPE,SIG_IGN);
587 #ifdef DLT_TEST_ENABLE 588 dlt_user.corrupt_user_header = 0;
589 dlt_user.corrupt_message_size = 0;
590 dlt_user.corrupt_message_size_size = 0;
600 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
610 dlt_vnlog(LOG_WARNING, 128,
"Lost log messages in user buffer when exiting: %i\n", count);
707 #ifdef DLT_SHM_ENABLE 770 char queue_name[NAME_MAX];
781 mq_unlink(queue_name);
808 dlt_vlog(LOG_ERR,
"%s Failed to initialise dlt", __FUNCTION__);
813 if ((appid ==
NULL) || (appid[0] ==
'\0'))
820 if (appid[0] == dlt_user.
appID[0])
823 else if (appid[2] == 0)
825 if (appid[0] == dlt_user.
appID[0] &&
826 appid[1] == dlt_user.
appID[1])
829 else if (appid[3] == 0)
831 if (appid[0] == dlt_user.
appID[0] &&
832 appid[1] == dlt_user.
appID[1] &&
833 appid[2] == dlt_user.
appID[2])
838 if (appid[0] == dlt_user.
appID[0] &&
839 appid[1] == dlt_user.
appID[1] &&
840 appid[2] == dlt_user.
appID[2] &&
841 appid[3] == dlt_user.
appID[3])
855 if (description !=
NULL)
857 size_t desc_len = strlen(description);
893 dlt_vlog(LOG_ERR,
"%s Failed to initialise dlt", __FUNCTION__);
900 if ((contextid ==
NULL) || (contextid[0] ==
'\0'))
921 if ((contextid ==
NULL) || (contextid[0]==
'\0'))
926 if (loglevel < DLT_USER_LOG_LEVEL_NOT_SET || loglevel >=
DLT_LOG_MAX)
928 dlt_vlog(LOG_ERR,
"Loglevel %d is outside valid range", loglevel);
934 dlt_vlog(LOG_ERR,
"Tracestatus %d is outside valid range", tracestatus);
994 uint32_t old_max_entries;
1047 size_t desc_len = strlen(description);
1083 loglevel = envLogLevel;
1124 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
1212 if (loglevel < DLT_USER_LOG_LEVEL_NOT_SET || loglevel >=
DLT_LOG_MAX)
1214 dlt_vlog(LOG_ERR,
"Loglevel %d is outside valid range", loglevel);
1220 dlt_vlog(LOG_ERR,
"Tracestatus %d is outside valid range", tracestatus);
1228 dlt_vlog(LOG_ERR,
"%s Failed to initialise dlt", __FUNCTION__);
1285 dlt_vlog(LOG_ERR,
"User log mode %d is outside valid range", mode);
1293 dlt_vlog(LOG_ERR,
"%s Failed to initialise dlt", __FUNCTION__);
1317 DltUserHeader userheader;
1320 if ((msgdata ==
NULL) || (size == 0))
1352 &(userheader),
sizeof(DltUserHeader),
1353 msgdata, size, 0, 0);
1361 (
unsigned char *)&(userheader),
sizeof(DltUserHeader),
1366 dlt_log(LOG_WARNING,
"Buffer full! First message discarded!\n");
1441 if (loglevel < DLT_USER_LOG_LEVEL_NOT_SET || loglevel >=
DLT_LOG_MAX)
1443 dlt_vlog(LOG_ERR,
"Loglevel %d is outside valid range", loglevel);
1465 memcpy(log->
buffer, &(messageid),
sizeof(uint32_t));
1466 log->
size =
sizeof(uint32_t);
1497 size_t new_log_size = 0;
1498 uint32_t type_info = 0;
1501 if (log ==
NULL || (data ==
NULL && length!=0))
1505 if ((int16_t)type < DLT_FORMAT_DEFAULT || type >=
DLT_FORMAT_MAX)
1507 dlt_vlog(LOG_ERR,
"Format type %d is outside valid range", type);
1513 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
1517 new_log_size = log->
size + length +
sizeof(uint16_t);
1524 new_log_size = log->
size + length +
sizeof(uint32_t) +
sizeof(uint16_t);
1543 memcpy((log->
buffer) + log->
size, &(type_info),
sizeof(uint32_t));
1544 log->
size +=
sizeof(uint32_t);
1548 memcpy((log->
buffer) + log->
size, &(length),
sizeof(uint16_t));
1549 log->
size +=
sizeof(uint16_t);
1551 memcpy((log->
buffer) + log->
size, data, length);
1552 log->
size += length;
1568 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
1587 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
1588 log->
size +=
sizeof(uint32_t);
1608 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
1627 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
1628 log->
size +=
sizeof(uint32_t);
1646 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
1650 switch (
sizeof(
unsigned int))
1691 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
1705 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
1706 log->
size +=
sizeof(uint32_t);
1709 memcpy((log->
buffer)+log->
size,&data,
sizeof(uint8_t));
1710 log->
size +=
sizeof(uint8_t);
1726 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
1740 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
1741 log->
size +=
sizeof(uint32_t);
1744 memcpy((log->
buffer)+log->
size,&data,
sizeof(uint16_t));
1745 log->
size +=
sizeof(uint16_t);
1761 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
1775 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
1776 log->
size +=
sizeof(uint32_t);
1779 memcpy((log->
buffer)+log->
size,&data,
sizeof(uint32_t));
1780 log->
size +=
sizeof(uint32_t);
1796 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
1810 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
1811 log->
size +=
sizeof(uint32_t);
1814 memcpy((log->
buffer)+log->
size,&data,
sizeof(uint64_t));
1815 log->
size +=
sizeof(uint64_t);
1830 if ((int16_t)type < DLT_FORMAT_DEFAULT || type >=
DLT_FORMAT_MAX)
1832 dlt_vlog(LOG_ERR,
"Format type %d is outside valid range", type);
1838 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
1862 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
1863 log->
size +=
sizeof(uint32_t);
1866 memcpy((log->
buffer)+log->
size,&data,
sizeof(uint8_t));
1867 log->
size +=
sizeof(uint8_t);
1882 if ((int16_t)type < DLT_FORMAT_DEFAULT || type >=
DLT_FORMAT_MAX)
1884 dlt_vlog(LOG_ERR,
"Format type %d is outside valid range", type);
1890 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
1914 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
1915 log->
size +=
sizeof(uint32_t);
1918 memcpy((log->
buffer)+log->
size,&data,
sizeof(uint16_t));
1919 log->
size +=
sizeof(uint16_t);
1934 if ((int16_t)type < DLT_FORMAT_DEFAULT || type >=
DLT_FORMAT_MAX)
1936 dlt_vlog(LOG_ERR,
"Format type %d is outside valid range", type);
1942 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
1966 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
1967 log->
size +=
sizeof(uint32_t);
1970 memcpy((log->
buffer)+log->
size,&data,
sizeof(uint32_t));
1971 log->
size +=
sizeof(uint32_t);
1986 if ((int16_t)type < DLT_FORMAT_DEFAULT || type >=
DLT_FORMAT_MAX)
1988 dlt_vlog(LOG_ERR,
"Format type %d is outside valid range", type);
1994 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
2018 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
2019 log->
size +=
sizeof(uint32_t);
2022 memcpy((log->
buffer)+log->
size,&data,
sizeof(uint64_t));
2023 log->
size +=
sizeof(uint64_t);
2039 dlt_vlog(LOG_WARNING,
"%user_initialised false\n", __FUNCTION__);
2043 switch(
sizeof(
void *))
2069 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
2073 switch (
sizeof(
int))
2114 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
2128 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
2129 log->
size +=
sizeof(uint32_t);
2132 memcpy((log->
buffer)+log->
size,&data,
sizeof(int8_t));
2133 log->
size +=
sizeof(int8_t);
2149 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
2163 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
2164 log->
size +=
sizeof(uint32_t);
2167 memcpy((log->
buffer)+log->
size,&data,
sizeof(int16_t));
2168 log->
size +=
sizeof(int16_t);
2184 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
2198 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
2199 log->
size +=
sizeof(uint32_t);
2202 memcpy((log->
buffer)+log->
size,&data,
sizeof(int32_t));
2203 log->
size +=
sizeof(int32_t);
2219 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
2233 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
2234 log->
size +=
sizeof(uint32_t);
2237 memcpy((log->
buffer)+log->
size,&data,
sizeof(int64_t));
2238 log->
size +=
sizeof(int64_t);
2254 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
2268 memcpy((log->
buffer)+log->
size,&(type_info),
sizeof(uint32_t));
2269 log->
size +=
sizeof(uint32_t);
2272 memcpy((log->
buffer)+log->
size,&data,
sizeof(uint8_t));
2273 log->
size +=
sizeof(uint8_t);
2282 uint16_t arg_size = 0;
2283 uint32_t type_info = 0;
2284 size_t new_log_size = 0;
2291 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
2295 arg_size = strlen(text) + 1;
2297 new_log_size = log->
size + arg_size +
sizeof(uint16_t);
2304 new_log_size = log->
size + arg_size +
sizeof(uint32_t) +
sizeof(uint16_t);
2311 memcpy((log->
buffer) + log->
size, &(type_info),
sizeof(uint32_t));
2312 log->
size +=
sizeof(uint32_t);
2315 memcpy((log->
buffer) + log->
size, &(arg_size),
sizeof(uint16_t));
2316 log->
size +=
sizeof(uint16_t);
2318 memcpy((log->
buffer) + log->
size, text, arg_size);
2319 log->
size += arg_size;
2336 size_t new_log_size = 0;
2343 dlt_vlog(LOG_WARNING,
"%s dlt_user_initialised false\n", __FUNCTION__);
2347 arg_size = strlen(text) + 1;
2348 new_log_size = log->
size + arg_size +
sizeof(uint16_t);
2355 new_log_size = log->
size + arg_size +
sizeof(uint32_t) +
sizeof(uint16_t);
2362 memcpy((log->
buffer) + log->
size, &(type_info),
sizeof(uint32_t));
2363 log->
size +=
sizeof(uint32_t);
2366 memcpy((log->
buffer) + log->
size, &(arg_size),
sizeof(uint16_t));
2367 log->
size +=
sizeof(uint16_t);
2369 memcpy((log->
buffer) + log->
size, text, arg_size);
2370 log->
size += arg_size;
2378 int (*dlt_injection_callback)(uint32_t service_id,
void *
data, uint32_t length))
2464 void (*dlt_log_level_changed_callback)(
char context_id[
DLT_ID_SIZE],uint8_t log_level, uint8_t trace_status))
2503 int total_size, used_size;
2506 return (total_size - used_size < total_size / 2) ? -1 : 1;
2524 dlt_vlog(LOG_ERR,
"Network trace type %d is outside valid range", nw_trace_type);
2541 gettimeofday(&tv,
NULL);
2585 dlt_vlog(LOG_ERR,
"Network trace type %d is outside valid range", nw_trace_type);
2641 dlt_vlog(LOG_ERR,
"Network trace type %d is outside valid range", nw_trace_type);
2678 prctl(PR_SET_NAME,
"dlt_segmented", 0, 0, 0);
2698 dlt_log(LOG_WARNING,
"NWTSegmented: Could not send end segment.\n");
2725 dlt_log(LOG_WARNING,
"NWTSegmented: Could not send end segment.\n");
2739 uint32_t offset = 0;
2740 uint16_t sequence = 0;
2762 dlt_log(LOG_ERR,
"NWTSegmented: Could not send segment. Aborting.\n");
2779 if(thread_data ==
NULL)
2783 thread_data->
header = malloc(header_len);
2789 thread_data->
payload = malloc(payload_len);
2792 free(thread_data->
header);
2798 thread_data->
handle = handle;
2801 memcpy(thread_data->
header, header, header_len);
2803 memcpy(thread_data->
payload, payload, payload_len);
2812 dlt_log(LOG_ERR,
"NWTSegmented: Could not send start segment. Aborting.\n");
2813 free(thread_data->
header);
2822 dlt_log(LOG_ERR,
"NWTSegmented: Could not open queue.\n");
2823 free(thread_data->
header);
2836 dlt_log(LOG_WARNING,
"NWTSegmented: Queue full. Message discarded.\n");
2838 free(thread_data->
header);
2841 dlt_vnlog(LOG_WARNING, 256,
"NWTSegmented: Could not write into queue: %s \n",strerror(errno));
2857 if(payload ==
NULL && payload_len > 0)
2864 dlt_vlog(LOG_ERR,
"Network trace type %d is outside valid range", nw_trace_type);
2925 if (payload ==
NULL)
2950 if (loglevel < DLT_USER_LOG_LEVEL_NOT_SET || loglevel >=
DLT_LOG_MAX)
2952 dlt_vlog(LOG_ERR,
"Loglevel %d is outside valid range", loglevel);
2956 if ((handle ==
NULL) || (text ==
NULL))
2986 if (loglevel < DLT_USER_LOG_LEVEL_NOT_SET || loglevel >=
DLT_LOG_MAX)
2988 dlt_vlog(LOG_ERR,
"Loglevel %d is outside valid range", loglevel);
2992 if ((handle ==
NULL) || (text ==
NULL))
3026 if (loglevel < DLT_USER_LOG_LEVEL_NOT_SET || loglevel >=
DLT_LOG_MAX)
3028 dlt_vlog(LOG_ERR,
"Loglevel %d is outside valid range", loglevel);
3032 if ((handle ==
NULL) || (text ==
NULL))
3066 if (loglevel < DLT_USER_LOG_LEVEL_NOT_SET || loglevel >=
DLT_LOG_MAX)
3068 dlt_vlog(LOG_ERR,
"Loglevel %d is outside valid range", loglevel);
3102 if (loglevel < DLT_USER_LOG_LEVEL_NOT_SET || loglevel >=
DLT_LOG_MAX)
3104 dlt_vlog(LOG_ERR,
"Loglevel %d is outside valid range", loglevel);
3138 if (loglevel < DLT_USER_LOG_LEVEL_NOT_SET || loglevel >=
DLT_LOG_MAX)
3140 dlt_vlog(LOG_ERR,
"Loglevel %d is outside valid range", loglevel);
3170 dlt_vlog(LOG_ERR,
"%s Failed to initialise dlt", __FUNCTION__);
3184 dlt_vlog(LOG_ERR,
"%s Failed to initialise dlt", __FUNCTION__);
3201 dlt_vlog(LOG_ERR,
"%s Failed to initialise dlt", __FUNCTION__);
3218 dlt_vlog(LOG_ERR,
"%s Failed to initialise dlt", __FUNCTION__);
3235 dlt_vlog(LOG_ERR,
"%s Failed to initialise dlt", __FUNCTION__);
3252 dlt_vlog(LOG_ERR,
"%s Failed to initialise dlt", __FUNCTION__);
3269 dlt_vlog(LOG_ERR,
"%s Failed to initialise dlt", __FUNCTION__);
3286 dlt_vlog(LOG_ERR,
"%s Failed to initialise dlt", __FUNCTION__);
3302 dlt_vlog(LOG_ERR,
"%s Failed to initialise dlt", __FUNCTION__);
3315 prctl(PR_SET_NAME,
"dlt_receiver", 0, 0, 0);
3323 dlt_log(LOG_CRIT,
"Receiver thread encountered error condition\n");
3341 dlt_vlog(LOG_ERR,
"%s Failed to initialise dlt", __FUNCTION__);
3353 static unsigned char dlt_user_queue_resend_error_counter = 0;
3366 if (resend_data ==
NULL)
3378 if(!dlt_user_queue_resend_error_counter)
3381 dlt_log(LOG_WARNING,
"NWTSegmented: Could not open queue.\n");
3383 dlt_user_queue_resend_error_counter = 1;
3390 if(!dlt_user_queue_resend_error_counter)
3393 dlt_vnlog(LOG_DEBUG, 256,
"Could not request resending.: %s \n",strerror(errno));
3395 dlt_user_queue_resend_error_counter = 1;
3400 dlt_user_queue_resend_error_counter = 0;
3410 DltUserHeader userheader;
3417 dlt_vlog(LOG_ERR,
"%s dlt_user_initialised false\n", __FUNCTION__);
3431 #ifdef DLT_SHM_ENABLE 3486 #if (BYTE_ORDER==BIG_ENDIAN) 3549 dlt_log(LOG_WARNING,
"Huge message discarded!\n");
3597 #ifdef DLT_SHM_ENABLE 3604 &(userheader),
sizeof(DltUserHeader),
3609 #ifdef DLT_TEST_ENABLE 3610 if(dlt_user.corrupt_user_header) {
3611 userheader.pattern[0]=0xff;
3612 userheader.pattern[1]=0xff;
3613 userheader.pattern[2]=0xff;
3614 userheader.pattern[3]=0xff;
3616 if(dlt_user.corrupt_message_size) {
3621 &(userheader),
sizeof(DltUserHeader),
3633 (
unsigned char *)&(userheader),
sizeof(DltUserHeader),
3640 dlt_log(LOG_WARNING,
"Buffer full! Messages will be discarded.\n");
3673 #ifdef DLT_SHM_ENABLE 3707 DltUserHeader userheader;
3708 DltUserControlMsgRegisterApplication usercontext;
3712 if (dlt_user.
appID[0]==
'\0')
3725 usercontext.pid = getpid();
3733 usercontext.description_length = 0;
3743 &(userheader),
sizeof(DltUserHeader),
3744 &(usercontext),
sizeof(DltUserControlMsgRegisterApplication),
3753 (
unsigned char *)&(userheader),
sizeof(DltUserHeader),
3754 (
const unsigned char*)&(usercontext),
sizeof(DltUserControlMsgRegisterApplication),
3757 dlt_log(LOG_WARNING,
"Storing message to history buffer failed! Message discarded.\n");
3775 DltUserHeader userheader;
3776 DltUserControlMsgUnregisterApplication usercontext;
3778 if (dlt_user.
appID[0]==
'\0')
3791 usercontext.pid = getpid();
3800 &(userheader),
sizeof(DltUserHeader),
3801 &(usercontext),
sizeof(DltUserControlMsgUnregisterApplication));
3806 DltUserHeader userheader;
3807 DltUserControlMsgRegisterContext usercontext;
3835 usercontext.pid = getpid();
3837 usercontext.log_level = (int8_t)log->
log_level;
3846 usercontext.description_length = 0;
3855 if (dlt_user.
appID[0]!=
'\0')
3867 (
unsigned char *)&(userheader),
sizeof(DltUserHeader),
3868 (
const unsigned char*)&(usercontext),
sizeof(DltUserControlMsgRegisterContext),
3871 dlt_log(LOG_WARNING,
"Storing message to history buffer failed! Message discarded.\n");
3890 DltUserHeader userheader;
3891 DltUserControlMsgUnregisterContext usercontext;
3917 usercontext.pid = getpid();
3926 &(userheader),
sizeof(DltUserHeader),
3927 &(usercontext),
sizeof(DltUserControlMsgUnregisterContext));
3932 DltUserHeader userheader;
3933 DltUserControlMsgAppLogLevelTraceStatus usercontext;
3935 if (loglevel < DLT_USER_LOG_LEVEL_NOT_SET || loglevel >=
DLT_LOG_MAX)
3937 dlt_vlog(LOG_ERR,
"Loglevel %d is outside valid range", loglevel);
3943 dlt_vlog(LOG_ERR,
"Tracestatus %d is outside valid range", tracestatus);
3947 if ((appid ==
NULL) || (appid[0]==
'\0'))
3974 usercontext.log_level = loglevel;
3975 usercontext.trace_status = tracestatus;
3984 &(userheader),
sizeof(DltUserHeader),
3985 &(usercontext),
sizeof(DltUserControlMsgAppLogLevelTraceStatus));
3990 DltUserHeader userheader;
3991 DltUserControlMsgLogMode logmode;
3995 dlt_vlog(LOG_ERR,
"User log mode %d is outside valid range", mode);
4006 logmode.log_mode = (
unsigned char) mode;
4015 &(userheader),
sizeof(DltUserHeader),
4016 &(logmode),
sizeof(DltUserControlMsgLogMode));
4021 DltUserHeader userheader;
4036 &(userheader),
sizeof(DltUserHeader), 0, 0);
4041 uint8_t *databuffer_tmp;
4042 int32_t datasize_tmp;
4043 int32_t databuffersize_tmp;
4046 if ((msg ==
NULL) || (log ==
NULL))
4087 DltUserHeader *userheader;
4090 DltUserControlMsgLogLevel *usercontextll;
4091 DltUserControlMsgInjection *usercontextinj;
4092 DltUserControlMsgLogState *userlogstate;
4093 unsigned char *userbuffer;
4098 unsigned char *delayed_inject_buffer = 0;
4099 uint32_t delayed_inject_data_length = 0;
4119 if (receiver->
bytesRcvd < (int32_t)
sizeof(DltUserHeader))
4128 userheader = (DltUserHeader*) (receiver->
buf+offset);
4138 while ((int32_t)(
sizeof(DltUserHeader)+offset)<=receiver->
bytesRcvd);
4150 receiver->
buf+=offset;
4154 switch (userheader->message)
4158 if (receiver->
bytesRcvd < (int32_t)(
sizeof(DltUserHeader)+
sizeof(DltUserControlMsgLogLevel)))
4164 usercontextll = (DltUserControlMsgLogLevel*) (receiver->
buf+
sizeof(DltUserHeader));
4167 if (usercontextll !=
NULL)
4171 if ((usercontextll->log_level_pos >= 0) &&
4177 dlt_user.
dlt_ll_ts[usercontextll->log_level_pos].
log_level = usercontextll->log_level;
4186 delayed_log_level_changed_callback.
log_level = usercontextll->log_level;
4187 delayed_log_level_changed_callback.
trace_status = usercontextll->trace_status;
4198 delayed_log_level_changed_callback.
log_level,
4212 if (receiver->
bytesRcvd < (int32_t)(
sizeof(DltUserHeader)+
sizeof(DltUserControlMsgInjection)))
4218 usercontextinj = (DltUserControlMsgInjection*) (receiver->
buf+
sizeof(DltUserHeader));
4219 userbuffer = (
unsigned char*) (receiver->
buf+
sizeof(DltUserHeader)+
sizeof(DltUserControlMsgInjection));
4221 if (userbuffer !=
NULL)
4224 if (receiver->
bytesRcvd < (int32_t)(
sizeof(DltUserHeader)+
sizeof(DltUserControlMsgInjection)+usercontextinj->data_length_inject))
4232 if ((usercontextinj->data_length_inject>0) && (dlt_user.
dlt_ll_ts))
4244 delayed_injection_callback.
service_id = usercontextinj->service_id;
4245 delayed_inject_data_length = usercontextinj->data_length_inject;
4246 delayed_inject_buffer = malloc(delayed_inject_data_length);
4248 if(delayed_inject_buffer !=
NULL)
4249 memcpy(delayed_inject_buffer, userbuffer, delayed_inject_data_length);
4261 delayed_injection_callback.
injection_callback(delayed_injection_callback.
service_id, delayed_inject_buffer, delayed_inject_data_length);
4263 free(delayed_inject_buffer);
4264 delayed_inject_buffer =
NULL;
4277 if (receiver->
bytesRcvd < (int32_t)(
sizeof(DltUserHeader)+
sizeof(DltUserControlMsgLogState)))
4283 userlogstate = (DltUserControlMsgLogState*) (receiver->
buf+
sizeof(DltUserHeader));
4284 dlt_user.
log_state = userlogstate->log_state;
4295 dlt_log(LOG_WARNING,
"Invalid user message type received!\n");
4327 if (dlt_user.
appID[0]==
'\0')
4337 for (num=0;num<count;num++)
4345 DltUserHeader *userheader = (DltUserHeader*) (dlt_user.
resend_buffer);
4349 switch (userheader->message)
4353 DltUserControlMsgRegisterContext *usercontext = (DltUserControlMsgRegisterContext*) (dlt_user.
resend_buffer+
sizeof(DltUserHeader));
4354 if ((usercontext != 0) && (usercontext->apid[0]==
'\0'))
4362 DltExtendedHeader * extendedHeader = (DltExtendedHeader *)(dlt_user.
resend_buffer+
sizeof(DltUserHeader)+
4363 sizeof(DltStandardHeader)+
sizeof(DltStandardHeaderExtra));
4364 if ((extendedHeader) != 0 && (extendedHeader->apid[0]==
'\0'))
4377 #ifdef DLT_SHM_ENABLE 4407 uint32_t num, reregistered = 0;
4425 #ifdef DLT_SHM_ENABLE 4434 dlt_log(LOG_NOTICE,
"Logging (re-)enabled!\n");
4478 if (reregistered==1)
4488 DltUserHeader userheader;
4489 DltUserControlMsgBufferOverflow userpayload;
4508 &(userheader),
sizeof(DltUserHeader),
4509 &(userpayload),
sizeof(DltUserControlMsgBufferOverflow));
4514 if(total_size ==
NULL || used_size ==
NULL)
4519 #ifdef DLT_SHM_ENABLE 4531 #ifdef DLT_TEST_ENABLE 4532 void dlt_user_test_corrupt_user_header(
int enable)
4534 dlt_user.corrupt_user_header = enable;
4536 void dlt_user_test_corrupt_message_size(
int enable,int16_t size)
4538 dlt_user.corrupt_message_size = enable;
4539 dlt_user.corrupt_message_size_size = size;
4552 dlt_log(LOG_CRIT,
"Can't create receiver thread!\n");
4560 dlt_log(LOG_CRIT,
"Can't start segmented thread!\n");
4569 int dlt_receiverthread_result = 0;
4570 int dlt_segmented_nwt_result = 0;
4575 if (dlt_receiverthread_result != 0)
4578 "ERROR pthread_cancel(dlt_receiverthread_handle): %s\n",
4587 if (dlt_segmented_nwt_result != 0)
4590 "ERROR pthread_cancel(dlt_user.dlt_segmented_nwt_handle): %s\n",
4603 "ERROR pthread_join(dlt_receiverthread_handle, NULL): %s\n",
4616 "ERROR pthread_join(dlt_user.dlt_segmented_nwt_handle, NULL): %s\n",
4636 "Logging disabled, failed re-start thread after fork(pid=%i)!\n",
static int dlt_start_threads()
void dlt_lock_mutex(pthread_mutex_t *mutex)
int dlt_set_resend_timeout_atexit(uint32_t timeout_in_milliseconds)
#define DLT_USER_MESSAGE_LOG_MODE
DltReturnValue dlt_user_log_write_float32(DltContextData *log, float32_t data)
DltReturnValue dlt_buffer_init_dynamic(DltBuffer *buf, uint32_t min_size, uint32_t max_size, uint32_t step_size)
#define DLT_USER_MESSAGE_UNREGISTER_APPLICATION
DltReturnValue dlt_user_log_write_int16(DltContextData *log, int16_t data)
static void dlt_fork_child_fork_handler()
DltReturnValue dlt_user_log_write_string(DltContextData *log, const char *text)
#define DLT_USER_MESSAGE_REGISTER_APPLICATION
int dlt_user_atexit_blow_out_user_buffer(void)
dlt_ll_ts_type * dlt_ll_ts
#define DLT_USER_CONTEXT_ALLOC_SIZE
DltReturnValue dlt_verbose_mode(void)
#define DLT_USER_MESSAGE_MARKER
#define DLT_TYPE_INFO_SINT
DltStorageHeader * storageheader
uint32_t dlt_buffer_get_total_size(DltBuffer *buf)
static DltReturnValue dlt_user_log_check_user_message(void)
void(* log_level_changed_callback)(char context_id[DLT_ID_SIZE], uint8_t log_level, uint8_t trace_status)
int dlt_shm_get_total_size(DltShm *buf)
DltReturnValue dlt_init_common(void)
#define DLT_USER_ENV_BUFFER_MAX_SIZE
#define DLT_USER_MESSAGE_LOG_LEVEL
static void dlt_fork_pre_fork_handler()
#define DLT_HTYP_PROTOCOL_VERSION1
DltReturnValue dlt_user_log_write_int(DltContextData *log, int data)
#define DLT_MESSAGE_QUEUE_NAME
mqd_t dlt_segmented_queue_read_handle
void dlt_get_minor_version(char *buf, size_t size)
void dlt_set_id(char *id, const char *text)
DltReturnValue dlt_unregister_app(void)
#define DLT_USER_MESSAGE_INJECTION
pthread_t dlt_segmented_nwt_handle
DltReturnValue dlt_register_context_ll_ts(DltContext *handle, const char *contextid, const char *description, int loglevel, int tracestatus)
#define DLT_USER_RINGBUFFER_MAX_SIZE
#define DLT_USER_MESSAGE_OVERFLOW
static int dlt_user_freeing
#define DLT_USER_RECEIVE_DELAY
DltReturnValue dlt_user_log_out2(int handle, void *ptr1, size_t len1, void *ptr2, size_t len2)
#define DLT_USER_ENV_BUFFER_STEP_SIZE
DltReturnValue dlt_free(void)
DltReturnValue dlt_register_app(const char *appid, const char *description)
DltReturnValue dlt_user_trace_network_segmented_end(uint32_t id, DltContext *handle, DltNetworkTraceType nw_trace_type)
#define DLT_STANDARD_HEADER_EXTRA_SIZE(htyp)
DltReturnValue dlt_buffer_free_dynamic(DltBuffer *buf)
DltReturnValue dlt_register_context(DltContext *handle, const char *contextid, const char *description)
DltReturnValue dlt_user_log_out3(int handle, void *ptr1, size_t len1, void *ptr2, size_t len2, void *ptr3, size_t len3)
DltReturnValue dlt_user_log_write_uint64_formatted(DltContextData *log, uint64_t data, DltFormatType type)
DltReturnValue dlt_receiver_remove(DltReceiver *receiver, int size)
DltReturnValue dlt_use_extended_header_for_non_verbose(int8_t use_extende_header_for_non_verbose)
DltReturnValue dlt_user_log_write_int32(DltContextData *log, int32_t data)
static DltReturnValue dlt_send_app_ll_ts_limit(const char *appid, DltLogLevelType loglevel, DltTraceStatusType tracestatus)
#define DLT_USER_MAX_LIB_VERSION_LENGTH
DltReturnValue dlt_with_session_id(int8_t with_session_id)
char contextID[DLT_ID_SIZE]
DltReturnValue dlt_log(int prio, char *s)
int dlt_user_check_userheader(DltUserHeader *userheader)
int dlt_env_adjust_ll_from_env(dlt_env_ll_set const *const ll_set, char const *const apid, char const *const ctid, int const ll)
adjust log-level based on values given through environment
static DltReturnValue dlt_user_log_send_unregister_context(DltContextData *log)
int(* injection_callback)(uint32_t service_id, void *data, uint32_t length)
DltReturnValue dlt_user_log_write_uint16_formatted(DltContextData *log, uint16_t data, DltFormatType type)
DltReturnValue dlt_init_file(const char *name)
int dlt_receiver_receive_fd(DltReceiver *receiver)
int dlt_shm_push(DltShm *buf, const unsigned char *data1, unsigned int size1, const unsigned char *data2, unsigned int size2, const unsigned char *data3, unsigned int size3)
static DltReturnValue dlt_user_log_send_unregister_application(void)
uint32_t dlt_ll_ts_max_num_entries
mqd_t dlt_segmented_queue_write_handle
DltReturnValue dlt_enable_local_print(void)
char * context_description
DltReturnValue dlt_message_init(DltMessage *msg, int verbose)
DltReturnValue dlt_register_log_level_changed_callback(DltContext *handle, void(*dlt_log_level_changed_callback)(char context_id[DLT_ID_SIZE], uint8_t log_level, uint8_t trace_status))
DltReturnValue dlt_receiver_move_to_begin(DltReceiver *receiver)
static DltReturnValue dlt_user_log_send_register_context(DltContextData *log)
static void dlt_user_trace_network_segmented_thread(void *unused)
DltExtendedHeader * extendedheader
DltReturnValue dlt_user_trace_network_segmented_start(uint32_t *id, DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len)
#define DLT_USER_MESSAGE_REGISTER_CONTEXT
static int atfork_registered
#define DLT_USER_ATEXIT_RESEND_BUFFER_SLEEP
#define DLT_DELAYED_RESEND_INDICATOR_PATTERN
uint32_t overflow_counter
DltReturnValue dlt_message_print_ascii(DltMessage *message, char *text, uint32_t size, int verbose)
int dlt_env_extract_ll_set(char **const env, dlt_env_ll_set *const ll_set)
extract all items out of string
char * application_description
#define DLT_USER_MESSAGE_UNREGISTER_CONTEXT
dlt_env_ll_set initial_ll_set
static DltReturnValue dlt_user_log_send_register_application(void)
#define DLT_USER_RINGBUFFER_MIN_SIZE
int dlt_buffer_copy(DltBuffer *buf, unsigned char *data, int max_size)
uint32_t timeout_at_exit_handler
static void dlt_user_log_reattach_to_daemon(void)
static DltReturnValue dlt_user_log_send_log_mode(DltUserLogMode mode)
static char * service_id[]
DltReturnValue dlt_check_library_version(const char *user_major_version, const char *user_minor_version)
int dlt_buffer_get_used_size(DltBuffer *buf)
DltReturnValue dlt_message_set_extraparameters(DltMessage *msg, int verbose)
DltReturnValue dlt_log_uint(DltContext *handle, DltLogLevelType loglevel, unsigned int data)
static char data[kDataSize]
#define DLT_MSIN_MTIN_SHIFT
DltReturnValue dlt_user_log_write_raw_formatted(DltContextData *log, void *data, uint16_t length, DltFormatType type)
uint8_t resend_buffer[DLT_USER_RESENDBUF_MAX_SIZE]
static char dlt_daemon_fifo[NAME_MAX+1]
static void dlt_fork_parent_fork_handler()
static DltReturnValue dlt_user_log_init(DltContext *handle, DltContextData *log)
DltReturnValue dlt_set_storageheader(DltStorageHeader *storageheader, const char *ecu)
int8_t enable_local_print
DltReturnValue dlt_receiver_init(DltReceiver *receiver, int fd, int buffersize)
DltReturnValue dlt_user_log_write_ptr(DltContextData *log, void *data)
DltReturnValue dlt_shm_init_client(DltShm *buf, int key)
#define DLT_IS_HTYP_UEH(htyp)
void(* log_level_changed_callback)(char context_id[DLT_ID_SIZE], uint8_t log_level, uint8_t trace_status)
static void dlt_user_atexit_handler(void)
static void dlt_stop_threads()
DltReturnValue dlt_user_log_write_utf8_string(DltContextData *log, const char *text)
#define DLT_USER_TEXT_LENGTH
DltReturnValue dlt_user_check_buffer(int *total_size, int *used_size)
#define DLT_TYPE_NW_TRACE
DltReturnValue dlt_user_log_write_int64(DltContextData *log, int64_t data)
DltReturnValue dlt_user_trace_network_segmented_segment(uint32_t id, DltContext *handle, DltNetworkTraceType nw_trace_type, int sequence, uint16_t payload_len, void *payload)
int dlt_mkdir_recursive(const char *dir)
DltReturnValue dlt_init(void)
DltReturnValue dlt_user_log_write_uint8(DltContextData *log, uint8_t data)
uint32_t dlt_uptime(void)
int dlt_shm_get_used_size(DltShm *buf)
#define DLT_USER_ATEXIT_RESEND_BUFFER_EXIT_TIMEOUT
#define DLT_USER_DEFAULT_ECU_ID
#define DLT_USER_MAX_FILENAME_LENGTH
DltReturnValue dlt_log_int(DltContext *handle, DltLogLevelType loglevel, int data)
#define DLT_USER_RCVBUF_MAX_SIZE
DltReturnValue dlt_user_log_write_uint32_formatted(DltContextData *log, uint32_t data, DltFormatType type)
DltReturnValue dlt_disable_local_print(void)
DltReturnValue dlt_user_set_userheader(DltUserHeader *userheader, uint32_t mtype)
#define DLT_TYPE_INFO_FLOA
#define DLT_USER_INITIAL_LOG_LEVEL
uint8_t headerbuffer[sizeof(DltStorageHeader)+sizeof(DltStandardHeader)+sizeof(DltStandardHeaderExtra)+sizeof(DltExtendedHeader)]
DltNetworkTraceType nw_trace_type
int dlt_buffer_remove(DltBuffer *buf)
#define DLT_USER_MESSAGE_LOG_STATE
#define DLT_TYPE_INFO_STRG
int dlt_buffer_get_message_count(DltBuffer *buf)
DltStandardHeaderExtra headerextra
DltReturnValue dlt_user_log_write_uint(DltContextData *log, unsigned int data)
#define DLT_USER_ENV_BUFFER_MIN_SIZE
static char dlt_user_dir[NAME_MAX+1]
DltReturnValue dlt_user_log_write_uint32(DltContextData *log, uint32_t data)
DltReturnValue dlt_user_trace_network_segmented(DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload)
#define DLT_USER_MESSAGE_APP_LL_TS
unsigned char buffer[DLT_USER_BUF_MAX_SIZE]
int8_t use_extende_header_for_non_verbose
DltReturnValue dlt_user_log_write_start_id(DltContext *handle, DltContextData *log, DltLogLevelType loglevel, uint32_t messageid)
DltReturnValue dlt_user_check_library_version(const char *user_major_version, const char *user_minor_version)
#define DLT_USER_INJECTION_MIN
char dltFifoBaseDir[PATH_MAX+1]
#define DLT_MSIN_MSTP_SHIFT
DltReturnValue dlt_user_trace_network_truncated(DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload, int allow_truncate)
#define DLT_USER_RINGBUFFER_STEP_SIZE
DltStandardHeader * standardheader
DltReturnValue dlt_vnlog(int prio, size_t size, const char *format,...)
void dlt_unlock_mutex(pthread_mutex_t *mutex)
static bool dlt_user_initialised
pthread_cond_t mq_init_condition
#define DLT_TYPE_INFO_BOOL
DltReturnValue dlt_log_string(DltContext *handle, DltLogLevelType loglevel, const char *text)
DltReturnValue dlt_with_timestamp(int8_t with_timestamp)
DltReturnValue dlt_set_application_ll_ts_limit(DltLogLevelType loglevel, DltTraceStatusType tracestatus)
static DltReturnValue dlt_user_queue_resend(void)
static pthread_t dlt_receiverthread_handle
DltReturnValue dlt_log_string_int(DltContext *handle, DltLogLevelType loglevel, const char *text, int data)
#define DLT_TYPE_INFO_RAWD
static DltReturnValue dlt_user_log_send_marker()
#define DLT_USER_MESSAGE_LOG
DltReturnValue dlt_shm_free_client(DltShm *buf)
int dlt_buffer_push3(DltBuffer *buf, const unsigned char *data1, unsigned int size1, const unsigned char *data2, unsigned int size2, const unsigned char *data3, unsigned int size3)
#define DLT_USER_BUFFER_LENGTH
char contextID[DLT_ID_SIZE]
void dlt_env_free_ll_set(dlt_env_ll_set *const ll_set)
release ll_set
DltReturnValue dlt_user_log_write_int8(DltContextData *log, int8_t data)
char contextID[DLT_ID_SIZE]
DltReturnValue dlt_log_marker()
static DltReturnValue dlt_user_is_logLevel_enabled(DltContext *handle, DltLogLevelType loglevel)
#define DLT_USER_BUF_MAX_SIZE
DltReturnValue dlt_init_message_queue(void)
DltReturnValue dlt_user_log_write_uint8_formatted(DltContextData *log, uint8_t data, DltFormatType type)
#define DLT_TYPE_INFO_UINT
static char str[DLT_USER_BUFFER_LENGTH]
DltReturnValue dlt_log_string_uint(DltContext *handle, DltLogLevelType loglevel, const char *text, unsigned int data)
DltReturnValue dlt_register_injection_callback(DltContext *handle, uint32_t service_id, int(*dlt_injection_callback)(uint32_t service_id, void *data, uint32_t length))
#define DLT_MAX_TRACE_SEGMENT_SIZE
int8_t * trace_status_ptr
#define DLT_USER_DEFAULT_MSGID
#define DLT_USER_WITH_TIMESTAMP
DltReturnValue dlt_set_log_mode(DltUserLogMode mode)
DltReturnValue dlt_user_log_write_uint64(DltContextData *log, uint64_t data)
DltReturnValue dlt_user_log_write_uint16(DltContextData *log, uint16_t data)
DltReturnValue dlt_nonverbose_mode(void)
char * context_description
static void dlt_user_trace_network_segmented_thread_segmenter(s_segmented_data *data)
DltReturnValue dlt_message_get_extraparameters(DltMessage *msg, int verbose)
uint32_t dlt_ll_ts_num_entries
DltReturnValue dlt_user_log_write_constant_string(DltContextData *log, const char *text)
#define DLT_USER_WITH_ECU_ID
#define DLT_USER_WITH_SESSION_ID
static DltReturnValue dlt_user_print_msg(DltMessage *msg, DltContextData *log)
static void dlt_user_receiverthread_function(void *ptr)
static DltReturnValue dlt_user_log_send_log(DltContextData *log, int mtype)
#define DLT_USER_MESSAGE_LOG_SHM
DltReturnValue dlt_user_trace_network(DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload)
#define DLT_USER_TRACE_STATUS_NOT_SET
DltReturnValue dlt_unregister_context(DltContext *handle)
#define DLT_LOG_FATAL_RESET_TRAP(LOGLEVEL)
#define DLT_USER_LOG_LEVEL_NOT_SET
DltReturnValue dlt_vlog(int prio, const char *format,...)
DltReturnValue dlt_log_raw(DltContext *handle, DltLogLevelType loglevel, void *data, uint16_t length)
void dlt_get_major_version(char *buf, size_t size)
DltUserInjectionCallback * injection_table
DltReturnValue dlt_user_log_write_bool(DltContextData *log, uint8_t data)
#define DLT_USER_INITIAL_TRACE_STATUS
DltReturnValue dlt_user_log_write_raw(DltContextData *log, void *data, uint16_t length)
DltReturnValue dlt_user_log_write_finish(DltContextData *log)
DltReturnValue dlt_user_log_write_float64(DltContextData *log, float64_t data)
#define DLT_USER_ENV_LOCAL_PRINT_MODE
DltReturnValue dlt_user_log_resend_buffer(void)
static int atexit_registered
DltReturnValue dlt_with_ecu_id(int8_t with_ecu_id)
#define DLT_USER_USE_EXTENDED_HEADER_FOR_NONVERBOSE
DltReturnValue dlt_user_log_write_start(DltContext *handle, DltContextData *log, DltLogLevelType loglevel)
static DltReturnValue dlt_user_log_send_overflow(void)
int8_t * trace_status_ptr
DltReturnValue dlt_receiver_free(DltReceiver *receiver)
DltReturnValue dlt_forward_msg(void *msgdata, size_t size)