From: "Frédéric Weisbecker" <fweisbec@gmail.com>
To: "Steven Rostedt" <rostedt@goodmis.org>
Cc: "Ingo Molnar" <mingo@elte.hu>,
"Linux Kernel" <linux-kernel@vger.kernel.org>
Subject: Re: Human readable output for function return tracer
Date: Mon, 24 Nov 2008 18:34:56 +0100 [thread overview]
Message-ID: <c62985530811240934i659c571p5272570e5ea03c13@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.10.0811241202060.20122@gandalf.stny.rr.com>
2008/11/24 Steven Rostedt <rostedt@goodmis.org>:
> A little off topic, but how do you handle collapsed returns?
>
> func1() {
> [...]
> func2();
> return;
> }
>
> Instead of using call *func2, gcc may decide to collapse it. That is,
> since it is the last thing done on func1, it may pop func1's frame all the
> way to func1's return address, and then do a "jmp" to func2. func2 will
> still call mcount, but on its return, it will jump to the func1 return
> address.
>
> Perhaps this is OK. The call to func1's mcount will store the original
> return address and replace it with the function return code. The call to
> func2 will store that return address and replace it with the func2
> function return code. And both of them will still be processed.
>
> OK, I think I answered my own question, but I'm keeping it in this post
> just to make sure I understand it correctly.
Yes, perhaps it is done that way. Or perhaps CONFIG_FRAME_POINTER avoids
such collapsing calls... I don't know.
Perhaps I should look at some disassembly dumps to ensure things are safe, but
I didn't have any problem with that...
> Do you have a record that you store when you make the first mcount call.
> In this record, could you save the depth of the parent there too. I do not
> remember the code exactly, so I might be off here ;-)
No. At this time I don't do any insertion at the call time :-)
But I don't think I will need the parent depth. The current depth will
be sufficient for the trace printing.
next prev parent reply other threads:[~2008-11-24 17:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-24 14:39 Frédéric Weisbecker
2008-11-24 16:27 ` Ingo Molnar
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 [this message]
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=c62985530811240934i659c571p5272570e5ea03c13@mail.gmail.com \
--to=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--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
all inboxes | Powered by JetHome®