* [PATCH] ftrace: handle generic arch calls
@ 2008-10-21 13:35 Steven Rostedt
2008-10-24 8:05 ` Adrian Bunk
0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2008-10-21 13:35 UTC (permalink / raw)
To: LKML
Cc: Adrian Bunk, Ingo Molnar, Thomas Gleixner, Linus Torvalds,
Andrew Morton, Sam Ravnborg, linux-kbuild
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>
---
scripts/Makefile.build | 10 ++++++++--
scripts/recordmcount.pl | 11 ++++++++++-
2 files changed, 18 insertions(+), 3 deletions(-)
Index: linux-compile.git/scripts/Makefile.build
===================================================================
--- linux-compile.git.orig/scripts/Makefile.build 2008-10-21 09:25:45.000000000 -0400
+++ linux-compile.git/scripts/Makefile.build 2008-10-21 09:26:05.000000000 -0400
@@ -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: linux-compile.git/scripts/recordmcount.pl
===================================================================
--- linux-compile.git.orig/scripts/recordmcount.pl 2008-10-21 09:25:45.000000000 -0400
+++ linux-compile.git/scripts/recordmcount.pl 2008-10-21 09:28:36.000000000 -0400
@@ -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
# (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 = "xi386";
+ }
+}
+
if ($arch eq "x86_64") {
$section_regex = "Disassembly of section";
$function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ftrace: handle generic arch calls
2008-10-21 13:35 [PATCH] ftrace: handle generic arch calls Steven Rostedt
@ 2008-10-24 8:05 ` Adrian Bunk
0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2008-10-24 8:05 UTC (permalink / raw)
To: Steven Rostedt
Cc: LKML, Ingo Molnar, Thomas Gleixner, Linus Torvalds,
Andrew Morton, Sam Ravnborg, linux-kbuild
On Tue, Oct 21, 2008 at 09:35:26AM -0400, Steven Rostedt wrote:
>
> 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.
>...
> --- linux-compile.git.orig/scripts/recordmcount.pl 2008-10-21 09:25:45.000000000 -0400
> +++ linux-compile.git/scripts/recordmcount.pl 2008-10-21 09:28:36.000000000 -0400
>...
> @@ -129,6 +130,14 @@ my $function_regex; # Find the name of a
> # (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 = "xi386";
>...
After fixing the obvious typo here the 32bit build worked for me.
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-24 8:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-21 13:35 [PATCH] ftrace: handle generic arch calls Steven Rostedt
2008-10-24 8:05 ` Adrian Bunk
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).