From 55d24aeb41b2b4bfd5f5f83fc8619fe3c0ce5dc4 Mon Sep 17 00:00:00 2001 From: manuelfehlhammer Date: Mon, 20 Apr 2026 17:24:27 +0200 Subject: [PATCH 1/3] use typed-mem feature flag To decide, whether typed-mem should be used in case of IPC-tracing, now the corresponding feature flag is consulted. --- score/mw/com/impl/bindings/lola/BUILD | 4 ++++ .../bindings/lola/skeleton_memory_manager.cpp | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/score/mw/com/impl/bindings/lola/BUILD b/score/mw/com/impl/bindings/lola/BUILD index 66ed7c89fc..c7d37eef7e 100644 --- a/score/mw/com/impl/bindings/lola/BUILD +++ b/score/mw/com/impl/bindings/lola/BUILD @@ -364,6 +364,10 @@ cc_library( implementation_deps = [ "//score/mw/com/impl/bindings/lola/tracing:tracing_runtime", ], + local_defines = select({ + "@score_baselibs//score/analysis/tracing/generic_trace_library/flags:require_typed_memory": ["REQUIRE_TYPED_MEMORY"], + "//conditions:default": [], + }), tags = ["FFI"], visibility = [ "//score/mw/com/impl/bindings/lola/test:__pkg__", diff --git a/score/mw/com/impl/bindings/lola/skeleton_memory_manager.cpp b/score/mw/com/impl/bindings/lola/skeleton_memory_manager.cpp index ef77cb61e5..b75f3ac721 100644 --- a/score/mw/com/impl/bindings/lola/skeleton_memory_manager.cpp +++ b/score/mw/com/impl/bindings/lola/skeleton_memory_manager.cpp @@ -702,7 +702,13 @@ bool SkeletonMemoryManager::CreateSharedMemoryForData( } const auto path = shm_path_builder_.GetDataChannelShmName(lola_instance_id_); +#ifdef REQUIRE_TYPED_MEMORY + // We only use "typed memory", if REQUIRE_TYPED_MEMORY (set by the GTL) and IPC tracing is enabled/configured, which + // we can deduce from register_shm_object_trace_callback being set. const bool use_typed_memory = register_shm_object_trace_callback.has_value(); +#else + constexpr bool use_typed_memory = false; +#endif const memory::shared::SharedMemoryFactory::UserPermissions user_permissions = ((permissions.empty()) && (!lola_service_instance_deployment.strict_permissions_)) ? memory::shared::SharedMemoryFactory::WorldReadable{} @@ -720,17 +726,17 @@ bool SkeletonMemoryManager::CreateSharedMemoryForData( return false; } data_storage_path_ = path; - if (register_shm_object_trace_callback.has_value() && memory_resource->IsShmInTypedMemory()) + const auto is_tracing_enabled_for_shm_object = register_shm_object_trace_callback.has_value(); + const auto is_typed_memory_required_and_successful_allocated = + use_typed_memory && memory_resource->IsShmInTypedMemory(); + if (is_tracing_enabled_for_shm_object && (is_typed_memory_required_and_successful_allocated || !use_typed_memory)) { - // only if the memory_resource could be successfully allocated in typed-memory, we call back the - // register_shm_object_trace_callback, because only then the shm-object can be accessed by tracing - // subsystem. // Since LoLa creates shm-objects on the granularity of whole service-instances (including ALL its service // elements), we call register_shm_object_trace_callback once and hand over a dummy element name/type! // Other bindings, which might create shm-objects per service-element would call // register_shm_object_trace_callback for each service-element and then use their "real" name and type ... - // Suppress "AUTOSAR C++14 A15-4-2" rule finding. This rule states: "I a function is declared to be - // , (true) or (), then it shall not exit with an exception" + // Suppress "AUTOSAR C++14 A15-4-2" rule finding. This rule states: "If a function is declared to be + // noexcept, noexcept(true) or noexcept(), then it shall not exit with an exception" // we can't add to score::cpp::callback signature. // coverity[autosar_cpp14_a15_4_2_violation] register_shm_object_trace_callback.value()( From abb1825fd1630a312685f645ed062cd533718d4a Mon Sep 17 00:00:00 2001 From: devendrapatil Date: Thu, 10 Sep 2026 14:49:36 +0530 Subject: [PATCH 2/3] Add new alias use_typed_memory --- MODULE.bazel | 5 +---- score/mw/com/impl/bindings/lola/BUILD | 2 +- score/mw/com/impl/bindings/lola/flags/BUILD | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 score/mw/com/impl/bindings/lola/flags/BUILD diff --git a/MODULE.bazel b/MODULE.bazel index 024b0d86b9..471c43a96c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -30,17 +30,14 @@ bazel_dep(name = "score_qnx_unit_tests", version = "0.2.0") bazel_dep(name = "score_baselibs", version = "0.2.12") single_version_override( module_name = "score_baselibs", - commit = "c533b52aa6eca94ebae2a1b7406da34c7c5c9f87", patch_strip = 1, # Patch baselibs with a QNX8 workaround for poll # until a fix is provided by the QNX SDP # See https://github.com/eclipse-score/bazel_cpp_toolchains/issues/68 patches = ["//third_party/score_baselibs:restore_qnx8_poll_workaround.patch"], - remote = "https://github.com/devendrapat/baselibs.git", ) - -bazel_dep(name = "score_bazel_platforms", version = "1.0.0") +bazel_dep(name = "score_bazel_platforms", version = "1.1.0") bazel_dep(name = "score_crates", version = "0.0.11", repo_name = "score_communication_crate_index") download_archive = use_repo_rule("@download_utils//download/archive:defs.bzl", "download_archive") diff --git a/score/mw/com/impl/bindings/lola/BUILD b/score/mw/com/impl/bindings/lola/BUILD index c7d37eef7e..b3276f85da 100644 --- a/score/mw/com/impl/bindings/lola/BUILD +++ b/score/mw/com/impl/bindings/lola/BUILD @@ -365,7 +365,7 @@ cc_library( "//score/mw/com/impl/bindings/lola/tracing:tracing_runtime", ], local_defines = select({ - "@score_baselibs//score/analysis/tracing/generic_trace_library/flags:require_typed_memory": ["REQUIRE_TYPED_MEMORY"], + "//score/mw/com/impl/bindings/lola/flags:use_typed_memory": ["REQUIRE_TYPED_MEMORY"], "//conditions:default": [], }), tags = ["FFI"], diff --git a/score/mw/com/impl/bindings/lola/flags/BUILD b/score/mw/com/impl/bindings/lola/flags/BUILD new file mode 100644 index 0000000000..8a551c692d --- /dev/null +++ b/score/mw/com/impl/bindings/lola/flags/BUILD @@ -0,0 +1,19 @@ +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +alias( + name = "use_typed_memory", + actual = "@score_baselibs//score/analysis/tracing/generic_trace_library/flags:require_typed_memory", + visibility = [ + "//visibility:public", + ] +) From a9d1ebc4c01163a6bb024856ef7ea05f39e872b0 Mon Sep 17 00:00:00 2001 From: devendrapatil Date: Fri, 11 Sep 2026 13:20:11 +0530 Subject: [PATCH 3/3] Remove alias flag use_typed_memory from lola binding --- score/mw/com/impl/bindings/lola/BUILD | 2 +- score/mw/com/impl/bindings/lola/flags/BUILD | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 score/mw/com/impl/bindings/lola/flags/BUILD diff --git a/score/mw/com/impl/bindings/lola/BUILD b/score/mw/com/impl/bindings/lola/BUILD index b3276f85da..c7d37eef7e 100644 --- a/score/mw/com/impl/bindings/lola/BUILD +++ b/score/mw/com/impl/bindings/lola/BUILD @@ -365,7 +365,7 @@ cc_library( "//score/mw/com/impl/bindings/lola/tracing:tracing_runtime", ], local_defines = select({ - "//score/mw/com/impl/bindings/lola/flags:use_typed_memory": ["REQUIRE_TYPED_MEMORY"], + "@score_baselibs//score/analysis/tracing/generic_trace_library/flags:require_typed_memory": ["REQUIRE_TYPED_MEMORY"], "//conditions:default": [], }), tags = ["FFI"], diff --git a/score/mw/com/impl/bindings/lola/flags/BUILD b/score/mw/com/impl/bindings/lola/flags/BUILD deleted file mode 100644 index 8a551c692d..0000000000 --- a/score/mw/com/impl/bindings/lola/flags/BUILD +++ /dev/null @@ -1,19 +0,0 @@ -# ******************************************************************************* -# Copyright (c) 2025 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0 -# -# SPDX-License-Identifier: Apache-2.0 -# ******************************************************************************* -alias( - name = "use_typed_memory", - actual = "@score_baselibs//score/analysis/tracing/generic_trace_library/flags:require_typed_memory", - visibility = [ - "//visibility:public", - ] -)