From: David Daney <ddaney.cavm@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Al Cooper <alcooperx@gmail.com>,
ralf@linux-mips.org, linux-mips@linux-mips.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mips: function tracer: Fix broken function tracing
Date: Tue, 15 Jan 2013 13:34:48 -0800 [thread overview]
Message-ID: <50F5CB78.20800@gmail.com> (raw)
In-Reply-To: <1358284049.4068.21.camel@gandalf.local.home>
On 01/15/2013 01:07 PM, Steven Rostedt wrote:
> On Tue, 2013-01-15 at 09:55 -0800, David Daney wrote:
>
>>> There's nothing that states what the ftrace caller must be. We can have
>>> it do a proper stack update. That is, only at boot up do we need to
>>> handle the defined mcount. After that, those instructions are just place
>>> holders for our own algorithms. If the addiu was needed for the defined
>>> mcount, there's no reason to keep it for our own ftrace_caller.
>>>
>>> Would that work?
>>
>> ... either do as you suggest and dynamically change the ABI of the
>> target function.
>
> We already change the ABI. We have it call ftrace_caller instead of
> mcount.
>
> BTW, I've just compiled with gcc 4.6.3 against mips, and I don't see the
> issue. I have:
>
> 0000000000000000 <account_kernel_stack>:
> 0: 03e0082d move at,ra
> 4: 0c000000 jal 0 <account_kernel_stack>
> 4: R_MIPS_26 _mcount
> 4: R_MIPS_NONE *ABS*
> 4: R_MIPS_NONE *ABS*
> 8: 0000602d move t0,zero
> c: 2402000d li v0,13
> 10: 3c030000 lui v1,0x0
> 10: R_MIPS_HI16 mem_section
> 10: R_MIPS_NONE *ABS*
> 10: R_MIPS_NONE *ABS*
> 14: 000216fc dsll32 v0,v0,0x1b
> 18: 64630000 daddiu v1,v1,0
>
> Is it dependent on the config?
Yes.
You need to select a 32-bit kernel (which in turn may require selecting
a board type that also supports it).
The ABI is different for 32-bit and 64-bit _mcount.
David Daney
>
>>
>> Or add support to GCC for a better tracing ABI (as I already said we did
>> for mips64).
>
> I wouldn't waste time changing gcc for this. If you're going to change
> gcc than please implement the -mfentry option. Look at x86_64 to
> understand this more.
A good point. But I don't really plan on doing any work related to
32-bit mips things at this point, so any such change would have to be
done by someone else.
David Daney
next prev parent reply other threads:[~2013-01-15 21:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-11 14:33 [PATCH] mips: function tracer: Fix broken function tracing Al Cooper
2013-01-11 17:01 ` David Daney
2013-01-14 21:10 ` Alan Cooper
2013-01-14 22:12 ` David Daney
2013-01-15 0:13 ` Alan Cooper
2013-01-15 0:36 ` David Daney
2013-01-15 3:40 ` Steven Rostedt
2013-01-15 17:53 ` Alan Cooper
2013-01-15 21:08 ` Steven Rostedt
2013-01-15 17:55 ` David Daney
2013-01-15 21:07 ` Steven Rostedt
2013-01-15 21:34 ` David Daney [this message]
2013-01-15 22:42 ` Alan Cooper
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=50F5CB78.20800@gmail.com \
--to=ddaney.cavm@gmail.com \
--cc=alcooperx@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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