From 8c3da0b031eb88dde2f6eb5893dea671577e396f Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Thu, 23 Oct 2008 09:32:57 -0400 Subject: [PATCH] --- yaml --- r: 117996 b: refs/heads/master c: dce9d18adde74b8e36b9e4a8a49ddf066bad0b3b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/scripts/Makefile.build | 10 ++++++++-- trunk/scripts/recordmcount.pl | 11 ++++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 9807fb70c2bf..eaa1ca8275e8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6ae2a0765ab764da11cc305058ee5333810228f4 +refs/heads/master: dce9d18adde74b8e36b9e4a8a49ddf066bad0b3b diff --git a/trunk/scripts/Makefile.build b/trunk/scripts/Makefile.build index 5ed4cbf1e0e1..468fbc9016c7 100644 --- a/trunk/scripts/Makefile.build +++ b/trunk/scripts/Makefile.build @@ -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 diff --git a/trunk/scripts/recordmcount.pl b/trunk/scripts/recordmcount.pl index f56d760bd589..c1c618cd96f6 100755 --- a/trunk/scripts/recordmcount.pl +++ b/trunk/scripts/recordmcount.pl @@ -106,7 +106,8 @@ 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 @@ # (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+<(.*?)>:";