linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Donglin Peng <pengdonglin@sangfor.com.cn>
To: Ding Hui <dinghui@sangfor.com.cn>,
	mhiramat@kernel.org, rostedt@goodmis.org, linux@armlinux.org.uk,
	mark.rutland@arm.com, will@kernel.org, catalin.marinas@arm.com,
	palmer@dabbelt.com, paul.walmsley@sifive.com, tglx@linutronix.de,
	dave.hansen@linux.intel.com, x86@kernel.org, mingo@redhat.com,
	xiehuan09@gmail.com, huangcun@sangfor.com.cn,
	dolinux.peng@gmail.com
Cc: linux-trace-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 2/2] tracing: Add documentation for funcgraph-retval and graph_retval_hex
Date: Tue, 21 Mar 2023 11:24:44 +0800	[thread overview]
Message-ID: <1446d966-1b7d-322e-bdd9-d0cb4506c080@sangfor.com.cn> (raw)
In-Reply-To: <4a88721a-ac78-bcad-1b33-f9027baab5ab@sangfor.com.cn>

On 2023/3/21 10:31, Ding Hui wrote:
> On 2023/3/20 21:16, Donglin Peng wrote:
> 
>> +There are some limitations when using the funcgraph-retval currently:
>> +
>> +- Even if the function return type is void, a return value will still
>> +  be printed, and you can just ignore it.
>> +
>> +- Even if the return value is not an error code actually, it may be
>> +  displayed as an error code. You should read the code to check.
>> +  For example, both 0xfe and 0xfffe are be interpreted as -2.
> 
> For char and short types, displaying as signed decimal may be not 
> appropriate, because they are rarely used to store error code.
> 
> So in "smart" mode (graph_retval_hex=0), I suggest just smart convert 
> error value stored in int or pointer to signed decimal.

Yeah, I will remove the return value conversion for char and short
types in the "smart" mode.

> 
>> +- Only the value of the first return register will be recorded and
>> +  printed even if the return values may be stored in two registers
>> +  actually. For example, both the eax and edx are used to store a
>> +  64 bit return value in the x86 architecture, and the eax stores
>> +  the low 32 bit, the edx stores the high 32 bit, however only the
>> +  value stored in eax will be recorded and printed.
>> +
>>   You can put some comments on specific functions by using
>>   trace_printk() For example, if you want to put a comment inside
>>   the __might_sleep() function, you just have to include
> 


      reply	other threads:[~2023-03-21  3:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 13:16 [PATCH v5 0/2] function_graph: Support recording and printing the return value of function Donglin Peng
2023-03-20 13:16 ` [PATCH v5 1/2] " Donglin Peng
2023-03-21 14:09   ` Florian Kauer
2023-03-21 14:44     ` Steven Rostedt
2023-03-21 15:11       ` Florian Kauer
2023-03-22  5:01         ` Donglin Peng
2023-03-21 14:24   ` Mark Rutland
2023-03-22  8:47     ` Donglin Peng
2023-03-21 17:31   ` Russell King (Oracle)
2023-03-22  9:01     ` Donglin Peng
2023-03-20 13:16 ` [PATCH v5 2/2] tracing: Add documentation for funcgraph-retval and graph_retval_hex Donglin Peng
2023-03-21  2:31   ` Ding Hui
2023-03-21  3:24     ` Donglin Peng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1446d966-1b7d-322e-bdd9-d0cb4506c080@sangfor.com.cn \
    --to=pengdonglin@sangfor.com.cn \
    --cc=catalin.marinas@arm.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dinghui@sangfor.com.cn \
    --cc=dolinux.peng@gmail.com \
    --cc=huangcun@sangfor.com.cn \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    --cc=xiehuan09@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).