<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/tools/tracing/rtla/src, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>rtla: Simplify osnoise tracer option setting code</title>
<updated>2026-09-30T11:26:57+00:00</updated>
<author>
<name>Tomas Glozar</name>
<email>tglozar@redhat.com</email>
</author>
<published>2026-09-29T14:29:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5ddc4497508a628b6c18653a0d5208edc6228aaf'/>
<id>5ddc4497508a628b6c18653a0d5208edc6228aaf</id>
<content type='text'>
Each osnoise tracer option (in /sys/kernel/tracing/osnoise) used by RTLA
requires four functions to be defined:

- static osnoise_get_&lt;opt&gt;() - to get the current value of the option
  and save it into struct osnoise_context's orig_&lt;opt&gt; field,
- osnoise_set_&lt;opt&gt;() - to set the value of the option requested by the
  user after reading and saving the original with osnoise_get_&lt;opt&gt;(),
  and save it into &lt;opt&gt; field of struct osnoise_context,
- osnoise_restore_&lt;opt&gt;() - restore the value recorded in orig_&lt;opt&gt;,
- static osnoise_put_&lt;opt&gt;() - restore the value recorded in orig_&lt;opt&gt;
  and update &lt;opt&gt; to reflect that.

The logic is duplicated for all the options, except for cpus (which is
the only string option) and period/runtime (which are handled together
and feature extra checks).

Deduplicate by moving the common code in get/set/restore/put into common
helper functions local to osnoise.c. The original set/restore/put
functions are reduced to wrappers generated using a set of X macros:

- OSNOISE_LL_OPTIONS, which invokes the OSNOISE_LL_OPTION macro for all
  "long long" options,
- OSNOISE_FLAG_OPTIONS, which invokes the OSNOISE_FLAG_OPTION macro for
  all flag options (boolean values in osnoise/options file).

Those are also used to auto-generate the corresponding fields in struct
osnoise_context, plus initialization and restoration code for them.

There are a few minor changes in the refactored code:

- osnoise_set_&lt;opt&gt;() now distinguishes between -2 (option cannot be
  set) and -1 (option not present in kernel) for all options.
- OSNOISE_OPTION_INIT_VAL and OSNOISE_TIME_INIT_VAL are removed and
  replaced with a plain -1; all unsigned long long fields are changed to
  signed long long, consistent with pre-existing "%lld" format string in
  osnoise_write_ll_config().
- osnoise_restore_&lt;opt&gt;() now correctly resets the &lt;opt&gt; field (not
  orig_&lt;opt&gt;) for all options.

The change is intended to simplify adding and modifying tracer options.
It also makes the code shorter by a bit over 500 lines.

Assisted-by: Claude:claude-opus-4-6
Link: https://lore.kernel.org/r/20260929142944.1841462-1-tglozar@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Each osnoise tracer option (in /sys/kernel/tracing/osnoise) used by RTLA
requires four functions to be defined:

- static osnoise_get_&lt;opt&gt;() - to get the current value of the option
  and save it into struct osnoise_context's orig_&lt;opt&gt; field,
- osnoise_set_&lt;opt&gt;() - to set the value of the option requested by the
  user after reading and saving the original with osnoise_get_&lt;opt&gt;(),
  and save it into &lt;opt&gt; field of struct osnoise_context,
- osnoise_restore_&lt;opt&gt;() - restore the value recorded in orig_&lt;opt&gt;,
- static osnoise_put_&lt;opt&gt;() - restore the value recorded in orig_&lt;opt&gt;
  and update &lt;opt&gt; to reflect that.

The logic is duplicated for all the options, except for cpus (which is
the only string option) and period/runtime (which are handled together
and feature extra checks).

Deduplicate by moving the common code in get/set/restore/put into common
helper functions local to osnoise.c. The original set/restore/put
functions are reduced to wrappers generated using a set of X macros:

- OSNOISE_LL_OPTIONS, which invokes the OSNOISE_LL_OPTION macro for all
  "long long" options,
- OSNOISE_FLAG_OPTIONS, which invokes the OSNOISE_FLAG_OPTION macro for
  all flag options (boolean values in osnoise/options file).

Those are also used to auto-generate the corresponding fields in struct
osnoise_context, plus initialization and restoration code for them.

There are a few minor changes in the refactored code:

- osnoise_set_&lt;opt&gt;() now distinguishes between -2 (option cannot be
  set) and -1 (option not present in kernel) for all options.
- OSNOISE_OPTION_INIT_VAL and OSNOISE_TIME_INIT_VAL are removed and
  replaced with a plain -1; all unsigned long long fields are changed to
  signed long long, consistent with pre-existing "%lld" format string in
  osnoise_write_ll_config().
- osnoise_restore_&lt;opt&gt;() now correctly resets the &lt;opt&gt; field (not
  orig_&lt;opt&gt;) for all options.

The change is intended to simplify adding and modifying tracer options.
It also makes the code shorter by a bit over 500 lines.

