Skip to content

Commit

Permalink
Logstorage changes (#525)
Browse files Browse the repository at this point in the history
* lib: Introduce WITH_LIB_NO_VERSION cmake option

Signed-off By: Saya Sugiura <[email protected]>

* logstorage: optional index and stop mode

adds options to imitate libdlt file logging with offlinelogstorage:
- optional index when NOFiles == 1 e.g.: APID.dlt
- disable ringbuffer for specific filters: OverwriteBehavior=DISCARD_NEW
  this stops the automatic removal of the oldest messages.

Also contains:
- some fixes for memcheck findings about usage of uninitialized memory.
- cmake coverage target and option can be used to generate a html report
    about the code coverage by the ctest tests.

Signed-off-by: Felix Herrmann <[email protected]>

* logstorage: Open file on correct cache size

In case of ON_SPECIFIC_SIZE sync strategy, the file was not opened on
correct cache size, so the file size was smaller than defined even
next log messages can fit there.

Signed-off-by: Saya Sugiura <[email protected]>

* logstorage: Test all sync strategies

All sync strategies are verified in logstorage component test.
To make it work, following adaptions are also done:
- dlt-logstorage-control: Add option to specify dlt.conf path

Signed-off-by: Saya Sugiura <[email protected]>

* Offline-Logstorage - Skip the file when prepare fails

This change allows to append directory path in File option in dlt_logstorage.conf (e.g. File=path/Filename).
If path does not exist and file preparation fails, it will try up to DLT_OFFLINE_LOGSTORAGE_MAX_ERRORS
times (=5 times) If it reaches the maximum, that file will be skipped from next trial so that the daemon does
not try to prepare file under non-existing directory every time the log message is received.

Signed-off By: Saya Sugiura <[email protected]>

* logstorage: Add internal function to store config

Signed-off-by: Saya Sugiura <[email protected]>

* cfg: make multiple config mechanism avaiable in logstorage

Signed-off-by: Felix Herrmann <[email protected]>

* logstorage: Add max cache size test case

Signed-off By: Matthias Dangers <[email protected]>

* logstorage: Add debug and details log messages

Signed-off By: Saya Sugiura <[email protected]>

* logstorage: Add option to disable network routing in DLT Daemon, when only file is configured

If the option is enabled in dlt_logstorage,conf, routing to network will
be disabled if the corresponding key (APID:CTID:ECUID) is available in
logstorage. For ecucfg, if network is not set to log mode, routing to
network will be disabled.

Signed-off-by: Saya Sugiura [email protected]

* Resolve compile warnings

Signed-off-by: Saya Sugiura <[email protected]>

* logstorage: Correctly calculate logstorage cache

Signed-off-by: Saya Sugiura <[email protected]>

* logstorage:update remain file size

In CACHE_BASED strategy, the current write offset file
should be updated only if the it is less than configured size

Signed-off-by: Bui Nguyen Quoc Thanh <[email protected]>

* LogStorage: Call fsync() before fclose() for ON_MSG sync strategy

To sync buffer to file, fsync() is called before fclose() on ON_MSG.

Signed-off-by: Saya Sugiura <[email protected]>

* logstorage: Change path of MessageFilterConfigFile in dlt.conf

Set value of configured file_size for checking logstorage file synchronization

Clean the created DLT files on every test cases

Dlt-daemon cannot run when testing with CTest under source folder due to path of MessageFilterConfigFile is incorrect

Change relative path of MessageFilterConfigFile to absolute path in dlt.conf.in

Signed-off-by: Le Tin <[email protected]>

* logstorage:incorrect type of index

The variable type of index should not be unsigned
if it is possible to be negative.
Otherwise, the validation will be wrong

Signed-off-by: Bui Nguyen Quoc Thanh <[email protected]>

---------

Signed-off-by: Felix Herrmann <[email protected]>
Signed-off-by: Saya Sugiura <[email protected]>
Signed-off-by: Saya Sugiura [email protected]
Signed-off-by: Bui Nguyen Quoc Thanh <[email protected]>
Signed-off-by: Le Tin <[email protected]>
Co-authored-by: Saya Sugiura <[email protected]>
Co-authored-by: Felix Herrmann <[email protected]>
Co-authored-by: Matthias Dangers <[email protected]>
Co-authored-by: Bui Nguyen Quoc Thanh <[email protected]>
Co-authored-by: Le Tin <[email protected]>
  • Loading branch information
6 people authored Sep 1, 2023
1 parent 22d394f commit 4ed1b97
Show file tree
Hide file tree
Showing 66 changed files with 2,764 additions and 252 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ include/dlt/dlt_user.h
cmake-build-debug/
.vscode/
googletest/

# exclude temporary files
cscope.out
*.swp
30 changes: 15 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,20 @@ set(DLT_USER "covesa"
set(DLT_QNX_SLOG_ADAPTER_WAIT_BUFFER_TIMEOUT_MS "100"
CACHE STRING "Timeout in milliseconds to wait before messages are dropped when input buffer is full")

option(WITH_DLT_PKGCONFIG "Set to ON to generate pkgconfig .pc files" ON)
option(WITH_DLT_CXX11_EXT "Set to ON to build C++11 extensions" OFF)
option(WITH_DLT_COREDUMPHANDLER "EXPERIMENTAL! Set to ON to build src/core_dump_handler binaries. EXPERIMENTAL" OFF)
option(WITH_DLT_LOGSTORAGE_CTRL_UDEV "PROTOTYPE! Set to ON to build logstorage control with udev support" OFF)
option(WITH_DLT_LOGSTORAGE_GZIP "Set to ON to build logstorage control with gzip compression support" OFF)
option(WITH_DLT_USE_IPv6 "Set to ON for IPv6 support" ON)
option(WITH_DLT_KPI "Set to ON to build src/kpi binaries" OFF)
option(WITH_DLT_FATAL_LOG_TRAP "Set to ON to enable DLT_LOG_FATAL trap(trigger segv inside dlt-user library)" OFF)
option(WITH_UDP_CONNECTION "Set to ON to enable dlt UDP multicast SUPPORT" OFF)
option(WITH_LIB_SHORT_VERSION "Set to ON to build library with only major number in version" OFF)
option(WITH_DLT_DISABLE_MACRO "Set to ON to build code without Macro interface support" OFF)
option(WITH_LEGACY_INCLUDE_PATH "Set to ON to add <prefix>/dlt to include paths
for the CMake config file, in addition to only <prefix>" ON)
option(WITH_EXTENDED_FILTERING "Set to OFF to build without extended filtering.
Json filter only supports Linux based system with json-c and QNX" OFF)
option(WITH_DLT_PKGCONFIG "Set to ON to generate pkgconfig .pc files" ON)
option(WITH_DLT_CXX11_EXT "Set to ON to build C++11 extensions" OFF)
option(WITH_DLT_COREDUMPHANDLER "EXPERIMENTAL! Set to ON to build src/core_dump_handler binaries. EXPERIMENTAL" OFF)
option(WITH_DLT_LOGSTORAGE_CTRL_UDEV "PROTOTYPE! Set to ON to build logstorage control application with udev support" OFF)
option(WITH_DLT_LOGSTORAGE_GZIP "Set to ON to build logstorage control application with gzip compression support" OFF)
option(WITH_DLT_USE_IPv6 "Set to ON for IPv6 support" ON)
option(WITH_DLT_KPI "Set to ON to build src/kpi binaries" OFF)
option(WITH_DLT_FATAL_LOG_TRAP "Set to ON to enable DLT_LOG_FATAL trap(trigger segv inside dlt-user library)" OFF)
option(WITH_UDP_CONNECTION "Set to ON to enable dlt UDP multicast SUPPORT" OFF)
option(WITH_LIB_NO_VERSION "Set to ON to build library without any version" OFF)
option(WITH_LIB_SHORT_VERSION "Set to ON to build library with only major number in version" OFF)
option(WITH_DLT_DISABLE_MACRO "Set to ON to build code without Macro interface support" OFF)
option(WITH_LEGACY_INCLUDE_PATH "Set to ON to add <prefix>/dlt to include paths for the CMake config file, in addition to only <prefix>" ON)
option(WITH_EXTENDED_FILTERING "Set to OFF to build without extended filtering. Using json filter files is only supported for Linux based system with json-c and QNX." OFF)

option(WITH_DLT_DAEMON_VSOCK_IPC "Set to ON to enable VSOCK support in daemon" OFF)
option(WITH_DLT_LIB_VSOCK_IPC "Set to ON to enable VSOCK support in library (DLT_IPC is not used in library)" OFF)
Expand Down Expand Up @@ -473,6 +472,7 @@ message(STATUS "DLT_VSOCK_PORT = ${DLT_VSOCK_PORT}")
message(STATUS "WITH_UDP_CONNECTION = ${WITH_UDP_CONNECTION}")
message(STATUS "WITH_DLT_QNX_SYSTEM = ${WITH_DLT_QNX_SYSTEM}")
message(STATUS "WITH_DLT_NETWORK_TRACE = ${WITH_DLT_NETWORK_TRACE}")
message(STATUS "WITH_LIB_NO_VERSION = ${WITH_LIB_NO_VERSION}")
message(STATUS "WITH_LIB_SHORT_VERSION = ${WITH_LIB_SHORT_VERSION}")
message(STATUS "WITH_LEGACY_INCLUDE_PATH = ${WITH_LEGACY_INCLUDE_PATH}")
message(STATUS "WITH_EXTENDED_FILTERING = ${WITH_EXTENDED_FILTERING}")
Expand Down
Loading

0 comments on commit 4ed1b97

Please sign in to comment.