RTLA on Torizon RT kernel

Hello!

I am running a Torizon kernel with PREEMPT_RT patches on a SMARC i.MX95 SoM and Toradex carrier board. The cyclictest interrupt latency information was inadequate, so I would like to use rtla for deeper analysis. It looks like the timerlat, osnoise and hwnoise tracers are unavailable – the CONFIG_{TIMERLAT, OSNOISE, HWLAT}_TRACER kernel config options are not set. Is there a Torizon kernel with these options enabled, that supports rtla?

The Torizon reference images do not have a package manager. So, I have been attempting to run rtla in a privileged Docker container with adequate capabilities (SYS_ADMIN, SYS_RESOURCE) and a bind mount for /sys/kernel/tracing. Let me know if there is a better way to use rtla on Torizon.

Thanks!

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


RTLA Support on Torizon RT Kernel

Thank you for your detailed question about using RTLA on Torizon OS with PREEMPT_RT patches on your SMARC iMX95 module.

Current State of PREEMPT_RT Support

According to the documentation, Toradex provides PREEMPT_RT kernel support in an experimental state(1). The BSP Layers and Torizon OS distributions with the PREEMPT_RT patch haven’t been fully validated by Toradex - only smoke tests and cyclictest have been run to verify that the system boots properly and the PREEMPT_RT patches work under stressful conditions(1).

Toradex explicitly states: “We don’t guarantee any functionality and bug fixes” for PREEMPT_RT BSPs and images(1). Any tuning, additional kernel configuration, and validation of RT performance must be done at your discretion(1).

Available Torizon RT Distributions

For the SMARC iMX95, Torizon OS 7.x.y provides the torizon-rt distribution, which uses the downstream kernel from the SoC vendor with full preemption and the Linux PREEMPT_RT patch(2). However, there is no mention in the documentation of pre-configured kernels with the CONFIG_TIMERLAT_TRACER, CONFIG_OSNOISE_TRACER, or CONFIG_HWLAT_TRACER options enabled.

Building a Custom Kernel with RTLA Support

To enable RTLA support, you would need to build a custom Torizon OS image with the required kernel configuration options enabled. You can do this by:

  1. Building Torizon OS from source using Yocto Project/OpenEmbedded(2)
  2. Selecting the torizon-rt distribution for your SMARC iMX95 (MACHINE = toradex-smarc-imx95)(2)
  3. Modifying the kernel configuration to enable the tracer options you need

The documentation provides guidance on building external kernel modules(3) and customizing kernel arguments(4), which demonstrates the general approach to kernel customization in Torizon OS.

Your Docker Container Approach

Your approach of running RTLA in a privileged Docker container with SYS_ADMIN and SYS_RESOURCE capabilities and a bind mount for /sys/kernel/tracing is reasonable, assuming the kernel tracers are available. However, without the necessary kernel config options enabled, the tracers won’t be available regardless of how you run the userspace tools.

Recommendation

Since the standard Torizon RT images don’t include these tracer configurations, and given that PREEMPT_RT support is experimental, I recommend:

  1. Building a custom Torizon OS image from source with the required kernel configuration options enabled
  2. Sharing your use case on the Toradex Community so Toradex can better understand customer needs for RT analysis tools

Best regards,
Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Greetings @dmathew,

Our current policy regarding images with the PREEMPT_RT patch is as documented here: Real-Time Linux | Toradex Developer Center

That is to say, the level of support is not the same as our non PREEMPT_RT images. However, your use-case here seems reasonable to me. Allow me some time to bring this up with our team internally and we’ll see what we can do for you in this regard.

Best Regards,
Jeremias

Just to give an update here. Our team is willing to discuss this further internally to find the best path forward. No word yet on what conclusion we will land on though.

One follow-up question for you. Is there a rough timeline or deadline for when you’d want some kind of resolution regarding this? It helps with our own scheduling and priority if we could have this information.

Best Regards,
Jeremias

Hi Jeremias,

Thank you for your responses. I was able to customize the Torizon Yocto build to include rtla and the aforementioned kernel config options.

It would be ideal if Toradex were to start supporting Torizon builds with RT kernels for its products. Knowing that that’s unlikely, we will plan to proceed on our own with further configuration and tuning. We are trying to determine (by the end of the year) if the RT kernel’s latencies are low enough, or whether we need to rely on the Cortex-M core on the i.MX95.

Thanks,
Daniel

I’m glad to hear you were able to get a custom build going for testing purposes. Also, thank you for providing the additional information on your use-case and timeline. This is very helpful for our own discussions.

Best Regards,
Jeremias