| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Add function dlt_execute_command() to execute system command using
execvp.
Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to disable injection message at dlt user,
set DLT_DISABLE_INJECTION_MSG_AT_USER to any value.
When injection message is disabled, libdlt won't poll
any data from receiver. It means libdlt will ignore all
data/messages from dlt-daemon.
By default, variable is unset so that dlt users are able to
handle data/messages from dlt-daemon.
Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For more information about VSOCK, see "man vsock"
( https://man7.org/linux/man-pages/man7/vsock.7.html ).
Makes it possible for processes in a virtual machine to log directly in
DLT running on host without setting up a network connection between
guest and host. It is also probably more efficient. Have not done any
performance measurements (not main reason for patch), but no forwarding
is required as when running DLT in a multi-node setup.
When building dlt-daemon for host, WITH_DLT_DAEMON_VSOCK_IPC should be
enabled for daemon to listen on incoming VSOCK requests. Local
communication method between applications and daemon is still determined
with DLT_IPC. When building for guest, WITH_DLT_LIB_VSOCK_IPC should be
enabled and DLT_IPC will be ignored, which will make libdlt open a VSOCK
socket to the deamon for logging messages.
VSOCK can be tested without a virtual machine. Since VMADDR_CID_HOST is
used by libdlt when connecting, see vsock man page, clients can be run
on host to test VSOCK communication.
Some modifications has been done to be able to handle logging through
FIFO pipe and socket in the same build of dlt-daemon:
- dlt_receiver_init/free_unix_socket() is renamed to
dlt_receiver_init/free_global_buffer() and used for FIFO as well.
Also fixes memory leak since dlt_receiver_free_unix_socket() was used
regardless of whether DLT_USE_UNIX_SOCKET was defined or not.
- Pass type to dlt_receiver_init() instead of dlt_receiver_receive().
And remove preprocessor conditionals for handling
DLT_CONNECTION_APP_MSG in dlt_daemon_process_user_messages(). Also
fixes wrong enum type being passed to dlt_receiver_receive() in
dlt_client.c (DltClient::mode was used as a DltReceiverType enum but
it is a DltClientMode enum).
- Add a flag to DltDaemonApplication to indicate whether file descriptor
is "owned" by the DltDaemonApplication or not. When
dlt_daemon_application_add() is called due to message received on a
socket, fd is passed as an argument (app does not own fd). For FIFO,
a per application FIFO is opened (app owns the fd). Also fixes so that
user handle is reset for both application and all its contexts when
resetting any. Prevents fd from being used by accident after it has
been closed.
dlt_mkdir_recursive() is moved to src/daemon since it is only used in
the daemon. Minimizes use of DLT_USE_UNIX_SOCKET_IPC.
Other bugfixes:
- Call DLT_SEM_FREE() if setting socket to O_NONBLOCK fails in
src/lib/dlt_user.c:dlt_initialize_socket_connection().
- Close socket if dlt_receiver_init() fails in
src/lib/dlt_user.c:dlt_initialize_socket_connection().
Signed-off-by: Martin Ejdestig <martin.ejdestig@volvocars.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For a 4-chars CTXID, i.e. one that does not include a null character,
the strlen() calls were happily accessing memory until they eventually
encountered a null character somewhere in memory.
This was detected by valgrind, which reported a memory error when
using a CTXID such as "INTM":
==21924== Conditional jump or move depends on uninitialised value(s)
==21924== at 0x4C30F78: strlen (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21924== by 0x4E4B5A0: dlt_print_id (dlt_common.c:303)
==21924== by 0x4E4CF47: dlt_message_header_flags (dlt_common.c:687)
==21924== by 0x4E51434: dlt_message_print_ascii (dlt_common.c:3169)
==21924== by 0x4E4247A: dlt_user_print_msg (dlt_user.c:4108)
==21924== by 0x4E46D92: dlt_user_log_send_log (dlt_user.c:3670)
==21924== by 0x4E46F14: dlt_user_log_write_finish (dlt_user.c:1611)
Sanitize some code
Using memset() and memcpy() is always preferable to hand-rolled loops,
because compilers have built-in support for them.
Signed-off-by: Martin Willers <M.Willers@gmx.net>
|
|
|
|
|
|
|
|
|
| |
* Add UDP multicast support on client side
UDP multicast support is already present on server side. This
patch add seemless support for UDP multicast on client side
in dlt-receive.
Signed-off-by: Joao Sousa <joao.sa.sousa@ctw.bmwgroup.com>
|
|
|
|
|
| |
Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dlt_common
- Add preprocessor DLT_USE_UNIX_SOCKET_IPC for dlt_log_set_fifo_basedir() and
dltFifoBaseDir variable
- Rename input parameter of dlt_log_set_fifo_basedir()
dlt-daemon
- Replace setting dltFifoBaseDir by dlt_log_set_fifo_basedir() and add preproc
DLT_USE_UNIX_SOCKET_IPC
- Update -h opt and flags.loggingFilename based on IPC type
Signed-off-by: LUONG HONG DUY KHANH(RBVH/ENG42) <KHANH.LUONGHONGDUY@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Some components which links dlt seem to depend on following headers,
which will be included by mqueue.h.
- sys/types.h
- fcntl.h
So explicitly include them if mqueue interface is not supported in
dlt_user.h. Also two headers are removed if dlt_used.h is included.
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
|
|
|
|
|
|
|
|
|
|
| |
There is some OS (e.g. Android) which doesn't support message queue.
Since network trace uses it as IPC, we need to disable it if following
calls are not available:
mq_open, mq_close, mq_unlink, mq_send, mq_receive
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
|
|
|
|
|
|
| |
Introduce new API to support quick parsing a DLT file.
Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
- daemon: New feature for LoggingMode at /etc/dlt.conf to be able to
set value at 3 in order to redirect all stdout messages to stderr.
- libdlt: New feature for DLT_LOG_MODE environment variable to be able
to set value at 3 in order to redirect all stdout messages to stderr.
- unit test: Add test cases for DLT_LOG_TO_STDERR
Signed-off-by: LUONG HONG DUY KHANH(RBVH/ENG42) <KHANH.LUONGHONGDUY@vn.bosch.com>
|
|
|
|
|
| |
Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
|
|
|
|
|
| |
Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
|
|
|
|
| |
Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
|
|
|
|
|
| |
Signed-off-by: Felix Herrmann <external.Felix.Herrmann3@de.bosch.com>
Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
|
|
|
|
| |
Signed-off-by: Martin Willers <M.Willers@gmx.net>
|
|
|
|
| |
Signed-off-by: Martin Willers <M.Willers@gmx.net>
|
|
|
|
|
|
|
| |
The GNU preprocessor supports naming of the variadic macro parameter,
but not preprocessors does.
Signed-off-by: Ted Lyngmo <ted@lyncon.se>
|
|
|
|
|
|
|
|
|
|
|
| |
missing include for pthread_t reference:
see https://errors.yoctoproject.org/Errors/Details/308000/ for details
Thanks Khem Raj <raj.khem@gmail.com> for the report
Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Symptome: If access to the trace directory is not
granted by AppArmor access(...) still reports otherwise.
dlt_offline_trace_get_total_size(...)
tries to open the dir via opendir(...) and tries a
readdir without any further check, which results in an
SEGFAULT
* Solution: (1) Make dlt_offline_trace_get_total_size return
ssize_t instead of unsigned long, which gives us a
chance to return an error state (2) Check the return value
from opendir(...) and bail out on error. Use this to return
DLT_RETURN_ERROR in dlt_offline_trace_check_size.
* ToDo: (1) Error state is not yet checked and reported
back. On Error we just don't generate any offline
log files without any further complain. (2) Find a replacement
for access(...) which reports properly under AppArmor.
(3) Report the confusing behaviour of access(...) to the
AppArmor team.
Signed-off-by: Sebastian Kloska <seebastian.kloska@snafu.de>
|
|
|
|
|
|
|
|
|
| |
The use of this macro in a if condition is actually non-standard C++
code. GCC issues a warning that ISO C++ forbids braced-groups within
expressions when compiled with -Wpedantic. Other compilers fail with an
error. Change the macro to an internal function in order to improve the
portability to other platforms (i.e. MSVC, proprietary embedded).
Signed-off-by: Sebastian Lipponer <mail@sebastianlipponer.de>
|
|
|
| |
Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
|
|
|
|
|
|
|
|
| |
Fix the issue that DLT offline trace creating mutiple files
even after reaching MaxTrace size when filename is index based.
Related to: https://github.com/GENIVI/dlt-daemon/pull/174
Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
|
|
|
|
|
|
|
|
|
| |
* Avoided Seg fault in dlt_message_payload (#179)
Avoided Seg fault by adding boundary check before buffer access.
Signed-off-by: Ravi Sankar P <ponnurangamravi.sankar@in.bosch.com>
Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
|
|
|
|
|
|
|
| |
The function dlt_offline_trace_file_name() use sizeof the
pointer as the maximum file name size, so it cannot create
the file name as expected.
Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
|
|
|
|
| |
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The fix from commit 376bf6c is considered as a workaround.
From now, the resend buffer size is calculated based on
(dlt_user.log_buf_len + header_size)
- Remove the macro DLT_USER_EXTRA_BUFF_SIZE
- Use env_disable_extended_header_for_nonverbose instead of
env_nonverbose_extended_header
Related commit: 376bf6c Size of Resend buffer less than or equal to DLT_USER_BUF_MAX_SIZE res… (#116)
Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
|
|
|
|
|
|
|
|
| |
dlt-control command is extended to send get software version control
message.
e.g: dlt-control -k localhost
Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two new macros are introduced so that users can use their customized
timestamps for DLT messages:
- DLT_LOG_TS(CONTEXT, LOGLEVEL, TS, ARGS ...)
- DLT_LOG_ID_TS(CONTEXT, LOGLEVEL, MSGID, TS, ARGS ...)
Detailed explanations can be found in dlt_for_developers.md.
Also a new option is added to dlt-system to use events' timestamps
from journald adapter.
Signed-off-by: Sebastian Unger <sunger@de.adit-jv.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the possibility to have in dlt.conf an option that specifies a set
of IP addresses. The daemon will do a socket bind only for this list,
therefore external connections will be limited to this set of IP
addresses. If this option is not given, the default INADDR_ANY is used
("0.0.0.0") as before.
The option in dlt.conf can look like this:
BindAddress = 160.48.199.98;160.48.199.97;160.48.199.226,160.48.199.186;160.48.199.139;172.16.222.99
There can be as many addresses but only specified on one single line.
They have to be delimited by ',' or ';'. ' ' (space) delimiter does
not work. IPv6 addresses are supported as well. For instance:
BindAddress = fe80::255:7bff:feb5:7df7
IPv6 addresses are acceptable only if DLT_USE_IPv6 flag is ON at
compile time. IPv4 addresses are acceptable only if DLT_USE_IPv6 flag is
OFF at compile time. One cannot have both IPv4 and IPv6 format in the
same time.
Signed-off-by: Adrian Stoenescu Adrian.Stoenescu@harman.com
|
|
|
|
|
|
|
|
|
|
| |
With this commit, following DLT user service IDs are now free to use:
- 0xF0A
- 0xF0F to 0xFFE
Also the cases in dlt_daemon_client_process_control() is reordered so
that it matches the order of dlt_user_services enum.
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
|
|
|
|
|
| |
Replace all Linux specific shared memory APIs with POSIX alternatives.
Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
|
|
|
|
| |
This reverts commit e8716cc5c950e50411b23a7a6cafa3c063c59e90.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the possibility to have in dlt.conf an option that specifies a set
of IP addresses. The daemon will do a socket bind only for this list,
therefore external connections will be limited to this set of IP
addresses. If this option is not given, the default INADDR_ANY is used
("0.0.0.0") as before.
The option in dlt.conf can look like this:
BindAddress = 160.48.199.98;160.48.199.97;160.48.199.226,160.48.199.186;160.48.199.139;172.16.222.99
There can be as many addresses but only specified on one single line.
They have to be delimited by ',' or ';'. ' ' (space) delimiter does
not work. IPv6 addresses are supported as well. For instance:
BindAddress = fe80::255:7bff:feb5:7df7
IPv6 addresses are acceptable only if DLT_USE_IPv6 flag is ON at
compile time. IPv4 addresses are acceptable only if DLT_USE_IPv6 flag is
OFF at compile time. One cannot have both IPv4 and IPv6 format in the
same time.
Signed-off-by: Adrian Stoenescu Adrian.Stoenescu@harman.com
|
|
|
|
|
|
|
| |
The variables used for application id and context id are aligned with
"apid" and "ctid".
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
|
|
|
|
| |
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
|