| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-Off By: Saya Sugiura <ssugiura@jp.adit-jv.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Provides argument option to enable send and resync serial header
via command line.
Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
|
|
|
| |
Co-authored-by: Saya Sugiura <39760799+ssugiura@users.noreply.github.com>
|
|
|
| |
Signed-off-by: Martin Willers <M.Willers@gmx.net>
|
|
|
| |
As init_p2 does the offline trace initialization, load configuration should be called prior, as LoggingMode is set through run-timeconfiguration file. With original logic it results in offline trace write failed, it is not valid trace directory errors.
|
|
|
|
|
|
|
| |
Use POSIX thread API to rename the housekeeper and segmented threads.
The currently used prctl() function is Linux specific and in general not
available on other platforms (e.g. QNX).
Signed-off-by: Sebastian Lipponer <mail@sebastianlipponer.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the generated .pc file was changed to export an additional
include path such that '#include <dlt.h>' and '#include <dlt/dlt.h>' can
be used. However the exported CMake config file only supports the latter
include statement. Consequently code that uses the other legacy include
statement does not compile with the exported CMake config file.
This change fixes this inconsistency. It lets users compile existing
code with either the pkg-config .pc file or the CMake config file and
avoids code clutter that is currently necessary to make this work.
Signed-off-by: Sebastian Lipponer <mail@sebastianlipponer.de>
|
|
|
| |
According to AUTOSAR standard the TYLE for the BOOL type shall be set to 1. So I propose to initialize type_info variable for the BOOL type the same way as for uint8 type.
|
|
|
|
|
|
|
|
|
|
|
| |
If a file is deleted while a file transfer is ongoing,
the file transfer tries to seek through the whole file.
This is due to the fact the the file handle is held open.
getFileSerialNumber is already validating the file
by using stat.
If this call returns a negative value, we know
that a stat to the file is not possible anymore,
therefore further reading can be aborted.
|
|
|
|
|
|
| |
Fixing casting incorrect type
Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
|
|
|
|
|
|
| |
This commit removes duplicate conditional statements.
Signed-off-by: GwanYeong Kim <gy741.kim@gmail.com>
|
|
|
|
|
|
| |
This commit removes duplicate conditional statements.
Signed-off-by: GwanYeong Kim <gy741.kim@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-Werror=stringop-truncation
cd /build/dlt-daemon-2.18.7/obj-x86_64-linux-gnu/src/console/logstorage && /usr/bin/cc -DCONFIGURATION_FILES_DIR=\"/etc\" -DDLT_DAEMON_USE_FIFO_IPC -DDLT_LIB_USE_FIFO_IPC -DDLT_NETWORK_TRACE_ENABLE -DDLT_SYSTEMD_ENABLE -DDLT_SYSTEMD_JOURNAL_ENABLE -DDLT_UNIT_TESTS -DDLT_USER_IPC_PATH=\"/tmp\" -DDLT_USE_IPv6 -DEXTENDED_FILTERING -D_GNU_SOURCE -I/build/dlt-daemon-2.18.7 -I/build/dlt-daemon-2.18.7/obj-x86_64-linux-gnu/include/dlt -I/build/dlt-daemon-2.18.7/include/dlt -I/build/dlt-daemon-2.18.7/src/shared -I/build/dlt-daemon-2.18.7/src/core_dump_handler -I/build/dlt-daemon-2.18.7/src/offlinelogstorage -I/build/dlt-daemon-2.18.7/src/lib -I/build/dlt-daemon-2.18.7/src/daemon -I/build/dlt-daemon-2.18.7/src/console -I/build/dlt-daemon-2.18.7/src/gateway -I/build/dlt-daemon-2.18.7/systemd/3rdparty -g -O2 -ffile-prefix-map=/build/dlt-daemon-2.18.7=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Werror -std=gnu99 -Wall -Wextra -Wno-variadic-macros -Wno-strict-aliasing -o CMakeFiles/dlt-logstorage-ctrl.dir/__/dlt-control-common.c.o -c /build/dlt-daemon-2.18.7/src/console/dlt-control-common.c
make[3]: Leaving directory '/build/dlt-daemon-2.18.7/obj-x86_64-linux-gnu'
In file included from /usr/include/string.h:495,
from /build/dlt-daemon-2.18.7/src/console/dlt-control-common.c:56:
In function 'strncpy',
inlined from 'dlt_json_filter_load' at /build/dlt-daemon-2.18.7/src/console/dlt-control-common.c:716:13:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 4 equals destination size [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from 'dlt_json_filter_load' at /build/dlt-daemon-2.18.7/src/console/dlt-control-common.c:721:13:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 4 equals destination size [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
|
|
|
|
|
|
|
|
|
| |
In dlt_buffer_read_block() and dlt_buffer_write_block(), read/write position
should be updated in case these positions are equal to the size of ringbuffer.
Adding boundary check in gtest_dlt_common.cpp
Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
|
|
|
|
| |
Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
|
|
|
|
|
|
|
|
|
| |
This commit fixes to increment read and write point only if memcpy()
succeeded in dlt_buffer_read_block() and dlt_buffer_write_block().
Related issues: https://github.com/GENIVI/dlt-daemon/issues/305
Signed-off-by: Sugiura, Saya <ssugiura@jp.adit-jv.com>
|
|
|
|
|
|
|
| |
Several verbose condition in dlt_client.c are using printf() and fprintf()
that not print consistent logs to console. These are replaced by dlt-vlog().
Signed-off-by: KHANH LUONG HONG DUY khanh.luonghongduy@vn.bosch.com
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improve logstorage to sync logs from cache to all connected
mount point when option -s with empty path is used.
E.g: dlt-logstorage-ctrl -s
Logstorage should accept a white space " " after option -s.
E.g: dlt-logstorage-ctrl -s /tmp/
Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
|
|
|
|
|
|
|
|
| |
When processing dlt_user_log_send_log() function, message logs will be stored in
internal buffer in error case. Then, the error value is needed to handle correctly
before exiting.
Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
| |
Currently, when config IPv6 interface for dlt component,
using syslog in dlt-system can not get data from socket.
By changing struct type and interface configuration correctly,
dlt-syslog can receive log from syslog properly.
Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
|
|
|
|
|
|
|
| |
json-c dependency was removed from libdlt ('dlt_common') and shifted into 'dlt-control-common'. By this only the command line tools have a dependency on json-c.
dlt-control-common is now built as a static library, so that it can be linked against json-c. Command line tools that included only the .c file of dlt-control-common before, are now linked against this static libarary (see console/CMakeLists.txt).
Signed-off-by: dbiastoch <dbiastoch@de.adit-jv.com>
|
|
|
|
|
|
|
|
| |
dlt_common.c:
-Check if filter file fits into read buffer
-Cast 'filename' into non-const to make it json-c API conform
Signed-off-by: dbiastoch <dbiastoch@de.adit-jv.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the initial implementation of timer_thread, the signals
SIGUSR1 is blocked and only checked via sigpending.
There will be an issue if the interval of timers are quite long.
It could cause the main thread waits for a long time in case of
termination gratefully.
Fix: let the timer_thread be interrupted by signal SIGUSR1 and
handle it properly then.
Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
|
|
|
|
|
|
| |
Apply uncrustify for src/daemon/* and src/lib/*
Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-Added '-j' flag to dlt-receive for reading a json filter file
-Added more attributes to DltFilter (LogLevel, MaxPayload, MinPayload) for extended message filtering, when using old filters these values are set to default. Same behaviour, when they are not defined in json filter file.
-extended dlt_common.c to support json filter files and new DltFilter attributes
+add dlt_json_filter_load to parse a json filter file into a DltFilter
+add dlt_json_filter_save to print a DltFilter into a json file
-Two new libraries are used to parse the json filter files: json-c for Linux based systems and the QNX internal libjson for QNX systems
-gtest_dlt_common was modified to test the new function 'dlt_json_filter_load'
+add testfile_extended.dlt that contains a bigger varity of messages (different context/app IDs, lengths and log levels)
+add testfilter.json which is a valid json filter file
-New dependency on library was added to related CMakeLists and is described in README.md
Signed-off-by: dbiastoch <dbiastoch@de.adit-jv.com>
|
|
|
|
|
|
|
| |
- When declare a sigaction structure to handle signal, it should be
initialized by 0 to set other fields in struct to default, which is more safety.
Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit is to revert the following commits:
- de4a4234
- fb9ff078
- db9917b3
- e4467f0e
- a567e01d
Those commits are from improvement but they seem to
break the dlt message header in some cases.
Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
|
|
|
| |
Signed-off-by: Martin Willers <M.Willers@gmx.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Make Non-Verbose mode non-exclusive
Switching to global Non-Verbose mode now does not force Verbose messages to
also be sent as Non-Verbose ones anymore. That would not make any sense,
because Verbose messages don't have a MessageId and thus are all getting
the same MessageId of 65535.
Instead, setting global "Non-Verbose" mode will allow both Verbose and
Non-Verbose messages to be sent in a single session.
The "Verbose-APIs" (e.g. dlt_user_log_write_start()) will then only write
Verbose messages, whereas the "Non-Verbose APIs" (e.g. dlt_user_log_write_start_id())
will then only write Non-Verbose messages.
Signed-off-by: Martin Willers <M.Willers@gmx.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The configuration of memory buffer size must be carefully
parsed and validated to avoid segmentation fault
Any misleading information in configuration file must be
considered as major error and dlt-daemon should stop
and raise error message to stderr
This commit also corrects error handling of
dlt_buffer_init_dynamic().
Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Create and install proper CMake *-target.cmake and *-config.cmake files,
for use by other CMake-using projects.
It installs a file called automotive-dlt-targets.cmake into a common
location for such files, namely
<prefix>/lib/cmake/automotive-dlt/automotive-dlt-targets.cmake
They can now call find_package(automotive-dlt) and obtain a target
called Genivi::dlt that they can link against with target_link_libraries(),
by which they automatically gain all necessary attributes, including libdlt's
include directories.
Signed-off-by: Martin Willers <M.Willers@gmx.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the bytes of a RAWD argument were be printed onto the console
as space-separated hex values, making it difficult or impossible to see
where the RAWD argument ends and the next argument starts. For instance,
with code like this:
dlt_user_log_write_raw(&ctxData, "data", 4);
dlt_user_log_write_uint8(&ctxData, 53);
the console output is shown as:
[64 61 54 61 53]
and there is no indication that there are two arguments, one RAWD and
one UINT8.
This patch changes for console formatting of RAW data to separate by
apostrophs, making the above message appear as:
[64'61'54'61 53]
This makes it immediately obvious that there is a RAWD argument, and
still keeps the separators quite unobtrusive.
Signed-off-by: Martin Willers <M.Willers@gmx.net>
|
|
|
| |
Co-authored-by: FIXED-TERM Kaczorowski Radoslaw (BSOT/PJ-ES21) <Fixed-Term.Radoslaw.Kaczorowski@bosch-softtec.com>
|
|
|
| |
Signed-off-by: Alexander Mohr <git@mohr.io>
|
|
|
|
|
|
| |
dlt_user_log_write_*_attr() enables to writing these types, but also support
adding "attributes" for them, i.e. a "name" and a "unit".
Signed-off-by: Martin Willers <M.Willers@gmx.net>
|
|
|
|
|
|
|
| |
CVE: CVE-2020-29394
Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
Co-authored-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
|
|
|
|
|
|
| |
security-wise dlt pip(FIFO) should be exclusively readable only by owner not the dlt group
to prevent eavesdropping by clients
Signed-off-by: Mostafa Emami <mustafaemami@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DLT Client code (#284)
Issue:
------
dlt_client_main_loop currently uses an infinite loop ("while (1)"). This
creates problems when a DLT client is running in a thread as part of a larger
application. Graceful exit (for example: during object destruction) is not
possible because a thread is running dlt_client_main_loop in the background.
It is also not possible to exit the client, if we want it to fetch only a
pre-decided number of messages.
Solution:
---------
Allow user to define a callback function to check whether the next message
should be fetched.
dlt-test-client.c has a new option to fetch a pre-decided number of messages,
after which the client will exit.
Signed-off-by: Sreeharsha Ramanavarapu <sreeharsha.r@gmail.com>
|
|
|
|
|
|
|
|
| |
- Checking size of buffer and size of message before using memcpy().
- Adding configuration file for testfilter in /tests/CMakeLists.txt.
Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
|
|
|
|
|
|
|
|
| |
-It's now possbile to enter a custom app and context ID by using the new
implemented "-A" and "-C" arguments.
-Also added a markdown manual in the doc directory for dlt-example-user.
Signed-off-by: dbiastoch <dbiastoch@de.adit-jv.com>
|
|
|
|
|
|
|
|
|
|
|
| |
- Converting datatype to the correct one.
- As macro do not perform type-checking before, so these functions used
it with different datatype could create a lot of conversion warnings.
For this reason, these warnings could be consider as normal
information and will not be fixed.
Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Change the data type of variable 'size' in DltContextData struct
(dlt_user.h.in). Variable 'size' was used repeated with function
'sizeof()' many time, so change type to 'size_t' can avoid a lot of
warnings.
- Adding temporary variable to calculate the datasize header (define in
dlt_common.h) in 'dlt_common.c' file.
Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <Toan.DinhCong@vn.bosch.com>
|
|
|
|
|
|
| |
- Casting data type to the right format.
Signed-off-by: Dinh Cong Toan <Toan.DinhCong@vn.bosch.com>
|