Wind River Support Network

HomeDefectsLIN1018-7591
Fixed

LIN1018-7591 : failed to load kernel modules for lttng

Created: Apr 24, 2021    Updated: Jul 22, 2021
Resolved Date: May 23, 2021
Found In Version: 10.18.44.21
Severity: Critical
Applicable for: Wind River Linux LTS 18
Component/s: Kernel

Description

For stable real time kernel > 4.9, the __migrate_disabled utility symbol
is not always exported. This can result in linking problem at build time
and runtime, preventing the loading of the tracer.

The problem was reported to the RT community. [1] [2]

A solution is to access the field directly instead of using the
utility wrapper.

It is important to note that the field is now available for other
configurations then only CONFIG_PREEMPT_RT_FULL. For now, we chose to
support only configuration where CONFIG_PREEMPT_RT_FULL is present.

Based on the configuration dependency of the kernels, selecting
CONFIG_PREEMPT_RT_FULL ensures the presence of the migrate_disable
field.

Initial bug report [3].

[1] [https://marc.info/?l=linux-rt-users&m=153730414126984&w=2]
[2] [https://marc.info/?l=linux-rt-users&m=153729444223779&w=2]
[3] [https://lists.lttng.org/pipermail/lttng-dev/2018-September/028216.html]

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
—
lttng-context-migratable.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lttng-context-migratable.c b/lttng-context-migratable.c
index bb44c65..e3d8ede 100644
— a/lttng-context-migratable.c
+++ b/lttng-context-migratable.c
@@ -31,7 +31,7 @@ void migratable_record(struct lttng_ctx_field *field,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
 - uint8_t migratable = !__migrate_disabled(current);
+ uint8_t migratable = !current->migrate_disable;

lib_ring_buffer_align_ctx(ctx, lttng_alignof(migratable));
chan->ops->event_write(ctx, &migratable, sizeof(migratable));
@@ -42,7 +42,7 @@ void migratable_get_value(struct lttng_ctx_field *field,
struct lttng_probe_ctx *lttng_probe_ctx,
union lttng_ctx_value *value)

{ - value->s64 = !__migrate_disabled(current); + value->s64 = !current->migrate_disable; }

int lttng_add_migratable_to_ctx(struct lttng_ctx **ctx)

Steps to Reproduce

Project configuration:
 Configuration change - --machine intel-x86-64 --distros wrlinux --dl-layers --all-layers --templates feature/target-toolchain,feature/gdb

add tools-profile EXTRA_IMAGE_FEATURES to enable lttng.
EXTRA_IMAGE_FEATURES ?= "debug-tweaks dev-pkgs tools-sdk tools-profile"

In compile log, error reported:
log.do_compile:108:WARNING: "__migrate_disabled" [/path/to/lts18-upstream/build/tmp-glibc/work/intel_x86_64-wrs-linux/lttng-modules/2.10.7-r0/lttng-modules-2.10.7/lttng-tracer.ko] undefined!
Live chat
Online