<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/tracing/rtla/src/timerlat_hist.c, branch v7.1-rc5</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1-rc5</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1-rc5'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-03-10T09:32:37+00:00</updated>
<entry>
<title>rtla: Introduce common_threshold_handler() helper</title>
<updated>2026-03-10T09:32:37+00:00</updated>
<author>
<name>Wander Lairson Costa</name>
<email>wander@redhat.com</email>
</author>
<published>2026-03-09T19:46:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a50c53884db83189947f213d4c7f8385c522d141'/>
<id>urn:sha1:a50c53884db83189947f213d4c7f8385c522d141</id>
<content type='text'>
Several functions duplicate the logic for handling threshold actions.
When a threshold is reached, these functions stop the trace, perform
configured actions, and restart the trace if --on-threshold continue
is set.

Create common_threshold_handler() to centralize this shared logic and
avoid code duplication. The function executes the configured threshold
actions and restarts the necessary trace instances when appropriate.

Also add should_continue_tracing() helper to encapsulate the check
for whether tracing should continue after a threshold event, improving
code readability at call sites.

In timerlat_top_bpf_main_loop(), use common_params directly instead
of casting through timerlat_params when only common fields are needed.

Signed-off-by: Wander Lairson Costa &lt;wander@redhat.com&gt;
Link: https://lore.kernel.org/r/20260309195040.1019085-5-wander@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>rtla: Exit on memory allocation failures during initialization</title>
<updated>2026-03-10T09:32:37+00:00</updated>
<author>
<name>Wander Lairson Costa</name>
<email>wander@redhat.com</email>
</author>
<published>2026-03-09T19:46:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=009a8e681fb003f38dd57a640e11ed826740b5c1'/>
<id>urn:sha1:009a8e681fb003f38dd57a640e11ed826740b5c1</id>
<content type='text'>
Most memory allocations in rtla happen during early initialization
before any resources are acquired that would require cleanup. In these
cases, propagating allocation errors just adds complexity without any
benefit. There's nothing to clean up, and the program must exit anyway.

This patch introduces fatal allocation wrappers (calloc_fatal,
reallocarray_fatal, strdup_fatal) that call fatal() on allocation
failure. These wrappers simplify the code by eliminating unnecessary
error propagation paths.

The patch converts early allocations to use these wrappers in
actions_init() and related action functions, osnoise_context_alloc()
and osnoise_init_tool(), trace_instance_init() and trace event
functions, and parameter structure allocations in main functions.

This simplifies the code while maintaining the same behavior: immediate
exit on allocation failure during initialization. Allocations that
require cleanup, such as those in histogram allocation functions with
goto cleanup paths, are left unchanged and continue to return errors.

Signed-off-by: Wander Lairson Costa &lt;wander@redhat.com&gt;
Link: https://lore.kernel.org/r/20260309195040.1019085-2-wander@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/rtla: Remove unneeded nr_cpus from for_each_monitored_cpu</title>
<updated>2026-03-09T07:49:17+00:00</updated>
<author>
<name>Costa Shulyupin</name>
<email>costa.shul@redhat.com</email>
</author>
<published>2026-03-06T19:49:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=458c9519ab21ea473020c53a50d7d5b1720ded30'/>
<id>urn:sha1:458c9519ab21ea473020c53a50d7d5b1720ded30</id>
<content type='text'>
nr_cpus does not change at runtime, so passing it through the macro
argument is unnecessary.

Remove the argument and use the global nr_cpus instead.

Signed-off-by: Costa Shulyupin &lt;costa.shul@redhat.com&gt;
Link: https://lore.kernel.org/r/20260306194953.2511960-5-costa.shul@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/rtla: Remove unneeded nr_cpus members</title>
<updated>2026-03-09T07:49:17+00:00</updated>
<author>
<name>Costa Shulyupin</name>
<email>costa.shul@redhat.com</email>
</author>
<published>2026-03-06T19:49:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=caf3fc0fdd63b4b163ee4eac1ca822772108c0f8'/>
<id>urn:sha1:caf3fc0fdd63b4b163ee4eac1ca822772108c0f8</id>
<content type='text'>
nr_cpus does not change at runtime, so keeping it in struct members is
unnecessary.

Use the global nr_cpus instead of struct members.

Signed-off-by: Costa Shulyupin &lt;costa.shul@redhat.com&gt;
Link: https://lore.kernel.org/r/20260306194953.2511960-4-costa.shul@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/rtla: Remove unneeded nr_cpus arguments</title>
<updated>2026-03-09T07:49:17+00:00</updated>
<author>
<name>Costa Shulyupin</name>
<email>costa.shul@redhat.com</email>
</author>
<published>2026-03-06T19:49:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ea06305ff9920115e07b6947568cbfba4736e10c'/>
<id>urn:sha1:ea06305ff9920115e07b6947568cbfba4736e10c</id>
<content type='text'>
nr_cpus does not change at runtime, so passing it through function
arguments is unnecessary.

Use the global nr_cpus instead of propagating it via parameters.

