Skip to content

Commit

Permalink
cmake: disable network trace
Browse files Browse the repository at this point in the history
Add cmake toggle to disable network trace.
Disable network trace for QNX and yocto.
Deactivate DLT_TRACE_NETWORK_SEGMENTED macro
via an empty dlt_user_trace_network_segmented
function to support someip build.

Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
  • Loading branch information
danielweber2018 authored and alexmohr committed Apr 25, 2023
1 parent 0c1c75e commit ee116a2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ option(WITH_TESTSCRIPTS "Set to ON to run CMakeLists.txt in testscripts"
option(WITH_GPROF "Set -pg to compile flags" OFF)
option(WITH_DLTTEST "Set to ON to build with modifications to test User-Daemon communication with corrupt messages" OFF)
option(WITH_DLT_SHM_ENABLE "EXPERIMENTAL! Set to ON to use shared memory as IPC. EXPERIMENTAL!" OFF)
option(WITH_DLT_ADAPTOR "Set to ON to build src/adaptor binaries" OFF)
option(WITH_DLT_ADAPTOR "Set to ON to build src/adaptor binaries" OFF)
option(WITH_DLT_ADAPTOR_STDIN "Set to ON to build src/adaptor/stdin binaries" OFF)
option(WITH_DLT_ADAPTOR_UDP "Set to ON to build src/adaptor/udp binaries" OFF)
option(WITH_DLT_CONSOLE "Set to ON to build src/console binaries" ON)
Expand Down Expand Up @@ -360,6 +360,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_DLT_USE_EPOLL = ${WITH_DLT_USE_EPOLL}")
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
22 changes: 22 additions & 0 deletions src/lib/dlt_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -3465,6 +3465,28 @@ DltReturnValue dlt_user_trace_network_truncated(DltContext *handle,

return DLT_RETURN_OK;
}
#else /* DLT_NETWORK_TRACE_ENABLE not set */
DltReturnValue dlt_user_trace_network_segmented(DltContext *handle,
DltNetworkTraceType nw_trace_type,
uint16_t header_len,
void *header,
uint16_t payload_len,
void *payload)
{
/**
* vsomeip uses the DLT_TRACE_NETWORK_SEGMENTED macro that calls this function.
* It's not possible to rewrite this macro directly to a no-op,
* because the macro is used on vsomeip side and there our defines are not set.
* Add an empty function to the dlt-lib to avoid a broken build.
*/
(void)handle;
(void)nw_trace_type;
(void)header_len;
(void)header;
(void)payload_len;
(void)payload;
return DLT_RETURN_OK;
}
#endif /* DLT_NETWORK_TRACE_ENABLE */

DltReturnValue dlt_log_string(DltContext *handle, DltLogLevelType loglevel, const char *text)
Expand Down

0 comments on commit ee116a2

Please sign in to comment.