<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/tools/tracing, 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/tests: Add $SUBTESTS and $STOPONFAIL</title>
<updated>2026-09-30T11:26:31+00:00</updated>
<author>
<name>Crystal Wood</name>
<email>crwood@redhat.com</email>
</author>
<published>2026-09-19T06:27:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=adbf92c8b5dd11e172d84b74b61c66434396906a'/>
<id>adbf92c8b5dd11e172d84b74b61c66434396906a</id>
<content type='text'>
Give the user more control over the test execution when the test scripts
are run directly (not through prove), in order to do things like run a
particular test repeatedly to diagnose an intermittent failure.

If $SUBTESTS is provided, then only tests whose number is on the list will
run.  For example:

  # SUBTESTS="14 133 4 $(seq 98 103) 9" bash ./tests/timerlat.t
  1..150
  ok 4 - top verify -s/--stack
  ok 9 - hist set the automatic trace mode
  ok 14 - top disable auto-analysis
  ok 98 - hist verify -H/--house-keeping
  ok 99 - top verify -k/--kernel-threads
  ok 100 - hist verify -k/--kernel-threads
  ok 101 - top verify -u/--user-threads
  ok 102 - hist verify -u/--user-threads
  ok 103 - apply default timerlat_period_us
  ok 133 - top trace output through --on-threshold trace

If $STOPONFAIL is set, then the script will exit with a non-zero exit code
on the first failure.  If the output directory is non-empty, it will be
preserved, and the location shown.

Signed-off-by: Crystal Wood &lt;crwood@redhat.com&gt;
Link: https://lore.kernel.org/r/20260919062756.819701-4-crwood@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>
Give the user more control over the test execution when the test scripts
are run directly (not through prove), in order to do things like run a
particular test repeatedly to diagnose an intermittent failure.

If $SUBTESTS is provided, then only tests whose number is on the list will
run.  For example:

  # SUBTESTS="14 133 4 $(seq 98 103) 9" bash ./tests/timerlat.t
  1..150
  ok 4 - top verify -s/--stack
  ok 9 - hist set the automatic trace mode
  ok 14 - top disable auto-analysis
  ok 98 - hist verify -H/--house-keeping
  ok 99 - top verify -k/--kernel-threads
  ok 100 - hist verify -k/--kernel-threads
  ok 101 - top verify -u/--user-threads
  ok 102 - hist verify -u/--user-threads
  ok 103 - apply default timerlat_period_us
  ok 133 - top trace output through --on-threshold trace

If $STOPONFAIL is set, then the script will exit with a non-zero exit code
on the first failure.  If the output directory is non-empty, it will be
preserved, and the location shown.

Signed-off-by: Crystal Wood &lt;crwood@redhat.com&gt;
Link: https://lore.kernel.org/r/20260919062756.819701-4-crwood@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtla/tests: Show the command line for failing tests</title>
<updated>2026-09-30T11:26:31+00:00</updated>
<author>
<name>Crystal Wood</name>
<email>crwood@redhat.com</email>
</author>
<published>2026-09-19T06:27:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7e3fb693a179821999affc1aea3e66aa84927dd6'/>
<id>7e3fb693a179821999affc1aea3e66aa84927dd6</id>
<content type='text'>
Make investigating test failures a little bit easier by not having
to recreate the command line by looking in the test script.

Unfortunately, this doesn't capture variables set outside of the
command line, but it's better than nothing.

Signed-off-by: Crystal Wood &lt;crwood@redhat.com&gt;
Link: https://lore.kernel.org/r/20260919062756.819701-3-crwood@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>
Make investigating test failures a little bit easier by not having
to recreate the command line by looking in the test script.

Unfortunately, this doesn't capture variables set outside of the
command line, but it's better than nothing.

Signed-off-by: Crystal Wood &lt;crwood@redhat.com&gt;
Link: https://lore.kernel.org/r/20260919062756.819701-3-crwood@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtla/tests: Use absolute path for $RTLA</title>
<updated>2026-09-30T11:26:31+00:00</updated>
<author>
<name>Crystal Wood</name>
<email>crwood@redhat.com</email>
</author>
<published>2026-09-19T06:27:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7a5e8f91516d739c833e87591fbceac56a38628d'/>
<id>7a5e8f91516d739c833e87591fbceac56a38628d</id>
<content type='text'>
When running the tests directly instead of from the makefile, RTLA
is likely to be unset.  The default "./rtla" no longer works, due to
having changed the current diretory.

Fixes: ad5b50a0959fb ("rtla/tests: Run runtime tests in temporary directory")
Signed-off-by: Crystal Wood &lt;crwood@redhat.com&gt;
Link: https://lore.kernel.org/r/20260919062756.819701-2-crwood@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>
When running the tests directly instead of from the makefile, RTLA
is likely to be unset.  The default "./rtla" no longer works, due to
having changed the current diretory.

Fixes: ad5b50a0959fb ("rtla/tests: Run runtime tests in temporary directory")
Signed-off-by: Crystal Wood &lt;crwood@redhat.com&gt;
Link: https://lore.kernel.org/r/20260919062756.819701-2-crwood@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>
</feed>
