summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* filetransfer: Return error if no free spacedevel/lib_filetransfer_failSaya Sugiura2021-11-251-1/+3
| | | | | | Closes #353 Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Support for Cygwin toolchain. (#351)DoctorNoobingstoneIPresume2021-11-1510-4/+10
| | | | | | Also tested with the latest version running on Windows XP (gcc-5.4.0) (http://www.crouchingtigerhiddenfruitbat.org/cygwin/timemachine.html). Signed-off-by: Adder <adder_2003@yahoo.com>
* dlt-system: fix invalid free by removing unused TempDir (#350)Andrei Rusu2021-11-122-12/+0
| | | Signed-off-by: Andrei-Mircea Rusu <andrei-mircea.rusu@continental-corporation.com>
* fix -Wformat issues reported by clang (#349)sebastienr2021-11-092-8/+8
| | | | | | | | | | | | | | * some previous dlt_vlog was using %lu specifier to display an uint64_t variable. However, this isn't portable as depending on the system you're targeting (32bits, 64bits, Linux, android, etc.), the uint64_t can be an unsigned long long. This prevents compilation on system where -Werror and -Wformat is activated coupled with a less tolerant compiler (e.g clang). Instead, PRIxN macros (e.g PRIu64 for uint64_t) are now used as specifier to ensure compatibility for each platforms * for bytes_read which is of type ssize_t, zd specifier is used as indicated in C99 standard * for st_size (from struct stat) which is of type off_t, POSIX says that it should be a signed integer. To be safe, we now use %jd specifier to ensure that it will fit correctly
* Forcibly the severity level set (#346)dhnatiuk12021-11-031-0/+3
| | | | | | | | | Some QNX components when bringing up send messages of severity type "FATAL" instead of "INFO" via slogger2. QNX component send messages of payload data_type = SLOG2_TYPE_ONLINE. The buffer is new and just came online. dlt-qnx-slogger2 does not support info->data_type = SLOG2_TYPE_ONLINE and therefore sets the wrong log level. This commit forcibly change the severity level for all info->data_type = SLOG2_TYPE_ONLINE to SLOG2_INFO. Signed-off-by: Dinidrol <vamovitch@gmail.com>
* daemon: Do not exit when accept returns ECONNABORTED (#347)rvalovyi2021-11-031-0/+2
| | | | | | | | | | | | Scan of port 3490 from a Linux machine by 'nmap -v -p 3490 -Pn IP_address_of_QNX_board' leads to dlt-daemon crash. It is necessary to parse the code of the returned error in errno. If errno = ECONNABORTED it means there was an attempt to scan port 3490 and on this error there is no need to exit the application by error. Fix for the issue https://github.com/GENIVI/dlt-daemon/issues/341 Signed-off-by: Ruslan Valovyi <ruslan.valovyi@volvocars.com>
* dlt-system : fix invalid free with ConfigurationFileNameMarc TITINGER2021-10-211-2/+2
| | | | | | | | | when using default const string. this location is free()'ed in the cleanup routine, leading to bugcheck upon exit. Use strdup to allocate memory, that can be free()'ed. Signed-off-by: Marc TITINGER <marc.titinger@non.se.com>
* dlt-daemon: Only create directories if they do not exist yetAlexander Mohr2021-10-211-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | dlt_mkdir_recursive runs mkdir for directories which already exist. This fails if the directory already exists and the dlt-daemon does not have the permissions to change the mode on the directory. On many systems the directories are not created by dlt-daemon itself but rather through the build system or while the root filesystem is created. At this stage the permissions are already set properly and they might be less permissive than what dlt-daemon expects but still sufficient. For example is rwx not necessary for each directory in the tree. Before this commit the following scenario would fail: * Path is set to /mnt/dlt/ * mnt has 755 permissions for root * dlt has 755 for dlt user As dlt daemon would try to run mkdir on /mnt dlt_mkdir_recursive would fail due to lack of permissions although the permissions are sufficient for dlt-daemon to work and write its files into /mnt/dlt/ With this commit /mnt would not be created anymore because it already exists. If the permissions are not sufficient for dlt-daemon to write in it will fail when trying to create files and exit at this point Signed-off-by: Alexander Mohr <alexander.m.mohr@daimler.com>
* fixes compilation issue with clangSebastien RAILLET2021-10-131-2/+2
| | | | | | | * function atomic_compare_exchange_strong expect a pointer to an _Atomic type. dlt_user_initialised is now an atomic_bool * function dlt_set_filesize_max returned a DLT_LOG_ERROR which isn't a DltReturnValue. This commit replaces DLT_LOG_ERROR by DLT_RETURN_ERROR which is the expected return type Signed-off-by: Sebastien RAILLET <sebastien.raillet@marelli.com>
* dlt-daemon: create sockets using "android way"Sebastien RAILLET2021-10-125-40/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Before this commit, dlt-daemon sockets were created inside /data/local/tmp. This works but have many drawbacks: - /data/local/tmp isn't always a tmpfs depending of the android system you have. Means sockets are potentially created on a filesystem which binds to a real device - as the sockets are created by the dlt-daemon itself, this prevent the usage of specific SELinux labels / contexts as they will inherit the label / context from its parent location (e.g the ones from /data/local/tmp). This prevent a fine control of the SELinux label / context that you would like to apply on them * This commit adapts the dlt-daemon in such way: - application and control sockets are now created inside /dev/socket which is the standard path for sockets on android - these sockets are now created by init (see dlt-daemon.rc) and their fds are recovered by dlt-daemon through a specific android API (dlt_daemon_unix_android_get_socket). If the fds can't be recovered, we fallback to the previous mechanism by creating by ourself the sockets (even if this will prevent SELinux label / context on this socket) - all these modifications have been put under compilation flag for android Signed-off-by: Sebastien RAILLET <sebastien.raillet@marelli.com>
* dlt-system: fix a libc buffer overflow detection on 32bit targetsMarc TITINGER2021-10-081-2/+2
| | | | | | rather self-exp: 32bits native hint will not hold 8 bits. Signed-off-by: Marc TITINGER <marc.titinger@hotmail.com>
* Update ReleaseNotes and version to v2.18.8v2.18.8Saya Sugiura2021-10-052-2/+54
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* lib: Fix wrong type alert from lgtmSaya Sugiura2021-10-051-2/+2
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* gtest_dlt_daemon_gateway: fix gtest build failedLe-Tin2021-10-053-8/+15
| | | | | | | | Add gtest and gtest_main libraries if we don't install gtest package in system Create a new message fillter config file when running gtest gateway shell script set type of control message is CONTROL_MESSAGE_ON_DEMAND when testing dlt_gateway_send_control_message function Signed-off-by: Le-Tin <Tin.Le@vn.bosch.com>
* lib: generate dlt library internal log fileLe-Tin2021-10-052-2/+12
| | | | | | | Extern logging_mode and logging_handle variables from commom.c Reusing dlt_log_init() in cases dlt library internal log file is not opened and logging_mode is DLT_LOG_TO_FILE Signed-off-by: Le-Tin <Tin.Le@vn.bosch.com>
* tests: add stdlib to dlt_cpp_extensionDarian Biastoch2021-10-051-0/+1
| | | | | | | | | Adding stdlib.h into dlt-test-cpp-extension.cpp solves the compile issue: dlt-test-cpp-extension.cpp:89:47: error: 'malloc' was not declared in this scope char *non_const_string = (char *)malloc(17); This occoured while building for QNX. Signed-off-by: Darian Biastoch <dbiastoch@de.adit-jv.com>
* dlt_user: Make dlt_init thread safeDarian Biastoch2021-10-051-5/+21
| | | | | | | | | | | | | This commit introduces the use of atomic_compare_exchange at beginning of both dlt_init functions. This function checks in an atomic way, if 'dlt_user_initialised' is 'false' (first run through dlt_init) and directly sets it 'true'. If a second thread also entered dlt-init at this point of time, its call of atomic_compare_exchange will return false and dlt_init will be immediately left due to that. This is only interesting for startup, because before each call of dlt_init, there is a check on 'dlt_user_initialised' that will fail for all later executions. Signed-off-by: Darian Biastoch <dbiastoch@de.adit-jv.com>
* remove clang-tidy analyzer warnings: incompatible pointer typeDarian Biastoch2021-10-051-50/+35
| | | | | | | | | | Removed duplicate "payload" pointer in dlt_client_send functions inside dlt_client.c. This pointer was only needed to avoid one cast within a function call. Now this cast is performed to get rid of clang-tidy analyzer warnings. In addition to that, malloc calls were replaced through calloc to avoid a subsequent memset with zero. Signed-off-by: Darian Biastoch <dbiastoch@de.adit-jv.com>
* debian: improve debian build packageDinh Cong Toan2021-10-052-3/+12
| | | | | | | | | | | | Currently, when building dlt debian package, our libdlt.so can not be linked to other binary consoles. Adding build option of dh_shlibdeps to specific the path of libdlt.so, and linking step should not be broken. With default enabling flag WITH_MAN in debian rules, pandoc package must be added in Build_Depends option for debian control. Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
* dlt-control-common: shutdown and close socketBui Nguyen Quoc Thanh2021-10-051-0/+9
| | | | | | | | Before cancelling the listening thread, try to shutdown and close the socket so that the listening thread is terminated intentionally Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* dlt_common: improve function descriptionDarian Biastoch2021-10-051-1/+11
| | | | | | | | The describtion of dlt_init_common was pretty meaningless, that's why an additional sentence and a list of all parsed evironment variables was added. Signed-off-by: Darian Biastoch <dbiastoch@de.adit-jv.com>
* gtest: Bring-in changesSaya Sugiura2021-10-054-28/+76
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* gtest: Rework WORKING_DIRECTORYSaya Sugiura2021-10-051-8/+5
| | | | | | | testfile.dlt was not detected correctly with ctest, so corrected WORKING_DIRECTORY accordingly. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* gtest: Correct data amount in gtest_dlt_commonSaya Sugiura2021-10-051-14/+18
| | | | | | | gtest_dlt_common was failing when ring buffer size was modified. Amount of data to be written is corrected in the test code. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* cmake: Set empty to systemd_SRCSSaya Sugiura2021-10-051-0/+2
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* gtest: Refactor tests/CMakeLists.txtSaya Sugiura2021-10-054-63/+72
| | | | | | | | This also removed following tests to more appropriate place: - dlt-test-preregister-context.c - dlt-test-cpp-extension.cpp Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* lib: Add SOCK_CLOEXEC to socketSaya Sugiura2021-10-051-1/+1
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* daemon: Create parent directory for unix socketSaya Sugiura2021-10-051-5/+19
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* cmake: Correct added subdirectoriesSaya Sugiura2021-10-052-2/+3
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* console: Add cmake options for control and timestampSaya Sugiura2021-10-052-14/+16
| | | | | | | | | | Following cmake options are introduced in order to build and install only minimum sets from src/console - WITH_DLT_CONSOLE_WO_CTRL: Set to ON not to build control commands under src/console (Default OFF) - WITH_DLT_CONSOLE_WO_SBTM: Set to ON not to build dlt-sortbytimestamp under src/console (Default OFF) Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* tests: Adapt to DLT_DISABLE_MACROSaya Sugiura2021-10-053-0/+6
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* header: Adapt to DLT_DISABLE_MACROSaya Sugiura2021-10-057-5/+14
| | | | | | | | | If dlt.h is included in external application, it needed to include -DDLT_DISABLE_MACRO to make ifdef switch work. This commit adds DLT_DISABLE_MACRO in dlt_user.h so that no additional definition is needed in application. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* include: Refactor CMakeLists.txtSaya Sugiura2021-10-051-10/+14
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* gtest: Change script name to gtest_dlt_daemon_offline_log.shSaya Sugiura2021-10-052-1/+1
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* daemon: Enable to use FIFO on QNXSaya Sugiura2021-10-053-6/+22
| | | | | | | | | | | | It depends on OSes if maximum size of pipe can be configured per process or not. For example, on QNX it can be only set from pipe resource manager. Also flags used to set the value are only supported on Linux. Now DaemonFIFOSize option in dlt.conf is only relevant for Linux. Also -f option is added to build scripts to enable FIFO as IPC. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* tests: Add new test case with given bufferSaya Sugiura2021-10-051-25/+235
| | | | | | | | | New test case is added in dlt-test-user to verify the behavior of dlt_user_log_write_start_w_given_buffer() and dlt_user_log_write_finish_w_given_buffer(). Currently macro usage is not supported, so empty test case is added for macro test. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* tests: Enable macro disablingSaya Sugiura2021-10-058-121/+156
| | | | | | | | | | This commit introduces new cmake option "WITH_DLT_DISABLE_MACRO" to disable macro usage in case it is not allowed. Currently this is adapted to src/tests and src/examples only. for dlt-test-non-verbose, the build itself is currently disabled if WITH_DLT_DISABLE_MACRO is set; this needs to be enabled again in future by replacing or adding function usage. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* lib: Add new interfaces with given bufferSaya Sugiura2021-10-053-31/+195
| | | | | | | | | | | | This commit adds new interfaces: - dlt_user_log_write_start_w_given_buffer(): accepts a log buffer as an input. - dlt_user_log_write_finish_w_given_buffer(): finalizes logging and send the message to corresponding output This is to reduce DLT API calls in DLT application as much as possible and avoid allocating dynamic memory within DLT library. The log buffer has to be prepared in DLT application in order to use these interfaces. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Implemention of tests for the dlt-qnx-system modulessugiura2021-10-054-0/+485
| | | | | | | | Following files are added to execute and verify the behavior of dlt-qnx-system module: - dlt-test-qnx-system: A test binary to send log messages to slogger2 with specific number of log messages, delay, and payload length. - start-qnx-system-test: A shell script to invoke the test execution and verify its result from received DLT log. Signed-Off By: Saya Sugiura <ssugiura@jp.adit-jv.com>
* lib: Add MaxFileSize handlingNarasimhaiah Suprathik (RBEI/ECF3)2021-10-055-11/+94
| | | | Signed-Off By: Saya Sugiura <ssugiura@jp.adit-jv.com>
* client: pthread_join for deinitBui Nguyen Quoc Thanh2021-10-051-0/+1
| | | | | | | | | | In case the client sends single request of control there could be a case the dlt_control_init finishes before the cancellation of receiver thread. So the main thread should wait for the receiver thread via pthread_join Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* doc: update initial log level documentDinh Cong Toan2021-10-051-6/+32
| | | | | | Updating initial log level document Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
* dlt-system: Fix memory leak in dlt-system configdbiastoch2021-10-054-33/+73
| | | | | | | | | | | | In read_configuration_file() inside dlt-system-options.c memory is allocated for saving the parsed options into config struct. This memory is not freed again. There are two major changes for resolving this issue: 1) Add a cleanup function inside dlt-system-options.c to free allocated memory 2) Replace all AppID and ContextID char pointer through a char array with the lenght of DLT_ID_SIZE. Signed-off-by: dbiastoch <dbiastoch@de.adit-jv.com>
* dlt_common: remove duplicate stdbool headerDinh Cong Toan2021-10-051-1/+0
| | | | | | | Remove duplicate stdbool.h file in dlt_common.c, which has been included in dlt_common.h Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
* dlt-control: Add option to config portSaya Sugiura2021-10-052-2/+16
| | | | | | | Add -p option to dlt-control so that IP port can be configured in case of TCP. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* system: use signalfd for dlt-systemBiastoch, Darian (ADITG/ESM)2021-10-0513-496/+512
| | | | | | | | | | | | 1: Move the call of pthread_sigmask in dlt-qnx-systems main before DLT_REGISTER_APP, because this already spawns a thread, what was done without applying pthread_sigmask before. 2: Replaced all threads in dlt-system, that are spawned for each feature, through one poll. This poll waits for a file descriptor event, that triggers the feature routine, that was executed before in the thread. Done this for following processes: * reading syslog and journal * frequently reading logfile and logprocess * triggering filetransfer, if a file was added/changed in watched directory * checking watchdog timer of systemd service file with defined intervall Signed-off-by: dbiastoch <dbiastoch@de.adit-jv.com>
* console: provides args option to enable send/receive serial headerVo Trung Chi2021-10-0517-52/+285
| | | | | | | Provides argument option to enable send and resync serial header via command line. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* fix malformed printf format strings (#295)Radek Kaczorowski2021-10-0510-134/+123
| | | Co-authored-by: Saya Sugiura <39760799+ssugiura@users.noreply.github.com>
* cmake: Set WITH_LEGACY_INCLUDE_PATH to ON as default (#334)Saya Sugiura2021-10-052-2/+2
| | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Make the legacy include path a CMake option (#332)Martin Willers2021-10-053-3/+19
| | | Signed-off-by: Martin Willers <M.Willers@gmx.net>