Signed-off-by: Costa Shulyupin &lt;costa.shul@redhat.com&gt;
Link: https://lore.kernel.org/r/20260306194953.2511960-3-costa.shul@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/rtla: Consolidate nr_cpus usage across all tools</title>
<updated>2026-03-09T07:49:16+00:00</updated>
<author>
<name>Costa Shulyupin</name>
<email>costa.shul@redhat.com</email>
</author>
<published>2026-03-06T19:49:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=115b06a008756ec777249dc9f432dc1a6c681396'/>
<id>urn:sha1:115b06a008756ec777249dc9f432dc1a6c681396</id>
<content type='text'>
sysconf(_SC_NPROCESSORS_CONF) (via get_nprocs_conf) reflects
cpu_possible_mask, which is fixed at boot time, so querying it
repeatedly is unnecessary.

Replace multiple calls to sysconf(_SC_NPROCESSORS_CONF) with a single
global nr_cpus variable initialized once at startup.

`#pragma once` in timerlat_u.h is needed for pre-C23 compilers to avoid
redefinition errors.

Signed-off-by: Costa Shulyupin &lt;costa.shul@redhat.com&gt;
Link: https://lore.kernel.org/r/20260306194953.2511960-2-costa.shul@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>rtla/timerlat: Add --stack-format option</title>
<updated>2026-03-04T14:51:56+00:00</updated>
<author>
<name>Tomas Glozar</name>
<email>tglozar@redhat.com</email>
</author>
<published>2026-01-19T11:52:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ef59e454156eb068ba3f2d9e14b397fd7953f65a'/>
<id>urn:sha1:ef59e454156eb068ba3f2d9e14b397fd7953f65a</id>
<content type='text'>
In the current implementation, the auto-analysis code for printing the
stack captured in the tracefs buffer of the aa instance stops at the
first encountered address that cannot be resolved into a function
symbol.

This is not always the desired behavior on all platforms; sometimes,
there might be resolvable entries after unresolvable ones, and
sometimes, the user might want to inspect the raw pointers for the
unresolvable entries.

Add a new option, --stack-format, with three values:

- truncate: stop at first unresolvable entry. This is the current
  behavior, and is kept as the default.
- skip: skip unresolvable entries, but do not stop on them.
- full: print all entries, including unresolvable ones.

To make this work, the "size" field of the stack entry is now also read
and used as the maximum number of entries to print, capped at 64, since
that is the fixed length of the "caller" field.

Link: https://lore.kernel.org/r/20260119115222.744150-1-tglozar@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/rtla: Generate optstring from long options</title>
<updated>2026-03-02T13:53:41+00:00</updated>
<author>
<name>Costa Shulyupin</name>
<email>costa.shul@redhat.com</email>
</author>
<published>2026-01-08T09:49:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a1cec7450b7159a0ee57403f44460ac4d618b4f'/>
<id>urn:sha1:4a1cec7450b7159a0ee57403f44460ac4d618b4f</id>
<content type='text'>
getopt_long() processes short and long options independently.
RTLA, like the majority of applications, uses both short and long
variants for each logical option.

Since the val member of struct option holds the letter of the short
variant, the string of short options can be reconstructed from the
array of long options.

Add getopt_auto() to generate optstring from an array of long options,
eliminating the need to maintain separate short option strings.

Signed-off-by: Costa Shulyupin &lt;costa.shul@redhat.com&gt;
Reviewed-by: Wander Lairson Costa &lt;wander@redhat.com&gt;
Link: https://lore.kernel.org/r/20260108095011.2115719-1-costa.shul@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/rtla: Consolidate -H/--house-keeping option parsing</title>
<updated>2026-01-07T14:57:17+00:00</updated>
<author>
<name>Costa Shulyupin</name>
<email>costa.shul@redhat.com</email>
</author>
<published>2025-12-09T10:00:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0576be469ef18a9f3460f6f207183033ae8b90c5'/>
<id>urn:sha1:0576be469ef18a9f3460f6f207183033ae8b90c5</id>
<content type='text'>
Each rtla tool duplicates parsing of -H/--house-keeping.

Migrate the option parsing from individual tools to the
common_parse_options().

Signed-off-by: Costa Shulyupin &lt;costa.shul@redhat.com&gt;
Link: https://lore.kernel.org/r/20251209100047.2692515-8-costa.shul@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/rtla: Consolidate -P/--priority option parsing</title>
<updated>2026-01-07T14:57:17+00:00</updated>
<author>
<name>Costa Shulyupin</name>
<email>costa.shul@redhat.com</email>
</author>
<published>2025-12-09T10:00:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5cc90b14ee54591b890ad026ad5e01b2960c3a31'/>
<id>urn:sha1:5cc90b14ee54591b890ad026ad5e01b2960c3a31</id>
<content type='text'>
Each rtla tool duplicates parsing of -P/--priority.

Migrate the option parsing from individual tools to the
common_parse_options().

Signed-off-by: Costa Shulyupin &lt;costa.shul@redhat.com&gt;
Link: https://lore.kernel.org/r/20251209100047.2692515-7-costa.shul@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
</feed>
