<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/tracing/rtla/src/utils.h, 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-11T14:29:50+00:00</updated>
<entry>
<title>rtla: Add str_has_prefix() helper function</title>
<updated>2026-03-11T14:29:50+00:00</updated>
<author>
<name>Wander Lairson Costa</name>
<email>wander@redhat.com</email>
</author>
<published>2026-03-09T19:46:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0f4bc9d67a643a6ea8b82faf724e44648b2c322d'/>
<id>urn:sha1:0f4bc9d67a643a6ea8b82faf724e44648b2c322d</id>
<content type='text'>
Add a str_has_prefix() helper function that tests whether a string
starts with a given prefix. This function provides a cleaner interface
for prefix matching compared to using strncmp() with strlen() directly.

The function returns a boolean value indicating whether the string
starts with the specified prefix. This helper will be used in
subsequent changes to simplify prefix matching code throughout rtla.

Also add the missing string.h include which is needed for the strlen()
and strncmp() functions used by str_has_prefix() and the existing
strncmp_static() macro.

Signed-off-by: Wander Lairson Costa &lt;wander@redhat.com&gt;
Link: https://lore.kernel.org/r/20260309195040.1019085-11-wander@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>rtla/actions: Simplify argument parsing</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:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=989e5b8f0c5302cfb233fa2db49f8877b5f1352d'/>
<id>urn:sha1:989e5b8f0c5302cfb233fa2db49f8877b5f1352d</id>
<content type='text'>
The actions_parse() function uses open-coded logic to extract arguments
from a string. This includes manual length checks and strncmp() calls,
which can be verbose and error-prone.

To simplify and improve the robustness of argument parsing, introduce a
new extract_arg() helper macro. This macro extracts the value from a
"key=value" pair, making the code more concise and readable.

Also, introduce STRING_LENGTH() and strncmp_static() macros to
perform compile-time calculations of string lengths and safer string
comparisons.

Refactor actions_parse() to use these new helpers, resulting in
cleaner and more maintainable code.

Signed-off-by: Wander Lairson Costa &lt;wander@redhat.com&gt;
Link: https://lore.kernel.org/r/20260309195040.1019085-4-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>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>rtla: Use standard exit codes for result enum</title>
<updated>2026-01-07T14:57:55+00:00</updated>
<author>
<name>Wander Lairson Costa</name>
<email>wander@redhat.com</email>
</author>
<published>2026-01-06T11:49:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9bf942f3c370c9b3af639df04cb5f34daf512dab'/>
<id>urn:sha1:9bf942f3c370c9b3af639df04cb5f34daf512dab</id>
<content type='text'>
The result enum defines custom values for PASSED, ERROR, and FAILED.
These values correspond to standard exit codes EXIT_SUCCESS and
EXIT_FAILURE.

Update the enum to use the standard macros EXIT_SUCCESS and
EXIT_FAILURE to improve readability and adherence to standard C
practices.

The FAILED value is implicitly assigned EXIT_FAILURE + 1, so there
is no need to assign an explicit value.

Signed-off-by: Wander Lairson Costa &lt;wander@redhat.com&gt;
Link: https://lore.kernel.org/r/20260106133655.249887-9-wander@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>rtla: Replace atoi() with a robust strtoi()</title>
<updated>2026-01-07T14:57:55+00:00</updated>
<author>
<name>Wander Lairson Costa</name>
<email>wander@redhat.com</email>
</author>
<published>2026-01-06T11:49:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7e9dfccf8f11c26208211457c4597a466135b56a'/>
<id>urn:sha1:7e9dfccf8f11c26208211457c4597a466135b56a</id>
<content type='text'>
The atoi() function does not perform error checking, which can lead to
undefined behavior when parsing invalid or out-of-range strings. This
can cause issues when parsing user-provided numerical inputs, such as
signal numbers, PIDs, or CPU lists.

To address this, introduce a new strtoi() helper function that safely
converts a string to an integer. This function validates the input and
checks for overflows, returning a negative value on  failure.

Replace all calls to atoi() with the new strtoi() function and add
proper error handling to make the parsing more robust and prevent
potential issues.

Signed-off-by: Wander Lairson Costa &lt;wander@redhat.com&gt;
Link: https://lore.kernel.org/r/20260106133655.249887-5-wander@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/rtla: Remove unused function declarations</title>
<updated>2026-01-06T09:11:59+00:00</updated>
<author>
<name>Costa Shulyupin</name>
<email>costa.shul@redhat.com</email>
</author>
<published>2025-10-12T07:11:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=11aa4a18094f04a8ba7e403c272a9a5d85c9c9fc'/>
<id>urn:sha1:11aa4a18094f04a8ba7e403c272a9a5d85c9c9fc</id>
<content type='text'>
Historically four function declarations remain orphaned or duplicated.

