From: Steven Rostedt <rostedt@goodmis.org>
To: Changbin Du <changbin.du@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
linux-doc@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org,
Matthew Wilcox <willy@infradead.org>,
linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] fgraph: record function return value
Date: Mon, 14 Jan 2019 11:21:15 -0500 [thread overview]
Message-ID: <20190114112115.1cbf21c0@gandalf.local.home> (raw)
In-Reply-To: <20190112065701.30841-1-changbin.du@gmail.com>
On Sat, 12 Jan 2019 14:57:01 +0800
Changbin Du <changbin.du@gmail.com> wrote:
> This patch adds a new trace option 'funcgraph-retval' and is disabled by
> default. When this option is enabled, fgraph tracer will show the return
> value of each function. This is useful to find/analyze a original error
> source in a call graph.
>
> One limitation is that kernel doesn't know the prototype of functions. So
> fgraph assumes all functions have a retvalue of type int. You must ignore
> the value of *void* function. And if the retvalue looks like an error code
> then both hexadecimal and decimal number are displayed.
>
> In this patch, only x86 and ARM platforms are supported.
>
> Here is example showing the error is caused by vmx_create_vcpu() and the
> error code is -5 (-EIO).
>
> with echo 1 > /sys/kernel/debug/tracing/options/funcgraph-retval
>
> 3) | kvm_vm_ioctl() {
> 3) | mutex_lock() {
> 3) | _cond_resched() {
> 3) 0.234 us | rcu_all_qs(); /* ret=0x80000000 */
> 3) 0.704 us | } /* ret=0x0 */
> 3) 1.226 us | } /* ret=0x0 */
> 3) 0.247 us | mutex_unlock(); /* ret=0xffff8880738ed040 */
> 3) | kvm_arch_vcpu_create() {
> 3) | vmx_create_vcpu() {
> 3) + 17.969 us | kmem_cache_alloc(); /* ret=0xffff88813a980040 */
> 3) + 15.948 us | kmem_cache_alloc(); /* ret=0xffff88813aa99200 */
> 3) 0.653 us | allocate_vpid.part.88(); /* ret=0x1 */
> 3) 6.964 us | kvm_vcpu_init(); /* ret=0xfffffffb */
> 3) 0.323 us | free_vpid.part.89(); /* ret=0x1 */
> 3) 9.985 us | kmem_cache_free(); /* ret=0x80000000 */
> 3) 9.491 us | kmem_cache_free(); /* ret=0x80000000 */
> 3) + 69.858 us | } /* ret=0xfffffffffffffffb/-5 */
> 3) + 70.631 us | } /* ret=0xfffffffffffffffb/-5 */
> 3) | mutex_lock() {
> 3) | _cond_resched() {
> 3) 0.199 us | rcu_all_qs(); /* ret=0x80000000 */
> 3) 0.594 us | } /* ret=0x0 */
> 3) 1.067 us | } /* ret=0x0 */
> 3) 0.337 us | mutex_unlock(); /* ret=0xffff8880738ed040 */
> 3) + 92.730 us | } /* ret=0xfffffffffffffffb/-5 */
>
> Signed-off-by: Changbin Du <changbin.du@gmail.com>
> ---
>
Hi Changbin,
I'm rewriting a lot of the function graph tracer code to have
kretprobes be able to work on top of it. It's still a work in progress.
It would be easier to add something to that work when its done than to
do it now.
Thanks!
-- Steve
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-01-14 16:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-12 6:57 [PATCH] fgraph: record function return value Changbin Du
2019-01-12 12:21 ` Matthew Wilcox
2019-01-12 14:20 ` Changbin Du
2019-01-14 12:11 ` Mark Rutland
2019-01-14 16:07 ` Changbin Du
2019-01-14 16:21 ` Steven Rostedt [this message]
2019-01-15 0:40 ` Changbin Du
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=20190114112115.1cbf21c0@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=changbin.du@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mark.rutland@arm.com \
--cc=willy@infradead.org \
--cc=x86@kernel.org \
/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).