[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250412172154.0a0ee9c6@batman.local.home>
Date: Sat, 12 Apr 2025 17:21:54 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Ilya Leoshkevich <iii@...ux.ibm.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, Sven Schnelle <svens@...ux.ibm.com>,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org, Heiko
Carstens <hca@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>, Alexander
Gordeev <agordeev@...ux.ibm.com>
Subject: Re: [PATCH] ftrace: Fix type of ftrace_graph_ent_entry.depth
On Sat, 12 Apr 2025 23:01:05 +0200
Ilya Leoshkevich <iii@...ux.ibm.com> wrote:
> On 2025-04-12 18:07, Steven Rostedt wrote:
> > On Fri, 11 Apr 2025 19:21:41 +0200
> > Ilya Leoshkevich <iii@...ux.ibm.com> wrote:
> >
> >>
> >> - F_printk("--> %ps (%lu)", (void *)__entry->func, __entry->depth)
> >> + F_printk("--> %ps (%d)", (void *)__entry->func, __entry->depth)
> >
> > depth should never be negative. Why did you use "%d" and not "%u" ?
> >
> > -- Steve
>
> I used int, because it's int in ftrace_graph_ent and all other events.
> If you think it's a good idea, I can change them all to unsigned int in
> a follow-up patch.
Hmm, a change like that should have been in the change log and explained.
The reason the code has int is because it uses negative depth to break
out of iterations and such. But what is recorded is always zero or
positive.
Yeah, let's keep it exposed as unsigned int.
Thanks,
-- Stene
Powered by blists - more mailing lists