Assisted-by: Claude:claude-opus-4-6
Link: https://lore.kernel.org/r/20260929142944.1841462-1-tglozar@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtla/osnoise: Trace IPI events when recording a trace file</title>
<updated>2026-09-29T10:23:11+00:00</updated>
<author>
<name>Valentin Schneider</name>
<email>vschneid@redhat.com</email>
</author>
<published>2026-09-02T12:39:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cf89b1086d51f260ecd8e95000ef341fb167db3c'/>
<id>cf89b1086d51f260ecd8e95000ef341fb167db3c</id>
<content type='text'>
IPIs can now be monitored and accounted by osnoise top. When that is
the case, also record them when saving a trace file.

To match what is being recorded by the tool for its own analysis, event
filters are applied to the events recorded to the trace output.

Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-9-vschneid@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
IPIs can now be monitored and accounted by osnoise top. When that is
the case, also record them when saving a trace file.

To match what is being recorded by the tool for its own analysis, event
filters are applied to the events recorded to the trace output.

Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-9-vschneid@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtla: Unconditionally clean any pre-existing filters for user-provided events</title>
<updated>2026-09-29T10:23:11+00:00</updated>
<author>
<name>Valentin Schneider</name>
<email>vschneid@redhat.com</email>
</author>
<published>2026-09-02T12:39:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=20e92ac8c189049d9f72d60fdf1562a42cc82357'/>
<id>20e92ac8c189049d9f72d60fdf1562a42cc82357</id>
<content type='text'>
A later commit will apply a filter to events recorded to the trace
output. To prevent any user confusion, remove pre-existing filters when
enabling an event provided via the '-e' command line argument.

Suggested-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-8-vschneid@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A later commit will apply a filter to events recorded to the trace
output. To prevent any user confusion, remove pre-existing filters when
enabling an event provided via the '-e' command line argument.

Suggested-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-8-vschneid@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtla: Enable and disable events in the user-defined order</title>
<updated>2026-09-29T10:23:11+00:00</updated>
<author>
<name>Valentin Schneider</name>
<email>vschneid@redhat.com</email>
</author>
<published>2026-09-02T12:39:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4dc85eb58a1ab972392b53eb8e999e72263bc708'/>
<id>4dc85eb58a1ab972392b53eb8e999e72263bc708</id>
<content type='text'>
Events are processed in LIFO order for ease of internal processing, but
this is can be confusing to users if the processing ordering is exposed to
them.

A following commit will do just that by making it so the last-defined event
options (filters/triggers) overrides any previous options for that same
event. Thus, process the events in the user-defined order.

Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-7-vschneid@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Events are processed in LIFO order for ease of internal processing, but
this is can be confusing to users if the processing ordering is exposed to
them.

A following commit will do just that by making it so the last-defined event
options (filters/triggers) overrides any previous options for that same
event. Thus, process the events in the user-defined order.

Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-7-vschneid@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtla: Make struct trace_events double linked</title>
<updated>2026-09-29T10:21:31+00:00</updated>
<author>
<name>Valentin Schneider</name>
<email>vschneid@redhat.com</email>
</author>
<published>2026-09-02T12:39:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2f13964b436912ef1b22ba8b946ad1355159c13d'/>
<id>2f13964b436912ef1b22ba8b946ad1355159c13d</id>
<content type='text'>
The events list is currently a single linked list. New events are prepended
to the list, making them the new head.

This makes it easy to fetch the last-defined event when handling trigger
and filter options on the cmdline, as they apply to the last-defined event,
but means the events are then processed in LIFO order with regards to the
command line order.

To prepare for processing the events in the user-defined order, make the
events list double linked.

Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-6-vschneid@redhat.com
[ capital letter in commit message ]
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The events list is currently a single linked list. New events are prepended
to the list, making them the new head.

This makes it easy to fetch the last-defined event when handling trigger
and filter options on the cmdline, as they apply to the last-defined event,
but means the events are then processed in LIFO order with regards to the
command line order.

To prepare for processing the events in the user-defined order, make the
events list double linked.

Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-6-vschneid@redhat.com
[ capital letter in commit message ]
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtla/osnoise: Allow IPI filters to gracefully fail</title>
<updated>2026-09-22T11:42:03+00:00</updated>
<author>
<name>Valentin Schneider</name>
<email>vschneid@redhat.com</email>
</author>
<published>2026-09-02T12:39:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=edbb1d2671f5219c2801dd006c6ad664914b98a0'/>
<id>edbb1d2671f5219c2801dd006c6ad664914b98a0</id>
<content type='text'>
Kernels pre v6.6 won't have:

  39f7c41c908b ("tracing/filters: Enable filtering a cpumask field by another cpumask")

and thus won't be able to filter events using a user-provided cpumask, but
will still be capable of recording IPI events.

Make failing to set a filter for IPI events an acceptable error and fall
back to event handlers that do the filtering job themselves.

Suggested-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-5-vschneid@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Kernels pre v6.6 won't have:

  39f7c41c908b ("tracing/filters: Enable filtering a cpumask field by another cpumask")

and thus won't be able to filter events using a user-provided cpumask, but
will still be capable of recording IPI events.

