[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230318124028.4faf75d1@rorschach.local.home>
Date: Sat, 18 Mar 2023 12:40:28 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Donglin Peng <pengdonglin@...gfor.com.cn>
Cc: "Russell King (Oracle)" <linux@...linux.org.uk>,
mhiramat@...nel.org, mark.rutland@....com, will@...nel.org,
catalin.marinas@....com, palmer@...belt.com,
paul.walmsley@...ive.com, tglx@...utronix.de,
dave.hansen@...ux.intel.com, x86@...nel.org, mingo@...hat.com,
xiehuan09@...il.com, dinghui@...gfor.com.cn,
huangcun@...gfor.com.cn, dolinux.peng@...il.com,
linux-trace-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/2] function_graph: Support recording and printing
the return value of function
On Fri, 17 Mar 2023 10:49:49 +0800
Donglin Peng <pengdonglin@...gfor.com.cn> wrote:
> > So, really it depends what size of return value we want to report.
> > Also, please bear in mind that where a function returns a 32-bit
> > value, that will be in r0, and r1 will be whatever happened to be
> > in it at function exit - there's no defined value for r1.
> >
>
> Thank you. I will document this as a limitation of fgraph return value.
> It can just cover most cases at present and I think the r0 is enough.
One thing we could possibly do here is to use BTF or objtool to denote
the return value of each function and use 2 bits of the ftrace
rec->flags to state that it is:
0 - void
1 - 1 word size return
2 - 2 word size return
I believe we can get access to the function's rec via the return call
(or add that access) and pass both words to the return function, and
then the return callback can use this lookup to determine what values
are useful or not.
In any case, I would suggest passing both regs to the callback, and for
now just ignore the second reg until we can come up with a way to
differentiate each function.
-- Steve
Powered by blists - more mailing lists