Patchwork [1/3] sh: dynamic ftrace support.

login
register
mail settings
Submitter Steven Rostedt
Date Nov. 20, 2008, 8:34 p.m.
Message ID <20081120203551.633484431@goodmis.org>
Download mbox | patch
Permalink /patch/9896/
State Accepted
Commit 0da85c09b44bfea07e63ed5324aabc7cfc8a889a
Headers show

Comments

Steven Rostedt - Nov. 20, 2008, 8:34 p.m.
From: Matt Fleming <mjf@gentoo.org>

First cut at dynamic ftrace support.

[
  Steven Rostedt - only updated the recordmcount.pl file.
    There are updates for PowerPC that will conflict with this,
    and we need to base off of these changes.
]

Signed-off-by: Matt Fleming <mjf@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 scripts/recordmcount.pl |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
Paul Mundt - Nov. 21, 2008, 7:44 a.m.
On Thu, Nov 20, 2008 at 03:34:16PM -0500, Steven Rostedt wrote:
> +} elsif ($arch eq "sh") {
> +    $section_regex = "Disassembly of section\\s+(\\S+):";
> +    $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
> +    $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
> +    $type = ".long";
> +
> +    # force flags for this arch
> +    $ld .= " -m shlelf_linux";
> +    $objcopy .= " -O elf32-sh-linux";
> +    $cc .= " -m32";
> +

Note that if the $alignment changes are in this version, you will also
need to add an $alignment = 2; for sh. That was in Matt's original patch,
but I stripped the alignment line out in the commit given that it was not
yet present in the mainline version of the script.
Matt Fleming - Nov. 21, 2008, 9 a.m.
On Fri, Nov 21, 2008 at 04:44:29PM +0900, Paul Mundt wrote:
> On Thu, Nov 20, 2008 at 03:34:16PM -0500, Steven Rostedt wrote:
> > +} elsif ($arch eq "sh") {
> > +    $section_regex = "Disassembly of section\\s+(\\S+):";
> > +    $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
> > +    $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
> > +    $type = ".long";
> > +
> > +    # force flags for this arch
> > +    $ld .= " -m shlelf_linux";
> > +    $objcopy .= " -O elf32-sh-linux";
> > +    $cc .= " -m32";
> > +
> 
> Note that if the $alignment changes are in this version, you will also
> need to add an $alignment = 2; for sh. That was in Matt's original patch,
> but I stripped the alignment line out in the commit given that it was not
> yet present in the mainline version of the script.

I've sent a patch to steven for his tip/devel branch that adds this line.

Patch

diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index eeac71c..9f75438 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -170,6 +170,17 @@  if ($arch eq "x86_64") {
     $objcopy .= " -O elf32-i386";
     $cc .= " -m32";
 
+} elsif ($arch eq "sh") {
+    $section_regex = "Disassembly of section\\s+(\\S+):";
+    $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
+    $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
+    $type = ".long";
+
+    # force flags for this arch
+    $ld .= " -m shlelf_linux";
+    $objcopy .= " -O elf32-sh-linux";
+    $cc .= " -m32";
+
 } else {
     die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD";
 }