| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the logstorage device cannot be disconnected if "/" is
appended at the end of path.
For example:
int dlt.conf, the configuration is:
OfflineLogstorageDirPath = /var/log/dlt_raw
Then the control message as below won't work.
"dlt-logstorage-ctrl -c 0 -p /var/log/dlt_raw/"
The fix is to get the information the requested mount point via
stat() to ensure the path of connected/disconnected control messages
are validated properly.
Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
|
|
|
|
|
|
|
| |
There is no timerfd_create in QNX so try to use threads to sleep and
notify to main thread via unamed pipes.
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>
|
|
|
|
|
|
| |
A new option named "InjectionMode" allows to select if
we want to enable / disable the feature
Signed-off-by: Sebastien RAILLET <sebastien.raillet@marelli.com>
|
|
|
|
|
|
| |
Change warning to error, as it will abort the daemon startup.
Also reduce the amount of follow up error messages.
Signed-off-by: Moritz Warning <moritzwarning@web.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
see bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=957140
/usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_client.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here
/usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_common.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: multiple definition of `g_logstorage_cache_size'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: first defined here
/usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_common.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here
/usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_connection.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: multiple definition of `g_logstorage_cache_size'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: first defined here
/usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_connection.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here
/usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_event_handler.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: multiple definition of `g_logstorage_cache_size'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: first defined here
/usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_event_handler.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here
/usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_offline_logstorage.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here
Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
|
|
|
|
| |
Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
|
|
|
|
|
|
|
|
| |
update client buffer overflow counter in send function.
Gather all overflow checks into dlt_daemon_client.
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- In existing implementation, control message "message_buffer_overflow"
is sent for every incoming message which is dropped since buffer is full.
So UDP and logstorage will receive a lot of these messages.
That could be considered as unnecessary.
- In order to reduce the useless effort to send "message_buffer_overflow"
for every missing message, daemon will only send it out
right after buffer is full or right after real client is connected.
Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
|
|
|
|
|
|
|
|
|
| |
- Introduce "General" section for dlt_gateway.conf
- In new section, the interval is used for gateway timer.
This entry is optional. By default, it is set to 1 second
as the existing hardcoded value.
Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
|
|
|
|
| |
Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
|
|
|
|
|
|
|
|
|
| |
snprintf returns the size the resulting string would take.
In order to detect truncation, this size needs to be
checked against the buffer size.
Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
|
|
|
|
|
|
|
|
|
| |
Many stringop-truncation and stringop-overflow warnings are still
there (so many).
https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/
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 <fherrmann@de.adit-jv.com>
|
|
|
|
|
|
|
| |
New empty line was generated from daemon internal log because of '\n'.
This is removed from daemon internal log and added to dlt_vlog().
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
|
|
|
|
|
|
|
|
| |
`dlt_daemon_log_internal` is called with with a null `local_str`.
This has been introduced by mistake during a code refactoring.
Code has been reverted to the previous version:
https://github.com/GENIVI/dlt-daemon/commit/bfa7026b355db32d91374997cc86b56fedc3e861
Signed-off-by: Francesco Montefoschi <francesco.montefoschi@artgroup-spa.com>
|
|
|
|
|
|
|
|
|
| |
poll.h being included directly.
This fixes a build failure on musl systems with strict c hardening flags
Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are some warnings while running dlt-daemon:
$dlt-daemon
Unknown option: UDPConnectionSetup=1
Unknown option: UDPMulticastIPAddress=225.0.0.37
Unknown option: UDPMulticastIPPort=3491
cause the WITH_UDP_CONNECTION is not enabled by default (c9d1ba4b).
The configuration for this feature should be sync.
Signed-off-by: Phong Tran <tranmanphong@gmail.com>
|
|
|
|
|
|
|
| |
CID 351398 (#1 of 1): Use after close (USE_AFTER_FREE)
8. pass_closed_arg: Passing closed handle *sock as an argument to dlt_daemon_socket_get_send_qeue_max_size
Signed-off-by: Phong Tran <tranmanphong@gmail.com>
|
|
|
|
|
|
|
| |
return without close the file descriptor.
reported by Resource leak (RESOURCE_LEAK)
Signed-off-by: Phong Tran <tranmanphong@gmail.com>
|
|
|
| |
Signed-off-by: Sebastian Lipponer <mail@sebastianlipponer.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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: sunil.s <sunil.s@lge.com>
|
|
|
|
| |
Signed-off-by: Sebastian Kloska <sebastian.kloska@snafu.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Symptom: no offline trace file gets created
even if runtime config LoggingMode==(2|3).
* Reason: runtime config gets read *after*
offline logging setup.
* Solution: Read runtime config *before*
offline logging setup.
* Make the "read runtime config" function
set a proper default value for logging mode
instead if the *_init_* function setting up
the logging.
Signed-off-by: Sebastian Kloska <sebastian.kloska@snafu.de>
|
|
|
|
|
|
| |
Since localtime() was calling tzset() internally, it should be used
before localtime_r(). Refer to man page of localtime_r() for detail.
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
|
|
|
|
| |
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
|
|
|
|
|
|
|
|
| |
After dlt-client connects to dlt-daemon successfully, all the stored
dlt messages in daemon was not flushed to dlt client when using shared
memory as IPC. It is harmonized with dlt_daemon_process_user_message_log().
Signed-off-by: Vo Trung Chi <chi.votrung@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>
|
|
|
|
|
|
|
| |
The errno must be saved in order to use with dlt_vlog()
because the errno will be overwriten in dlt_vlog().
Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
|
|
|
|
|
|
|
| |
The default INADDR_ANY is used ("0.0.0.0") as before.
But it's invalid when DLT_USE_IPv6 flag ON.
Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
|