| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Instead of casting frequently, change the data type of 'to_remove' to
'uint32_t' for the correct format, also adding temp variable to check
return value.
- Change data type of 2 variable 'offset' and 'sizecont' to 'size_t'
(dlt_daemon_client.c), because these variable using many time with
function 'sizeof', and they was used as local variable so it will not
effect dlt library.
Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
|
| |
- Data type of 'textlength' create a lot of warnings while using in
function 'snprintf()', so change data type to 'size_t' will resolve
these warnings.
- Change data type of variable 'size' to the right type 'unsigned int',
which is located in struct DltBuffer in dlt_common.h (line 832).
Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Some functions like 'strncmp()', 'strncat()', 'strcpy()'
and 'memcpy()' take an argument in type 'size_t',
so explicit data type to 'size_t' in this case is needed to avoid
conversion warnings.
- Function 'strlen' return data type 'size_t', which still need to cast
data type
Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <Toan.DinhCong@vn.bosch.com>
|
|
|
|
|
|
| |
- Explicit type conversion from 'signed' to 'unsigned'
Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <Toan.DinhCong@vn.bosch.com>
|
|
|
|
|
|
|
|
|
| |
- Correct the data type of 'headersize' and 'datasize' variables in
header 'dlt_common.h', then config those functions using this library.
- Explicit the data type.
Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <Toan.DinhCong@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
|
| |
When dlt-receive logs is redirecting to file then a terminating signal
is sent to dlt-receive, it will stop without flushing all logs from
stdout to file, due to the default size of stdout is 4096 byte.
When dlt-receive receive the SIGTERM or SIGINT, it flushes stdout buffer
to stdout before terminating.
Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Runtime log level setting from dlt-viewer or dlt-control doesn't work
when logstorage is enabled.
Adding MaintainLogstorageLogLevel=ON/OFF to [General] session of
dlt_logstorage.conf to keep the current behaviour (=ON or 1 or not
defined), or allow to change log level from dlt-viewer or dlt-control
when the logstorage is enabled (=OFF or 0).
Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
|
|
|
|
|
|
|
|
| |
Since order of runtime config load for app-ctx and dlt-runtime
are different from each other, so they could not be in the same
load_runtime function.
Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
|
|
|
|
|
|
|
| |
Since bionic does not support pthread_cancel(),
try to terminate housekeeper thread via SIGUSR1.
Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The issue happens in case:
dlt_logstorage.conf is set available at startup via dlt.conf
and both LogAppName and ContextName are wildcard.
In such a case, when logstorage disconnection happens,
dlt-daemon is missing a check for case in which both are
wildcard.
It causes the reset loglevel is not happening.
Then the control message to change loglevel will be
handled incorrectly.
Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
|