]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ftrace: handle generic arch calls
authorSteven Rostedt <rostedt@goodmis.org>
Thu, 23 Oct 2008 13:32:57 +0000 (09:32 -0400)
committerIngo Molnar <mingo@elte.hu>
Thu, 23 Oct 2008 13:58:19 +0000 (15:58 +0200)
The recordmcount script requires that the actual arch is passed in.
This works well when ARCH=i386 or ARCH=x86_64 but does not handle the
case of ARCH=x86.

This patch adds a parameter to the function to pass in the number of
bits of the architecture. So that it can determine if x86 should be
run for x86_64 or i386 archs.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
scripts/Makefile.build
scripts/recordmcount.pl

index 5ed4cbf1e0e1f412346431a870f1300a2d77a50b..468fbc9016c7b0773db9073a28f655bdf31e372d 100644 (file)
@@ -198,10 +198,16 @@ cmd_modversions =                                                 \
        fi;
 endif
 
+ifdef CONFIG_64BIT
+arch_bits = 64
+else
+arch_bits = 32
+endif
+
 ifdef CONFIG_FTRACE_MCOUNT_RECORD
 cmd_record_mcount = perl $(srctree)/scripts/recordmcount.pl \
-       "$(ARCH)" "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" \
-       "$(MV)" "$(@)";
+       "$(ARCH)" "$(arch_bits)" "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" \
+       "$(NM)" "$(RM)" "$(MV)" "$(@)";
 endif
 
 define rule_cc_o_c
index f56d760bd589d47ff8e59762eac2ae36424e35aa..c1c618cd96f6d13c93f3973e4d3c408e9505d82e 100755 (executable)
@@ -106,7 +106,8 @@ if ($#ARGV < 6) {
        exit(1);
 }
 
-my ($arch, $objdump, $objcopy, $cc, $ld, $nm, $rm, $mv, $inputfile) = @ARGV;
+my ($arch, $bits, $objdump, $objcopy, $cc,
+    $ld, $nm, $rm, $mv, $inputfile) = @ARGV;
 
 $objdump = "objdump" if ((length $objdump) == 0);
 $objcopy = "objcopy" if ((length $objcopy) == 0);
@@ -129,6 +130,14 @@ my $function_regex;        # Find the name of a function
                        #    (return offset and func name)
 my $mcount_regex;      # Find the call site to mcount (return offset)
 
+if ($arch eq "x86") {
+    if ($bits == 64) {
+       $arch = "x86_64";
+    } else {
+       $arch = "i386";
+    }
+}
+
 if ($arch eq "x86_64") {
     $section_regex = "Disassembly of section";
     $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";