* [GIT PULL] tracing: Cleanups for v6.17
@ 2025-08-03 13:55 Steven Rostedt
2025-08-03 22:28 ` Linus Torvalds
2025-08-03 22:32 ` pr-tracker-bot
0 siblings, 2 replies; 4+ messages in thread
From: Steven Rostedt @ 2025-08-03 13:55 UTC (permalink / raw)
To: Linus Torvalds; +Cc: LKML, Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton
Linus,
tracing cleanups for v6.17:
- Remove unneeded goto out statements
Over time, the logic was restructured but left a "goto out" where the
out label simply did a "return ret;". Instead of jumping to this out
label, simply return immediately and remove the out label.
- Add guard(ring_buffer_nest)
Some calls to the tracing ring buffer can happen when the ring buffer is
already being written to at the same context (for example, a
trace_printk() in between a ring_buffer_lock_reserve() and a
ring_buffer_unlock_commit()).
In order to not trigger the recursion detection, these functions use
ring_buffer_nest_start() and ring_buffer_nest_end(). Create a guard() for
these functions so that their use cases can be simplified and not need to
use goto for the release.
- Clean up the tracing code with guard() and __free() logic
There were several locations that were prime candidates for using guard()
and __free() helpers. Switch them over to use them.
- Fix output of function argument traces for unsigned int values
The function tracer with "func-args" option set will record up to 6 argument
registers and then use BTF to format them for human consumption when the
trace file is read. There's several arguments that are "unsigned long" and
even "unsigned int" that are either and address or a mask. It is easier to
understand if they were printed using hexadecimal instead of decimal.
The old method just printed all non-pointer values as signed integers,
which made it even worse for unsigned integers.
For instance, instead of:
__local_bh_disable_ip(ip=-2127311112, cnt=256) <-handle_softirqs
Show:
__local_bh_disable_ip(ip=0xffffffff8133cef8, cnt=0x100) <-handle_softirqs
Please pull the latest trace-v6.17-2 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace-v6.17-2
Tag SHA1: 9b49d74f0b5ded00a817117fcd389b253a94577f
Head SHA1: 3ca824369b71d4b441e1fdcdee8e66bcb05510a9
Steven Rostedt (6):
tracing: Remove unneeded goto out logic
tracing: Add guard(ring_buffer_nest)
tracing: Add guard() around locks and mutexes in trace.c
tracing: Use __free(kfree) in trace.c to remove gotos
ring-buffer: Convert ring_buffer_write() to use guard(preempt_notrace)
tracing: Have unsigned int function args displayed as hexadecimal
----
include/linux/ring_buffer.h | 3 +
kernel/trace/ring_buffer.c | 16 +--
kernel/trace/trace.c | 287 ++++++++++++++------------------------
kernel/trace/trace_events_synth.c | 6 +-
kernel/trace/trace_output.c | 8 +-
5 files changed, 120 insertions(+), 200 deletions(-)
---------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [GIT PULL] tracing: Cleanups for v6.17
2025-08-03 13:55 [GIT PULL] tracing: Cleanups for v6.17 Steven Rostedt
@ 2025-08-03 22:28 ` Linus Torvalds
2025-08-04 0:20 ` Steven Rostedt
2025-08-03 22:32 ` pr-tracker-bot
1 sibling, 1 reply; 4+ messages in thread
From: Linus Torvalds @ 2025-08-03 22:28 UTC (permalink / raw)
To: Steven Rostedt; +Cc: LKML, Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton
On Sun, 3 Aug 2025 at 06:54, Steven Rostedt <rostedt@goodmis.org> wrote:
>
> There's several arguments that are "unsigned long" and
> even "unsigned int" that are either and address or a mask. It is easier to
> understand if they were printed using hexadecimal instead of decimal.
I suspect you are basically being influenced by seeing *existing* odd
cases, and you'll find that a lot of people use 'unsigned int' for
plain integers where decimal representation makes sense - but because
those printed out naturally before, you didn't react to them.
Doing a quick grep shows that it's generally almost a tie between
"print as hex" vs "print as decimal".
Yes, %x being more common, but not *that* much more common:
$ git grep '".*%[0-9lz]*u.*"' | wc -l
45910
$ git grep '".*%[0-9lz]*x.*"' | wc -l
62072
so at least there it's a 57% / 43% split, not really dominated by one
case over the other.
(Obviously that might trigger non-print formats, I'm not claiming
scientific rigor here. Also, ).
I suspect you'll now find cases where the new format is much less
legible than the old decimal one.
You might get better results by actually looking at the values.
Linus
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [GIT PULL] tracing: Cleanups for v6.17
2025-08-03 22:28 ` Linus Torvalds
@ 2025-08-04 0:20 ` Steven Rostedt
0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2025-08-04 0:20 UTC (permalink / raw)
To: Linus Torvalds; +Cc: LKML, Masami Hiramatsu, Mathieu Desnoyers, Andrew Morton
On Sun, 3 Aug 2025 15:28:32 -0700
Linus Torvalds <torvalds@linux-foundation.org> wrote:
> I suspect you are basically being influenced by seeing *existing* odd
> cases, and you'll find that a lot of people use 'unsigned int' for
> plain integers where decimal representation makes sense - but because
> those printed out naturally before, you didn't react to them.
When I have to make a choice and I don't know what the value is, I
usually choose hex over unsigned decimal because it's easier to convert
hex to decimal in my head than it is the other way around.
-- Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [GIT PULL] tracing: Cleanups for v6.17
2025-08-03 13:55 [GIT PULL] tracing: Cleanups for v6.17 Steven Rostedt
2025-08-03 22:28 ` Linus Torvalds
@ 2025-08-03 22:32 ` pr-tracker-bot
1 sibling, 0 replies; 4+ messages in thread
From: pr-tracker-bot @ 2025-08-03 22:32 UTC (permalink / raw)
To: Steven Rostedt
Cc: Linus Torvalds, LKML, Masami Hiramatsu, Mathieu Desnoyers,
Andrew Morton
The pull request you sent on Sun, 3 Aug 2025 09:55:11 -0400:
> git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-v6.17-2
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/3c4a063b1f8ab71352df1421d9668521acb63cd9
Thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-08-04 0:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-03 13:55 [GIT PULL] tracing: Cleanups for v6.17 Steven Rostedt
2025-08-03 22:28 ` Linus Torvalds
2025-08-04 0:20 ` Steven Rostedt
2025-08-03 22:32 ` pr-tracker-bot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.