Remove them to keep the source clean.

Signed-off-by: Costa Shulyupin &lt;costa.shul@redhat.com&gt;
Link: https://lore.kernel.org/r/20251012071133.290225-1-costa.shul@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>rtla: Fix -C/--cgroup interface</title>
<updated>2025-11-21T09:30:27+00:00</updated>
<author>
<name>Ivan Pravdin</name>
<email>ipravdin.official@gmail.com</email>
</author>
<published>2025-11-03T16:19:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7b71f3a6986c93defbb72bb6c143e04122720cb1'/>
<id>urn:sha1:7b71f3a6986c93defbb72bb6c143e04122720cb1</id>
<content type='text'>
Currently, user can only specify cgroup to the tracer's thread the
following ways:

    `-C[cgroup]`
    `-C[=cgroup]`
    `--cgroup[=cgroup]`

If user tries to specify cgroup as `-C [cgroup]` or `--cgroup [cgroup]`,
the parser silently fails and rtla's cgroup is used for the tracer
threads.

To make interface more user-friendly, allow user to specify cgroup in
the aforementioned way, i.e. `-C [cgroup]` and `--cgroup [cgroup]`.

Refactor identical logic between -t/--trace and -C/--cgroup into a
common function.

Change documentation to reflect this user interface change.

Fixes: a957cbc02531 ("rtla: Add -C cgroup support")
Signed-off-by: Ivan Pravdin &lt;ipravdin.official@gmail.com&gt;
Reviewed-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
Link: https://lore.kernel.org/r/16132f1565cf5142b5fbd179975be370b529ced7.1762186418.git.ipravdin.official@gmail.com
[ use capital letter in subject, as required by tracing subsystem ]
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools/rtla: Add fatal() and replace error handling pattern</title>
<updated>2025-11-21T09:30:27+00:00</updated>
<author>
<name>Costa Shulyupin</name>
<email>costa.shul@redhat.com</email>
</author>
<published>2025-10-11T08:27:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8cbb25db81544f0bfc05c037ad61d3e70d031f88'/>
<id>urn:sha1:8cbb25db81544f0bfc05c037ad61d3e70d031f88</id>
<content type='text'>
The code contains some technical debt in error handling,
which complicates the consolidation of duplicated code.

Introduce an fatal() function to replace the common pattern of
err_msg() followed by exit(EXIT_FAILURE), reducing the length of an
already long function.

Further patches using fatal() follow.

Signed-off-by: Costa Shulyupin &lt;costa.shul@redhat.com&gt;
Reviewed-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
Link: https://lore.kernel.org/r/20251011082738.173670-2-costa.shul@redhat.com
Signed-off-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
</content>
</entry>
<entry>
<title>rtla: Set distinctive exit value for failed tests</title>
<updated>2025-05-07T19:36:19+00:00</updated>
<author>
<name>Costa Shulyupin</name>
<email>costa.shul@redhat.com</email>
</author>
<published>2025-04-17T18:56:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=18682166f61494072d589692c57b7a32b89fc9dc'/>
<id>urn:sha1:18682166f61494072d589692c57b7a32b89fc9dc</id>
<content type='text'>
A test is considered failed when a sample trace exceeds the threshold.
Failed tests return the same exit code as passed tests, requiring test
frameworks to determine the result by searching for "hit stop tracing"
in the output.

Assign a distinct exit code for failed tests to enable the use of shell
expressions and seamless integration with testing frameworks without the
need to parse output.

Add enum type for return value.

Update `make check`.

Cc: Daniel Bristot de Oliveira &lt;bristot@kernel.org&gt;
Cc: John Kacur &lt;jkacur@redhat.com&gt;
Cc: "Luis Claudio R. Goncalves" &lt;lgoncalv@redhat.com&gt;
Cc: Eder Zulian &lt;ezulian@redhat.com&gt;
Cc: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Cc: Jan Stancek &lt;jstancek@redhat.com&gt;
Link: https://lore.kernel.org/20250417185757.2194541-1-costa.shul@redhat.com
Signed-off-by: Costa Shulyupin &lt;costa.shul@redhat.com&gt;
Reviewed-by: Tomas Glozar &lt;tglozar@redhat.com&gt;
Signed-off-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
</feed>
