linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sachin Sant <sachinp@in.ibm.com>
To: rostedt@goodmis.org
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [FTRACE] Enabling function_graph causes OOPS
Date: Wed, 07 Oct 2009 14:26:36 +0530	[thread overview]
Message-ID: <4ACC57C4.5010002@in.ibm.com> (raw)
In-Reply-To: <1254775073.13160.13.camel@gandalf.stny.rr.com>

[-- Attachment #1: Type: text/plain, Size: 2358 bytes --]

Steven Rostedt wrote:
> On Tue, 2009-10-06 at 07:20 +1100, Benjamin Herrenschmidt wrote:
>   
>> On Mon, 2009-10-05 at 09:25 -0400, Steven Rostedt wrote:
>>     
>>>>> Sachin, can you give me more details on how you built that kernel ? (or
>>>>> give them again in case I missed them the first time around :-), ie,
>>>>> what toolchain, options, etc... or even better, give me remote access to
>>>>> the build host ?
>>>>>           
>>>> Ok, got access and had a quick look... seems to be a toolchain problem
>>>> to me. I'll investigate more tomorrow.
>>>>         
>>> Hi Ben,
>>>
>>> Any more word on this issue? 
>>>       
>> Didn't you fix it using a TOC access ?
>>
>> Unless I'm confusing things, I think the problem is the usage
>> of LOAD_REG_IMMEDIATE which generates relocs that we don't support
>> when CONFIG_RELOCATABLE is set.
>>
>> I've merged a patch that post-processes the kernel now, to check
>> for such relocs so at least you should be warned at build time.
>>     
>
> I thought we had two issues. One was the use of the relocs that did
> cause issues. But then there was still crashes reported after that.
> IIRC. I'm still suffering jetlag, so my memory is not that fresh about
>   
As Ben suggested, i changed LOAD_REG_IMMEDIATE() to LOAD_REG_ADDR()
as follows.

-       LOAD_REG_IMMEDIATE(r4,ftrace_return_to_handler)
+       LOAD_REG_ADDR(r4,ftrace_return_to_handler)

With this change compile time warnings about bad relocations
related to ftrace are gone.

Before the change :
WARNING: 6 bad relocations
c000000000008f1a R_PPC64_ADDR16_HIGHEST  __ksymtab+0x0000000000742110
c000000000008f1e R_PPC64_ADDR16_HIGHER  __ksymtab+0x0000000000742110
c000000000008f26 R_PPC64_ADDR16_HI  __ksymtab+0x0000000000742110
c000000000008f2a R_PPC64_ADDR16_LO  __ksymtab+0x0000000000742110
c00000000085e118 R_PPC64_ADDR64    __crc_per_cpu__softirq_work_list
c0000000008662d0 R_PPC64_ADDR64    __crc_simple_prepare_write

After the change :
WARNING: 2 bad relocations
c00000000085e118 R_PPC64_ADDR64    __crc_per_cpu__softirq_work_list
c0000000008662d0 R_PPC64_ADDR64    __crc_simple_prepare_write

But i still run into oops while using ftrace function_graph.

Thanks
-Sachin



-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------


[-- Attachment #2: fix-ftrace-bad-relocs.patch --]
[-- Type: text/x-patch, Size: 528 bytes --]

diff -Naurp a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
--- a/arch/powerpc/kernel/entry_64.S	2009-10-06 15:31:29.000000000 +0530
+++ b/arch/powerpc/kernel/entry_64.S	2009-10-06 15:34:00.000000000 +0530
@@ -1038,7 +1038,7 @@ _GLOBAL(mod_return_to_handler)
 	 * We are in a module using the module's TOC.
 	 * Switch to our TOC to run inside the core kernel.
 	 */
-	LOAD_REG_IMMEDIATE(r4,ftrace_return_to_handler)
+	LOAD_REG_ADDR(r4,ftrace_return_to_handler)
 	ld	r2, 8(r4)
 
 	bl	.ftrace_return_to_handler

  reply	other threads:[~2009-10-07  8:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-14 10:26 [FTRACE] Enabling function_graph causes OOPS Sachin Sant
2009-07-14 22:45 ` Steven Rostedt
2009-08-03 10:40   ` Sachin Sant
2009-09-09  1:05     ` Steven Rostedt
2009-09-09  6:27       ` Sachin Sant
2009-09-09 19:42         ` Steven Rostedt
2009-09-10  5:32           ` Sachin Sant
2009-09-11  3:05             ` Steven Rostedt
2009-09-11  4:26               ` Sachin Sant
2009-09-11 18:05             ` Steven Rostedt
2009-09-13  4:07         ` Steven Rostedt
2009-09-13  4:37           ` Benjamin Herrenschmidt
2009-09-13 13:21             ` Steven Rostedt
2009-09-13 20:25               ` Benjamin Herrenschmidt
2009-09-14  8:00                 ` Benjamin Herrenschmidt
2009-10-05 13:25                   ` Steven Rostedt
2009-10-05 20:20                     ` Benjamin Herrenschmidt
2009-10-05 20:37                       ` Steven Rostedt
2009-10-07  8:56                         ` Sachin Sant [this message]
2009-10-07  9:10                           ` Benjamin Herrenschmidt
2009-10-08 14:51                             ` [PATCH] Ftrace : fix function_graph tracer OOPS Sachin Sant
2009-10-14  3:01                               ` Steven Rostedt
2009-10-14  6:13                                 ` Sachin Sant
2009-10-14  6:15                                   ` Benjamin Herrenschmidt
2009-10-14 12:12                                     ` Steven Rostedt

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=4ACC57C4.5010002@in.ibm.com \
    --to=sachinp@in.ibm.com \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).