Make failing to set a filter for IPI events an acceptable error and fall
back to event handlers that do the filtering job themselves.

Suggested-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-5-vschneid@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtla/osnoise: Leverage IPI event filters when tracing a subset of CPUs</title>
<updated>2026-09-22T11:42:03+00:00</updated>
<author>
<name>Valentin Schneider</name>
<email>vschneid@redhat.com</email>
</author>
<published>2026-09-02T12:39:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9ca6a1662b68c1d7500157446906a8ebf149001d'/>
<id>9ca6a1662b68c1d7500157446906a8ebf149001d</id>
<content type='text'>
Leverage the kernel event filtering infrastructure to only emit IPI events
if they target CPUs that are being traced, as specified by the -c cmdline
option.

Note that some post-processing is still required for the ipi_send_cpumask
event, as the event being emitted means *some* CPUs targeted by that event
are monitored, but not all of them - userspace has to recompute that
intersection.

Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-4-vschneid@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Leverage the kernel event filtering infrastructure to only emit IPI events
if they target CPUs that are being traced, as specified by the -c cmdline
option.

Note that some post-processing is still required for the ipi_send_cpumask
event, as the event being emitted means *some* CPUs targeted by that event
are monitored, but not all of them - userspace has to recompute that
intersection.

Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-4-vschneid@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtla/osnoise: Record IPI count in osnoise top</title>
<updated>2026-09-22T11:42:03+00:00</updated>
<author>
<name>Valentin Schneider</name>
<email>vschneid@redhat.com</email>
</author>
<published>2026-09-02T12:39:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e24c047993703439061aa9a7a0ae34c8118b812c'/>
<id>e24c047993703439061aa9a7a0ae34c8118b812c</id>
<content type='text'>
Leverage the ipi_send_cpu and ipi_send_cpumask trace events to record the
count of IPIs sent to monitored CPUs. These interferences are already
accounted by the IRQ count, but this split gives a better overall picture.

This uses the newly added --ipi cmdline option.

Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-3-vschneid@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Leverage the ipi_send_cpu and ipi_send_cpumask trace events to record the
count of IPIs sent to monitored CPUs. These interferences are already
accounted by the IRQ count, but this split gives a better overall picture.

This uses the newly added --ipi cmdline option.

Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-3-vschneid@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtla/osnoise: Add IPI tracking cmdline option</title>
<updated>2026-09-22T11:42:03+00:00</updated>
<author>
<name>Valentin Schneider</name>
<email>vschneid@redhat.com</email>
</author>
<published>2026-09-02T12:39:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2ff4464e328346f15e1f2e40b376e8999aec9cfa'/>
<id>2ff4464e328346f15e1f2e40b376e8999aec9cfa</id>
<content type='text'>
Later commits will add IPI tracking to osnoise top. To avoid breaking
existing scripts, this new feature will be gated behind a new --ipi option.

Suggested-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-2-vschneid@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Later commits will add IPI tracking to osnoise top. To avoid breaking
existing scripts, this new feature will be gated behind a new --ipi option.

Suggested-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
Signed-off-by: Valentin Schneider &lt;vschneid@redhat.com&gt;
Link: https://lore.kernel.org/r/20260902123942.695822-2-vschneid@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtla: Abort on nr_cpus mismatch with tracer</title>
<updated>2026-09-22T11:41:41+00:00</updated>
<author>
<name>Tomas Glozar</name>
<email>tglozar@redhat.com</email>
</author>
<published>2026-08-14T13:55:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b105ffc19d5e53058cba68a9b8b7915216f0bf46'/>
<id>b105ffc19d5e53058cba68a9b8b7915216f0bf46</id>
<content type='text'>
In rare situations, sysfs might report a different number of CPUs than
the kernel sees, for example, when /sys is not real sysfs.

In tracefs mode, RTLA will discard any samples that are reported on CPUs
higher than the maximum in sysfs. However, in BPF mode, the incorrectly
sized BPF_MAP_LOOKUP_ELEM syscall on percpu maps will cause a buffer
overflow.

To cover for this corner case, write "all" to osnoise/cpus, and read
back the real kernel-side list of all possible cpus. If it doesn't match
RTLA's nr_cpus (read from sysfs), abort with an error.

Assisted-by: Claude:claude-opus-4-6
Link: https://lore.kernel.org/r/20260814135511.2207190-4-tglozar@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In rare situations, sysfs might report a different number of CPUs than
the kernel sees, for example, when /sys is not real sysfs.

In tracefs mode, RTLA will discard any samples that are reported on CPUs
higher than the maximum in sysfs. However, in BPF mode, the incorrectly
sized BPF_MAP_LOOKUP_ELEM syscall on percpu maps will cause a buffer
overflow.

To cover for this corner case, write "all" to osnoise/cpus, and read
back the real kernel-side list of all possible cpus. If it doesn't match
RTLA's nr_cpus (read from sysfs), abort with an error.

Assisted-by: Claude:claude-opus-4-6
Link: https://lore.kernel.org/r/20260814135511.2207190-4-tglozar@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
