public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "Frédéric Weisbecker" <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: Human readable output for function return tracer
Date: Mon, 24 Nov 2008 17:27:19 +0100	[thread overview]
Message-ID: <20081124162719.GA11532@elte.hu> (raw)
In-Reply-To: <c62985530811240639w574659c0nd0a54e6c1fb1197a@mail.gmail.com>


* Frédéric Weisbecker <fweisbec@gmail.com> wrote:

> Hi,
> 
> I'm planning to apply an idea proposed by Ingo to make the output on
> the function return tracer
> more "eyes-parsable".
> The idea consists on a trace which has flow similar to C code:
> 
> func1() {
>     func2() {
>         func3() {
>         }
>     }
>     func4() {
>     }
> }
> 
> (With time of execution added on closing braces).
> 
> The problem is that the traces arrive in the reverse order, according
> to the fact that functions
> are traced on return.
> The order corresponding to the above example would be as the following:
> 
> func3, func2, func4, func1
> 
> Oh and we have the parent in a return trace, so we would actually have:
> 
> func2->func3

[ Note: here we'd also have: ]

  func1->func2

> func1->func4
> ....    ->func1

it's basicaly a representation of the callgraph in polish notation.

> This trace flow doesn't make the things easy to produce our C like 
> code.
> 
> So I found only one solution which have both pros and cons. I could 
> send a "pre-trace" to the ring-buffer to signal that function x with 
> depth y is beeing called (when we enter the function).

that's OK i think. It will double the number of events, but will 
simplify everything immensely - especially if we have small 
imperfections in the callgraph arising out of IRQ entries.

Note that we _could_ render it all from the return events alone, 
because we have the full callgraph available. But it would be either 
very memory-intense or very CPU-intense: we'd either have to buffer up 
all the return events in a reverse-stack sort of construct (which 
could grow much larger than the return stack itself), or we'd have to 
reconstruct it on the fly by constantly scanning forwards to discover 
the context of the printout. Both can have pretty ugly worst-case 
behavior with certain call graph layouts.

So i think you made a good call - lets keep it simple for now.

Also, do you have any thoughts about how to extend the return-tracer 
to 64-bit x86? It should work pretty well i think - the return value 
has to be extended to 64 bits but that's pretty much all.

	Ingo

  reply	other threads:[~2008-11-24 16:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-24 14:39 Human readable output for function return tracer Frédéric Weisbecker
2008-11-24 16:27 ` Ingo Molnar [this message]
2008-11-24 17:16   ` Frédéric Weisbecker
2008-11-25 15:18   ` Frédéric Weisbecker
2008-11-25 15:36     ` Ingo Molnar
2008-11-25 15:40       ` Ingo Molnar
2008-11-25 15:49         ` Frédéric Weisbecker
2008-11-25 15:56         ` Ingo Molnar
2008-11-25 16:01           ` Frédéric Weisbecker
2008-11-24 17:21 ` Steven Rostedt
2008-11-24 17:34   ` Frédéric Weisbecker
2008-11-24 18:15 ` Arnaldo Carvalho de Melo
2008-11-24 19:10   ` Frédéric Weisbecker
2008-11-24 19:39     ` Arnaldo Carvalho de Melo
2008-11-24 20:00       ` Frédéric Weisbecker
2008-11-24 20:13       ` Frédéric Weisbecker

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=20081124162719.GA11532@elte.hu \
    --to=mingo@elte.hu \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.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