Re: [GIT PULL] ftrace: Fixes for v6.13
From: Linus Torvalds
Date: Sat Dec 14 2024 - 19:38:11 EST
On Sat, 14 Dec 2024 at 15:21, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> - Fix output of trace when hashing a pointer is disabled
Christ.
I'm looking at this, and my reaction is literally "tracing is doing
crazy things AGAIN".
This stuff is full of crazy special cases for things that should never
be done in the first place.
And - surprise surprise - it was buggy in odd ways as a result.
If I read the code right, this hacky code literally only catches stale
strings, but also has some *insane* code to do "text_delta" to
'%p[sS]' printouts.
And I see how it does that
text_delta = iter->tr->text_delta;
but I don't actually see where 'text_delta' would ever actually get
set. Where does tr->text_delta ever get set to anything but zero?
That code should be *removed*. It seems to be there entirely as a
sanity check, and when the sanity check itself is buggy, you don't try
to fix it, you remove the whole crazy garbage.
What makes '%s' so special in trace formats that it merits this
horrible hackery?
What makes 'text_delta' at all sane, never mind where it even gets set?
And why should we maintain that horrible hackery and make it worse?
This code shows a complete lack of taste. This needs extreme
crapectomy, not some alleged "fix".
If "people use stale pointers for '%s' and we actually care" is a real
issue, we could very possibly teach vsnprintf() about that. The code
already has a "check_pointer()" thing for just NULL pointer magic
printouts.
Linus