2008-10-22 18:52:59

by Steven Rostedt

[permalink] [raw]
Subject: [PATCH 01/11] ftrace: handle generic arch calls

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 <[email protected]>
---
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+<(.*?)>:";

--


2008-10-22 18:58:24

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH 01/11] ftrace: handle generic arch calls

On Wed, 22 Oct 2008 14:43:14 -0400
Steven Rostedt <[email protected]> wrote:

> +if ($arch eq "x86") {
> + if ($bits == 64) {
> + $arch = "x86_64";
> + } else {
> + $arch = "xi386";

?

> + }

(how well was this tested?)

2008-10-22 19:03:19

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 01/11] ftrace: handle generic arch calls



On Wed, 22 Oct 2008, Andrew Morton wrote:

> On Wed, 22 Oct 2008 14:43:14 -0400
> Steven Rostedt <[email protected]> wrote:
>
> > +if ($arch eq "x86") {
> > + if ($bits == 64) {
> > + $arch = "x86_64";
> > + } else {
> > + $arch = "xi386";
>
> ?
>
> > + }
>
> (how well was this tested?)

I've tested this with !CONFIG_FTRACE, CONFIG_FTRACE &
!CONFIG_DYNAMIC_FTRACE, and CONFIG_FTRACE & CONFIG_DYNAMIC_FTRACE. I did
only test this on x86_64, so that explains why the i386 was broken :-(

I'll boot up my i386 box, and start running the tests there too.

-- Steve


2008-10-27 20:34:05

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 01/11] ftrace: handle generic arch calls


[
Resending patch.

Sam, can you Ack this?

-- Steve
]

From: Steven Rostedt <[email protected]>
Subject: ftrace: handle generic arch calls

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 <[email protected]>
---
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-22 15:09:04.000000000 -0400
+++ linux-compile.git/scripts/Makefile.build 2008-10-22 15:09:07.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-22 15:09:04.000000000 -0400
+++ linux-compile.git/scripts/recordmcount.pl 2008-10-22 15:09:45.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 = "i386";
+ }
+}
+
if ($arch eq "x86_64") {
$section_regex = "Disassembly of section";
$function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";

2008-10-29 19:04:11

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 01/11] ftrace: handle generic arch calls

On Mon, Oct 27, 2008 at 01:41:41PM -0400, Steven Rostedt wrote:
>
> [
> Resending patch.
>
> Sam, can you Ack this?
>
> -- Steve
> ]
>
> From: Steven Rostedt <[email protected]>
> Subject: ftrace: handle generic arch calls
>
> 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 <[email protected]>
> ---
> 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-22 15:09:04.000000000 -0400
> +++ linux-compile.git/scripts/Makefile.build 2008-10-22 15:09:07.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

A simple $(if $(CONFIG_64BIT),64,32) in the command would be more dense.

>
> define rule_cc_o_c
> Index: linux-compile.git/scripts/recordmcount.pl
> ===================================================================
> --- linux-compile.git.orig/scripts/recordmcount.pl 2008-10-22 15:09:04.000000000 -0400
> +++ linux-compile.git/scripts/recordmcount.pl 2008-10-22 15:09:45.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 = "i386";
> + }
> +}
> +
> if ($arch eq "x86_64") {
> $section_regex = "Disassembly of section";
> $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
>

This looks strange to my eyes.
Why not do the more obvious:
if ($arch eq "x86" && $bits == 64) {

The change above is like trying to stick to the old i386/x86_64
notation.

Sam

2008-10-29 19:14:40

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 01/11] ftrace: handle generic arch calls


On Wed, 29 Oct 2008, Sam Ravnborg wrote:

> On Mon, Oct 27, 2008 at 01:41:41PM -0400, Steven Rostedt wrote:
> >
> > [
> > Resending patch.
> >
> > Sam, can you Ack this?
> >
> > -- Steve
> > ]
> >
> > From: Steven Rostedt <[email protected]>
> > Subject: ftrace: handle generic arch calls
> >
> > 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 <[email protected]>
> > ---
> > 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-22 15:09:04.000000000 -0400
> > +++ linux-compile.git/scripts/Makefile.build 2008-10-22 15:09:07.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
>
> A simple $(if $(CONFIG_64BIT),64,32) in the command would be more dense.

OK, will fix.

>
> >
> > define rule_cc_o_c
> > Index: linux-compile.git/scripts/recordmcount.pl
> > ===================================================================
> > --- linux-compile.git.orig/scripts/recordmcount.pl 2008-10-22 15:09:04.000000000 -0400
> > +++ linux-compile.git/scripts/recordmcount.pl 2008-10-22 15:09:45.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 = "i386";
> > + }
> > +}
> > +
> > if ($arch eq "x86_64") {
> > $section_regex = "Disassembly of section";
> > $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
> >
>
> This looks strange to my eyes.
> Why not do the more obvious:
> if ($arch eq "x86" && $bits == 64) {
>
> The change above is like trying to stick to the old i386/x86_64
> notation.

Heh, you're right. This is from writing an update without wanting to
modify the original code too much. But it makes the end result ugly.

I'll create another patch to go on top of this one. We needed this one in
because without it, it broke "make ARCH=x86"

Thanks,

-- Steve

2008-10-29 19:24:30

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 01/11] ftrace: handle generic arch calls


On Wed, 29 Oct 2008, Sam Ravnborg wrote:
> >
> > +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+<(.*?)>:";
> >
>
> This looks strange to my eyes.
> Why not do the more obvious:
> if ($arch eq "x86" && $bits == 64) {
>
> The change above is like trying to stick to the old i386/x86_64
> notation.

Trying to fix it tells me my answer to why I did it his way ;-)

I have queued patches that will support other archs so x86 is not the
only arch that can be used here. But x86 is special, it seems to be the
only arch (that I know of, correct me if I'm wrong) that can compile with
multiple archs defined: make ARCH=x86_64, make ARCH=i386, or
make ARCH=x86. All are legit.

Now how do we handle this. I've been fine for all my testing to do just
x86_64 and i386 because a normal make of x86 will use automatically set
ARCH to i386 or x86_64 depending on the build.

But then Adrian Bunk pointed out that "make ARCH=x86" fails. Now I need to
add a case for x86, but still allow for x86_64 or i386 being passed in.

Since x86 is the ambiguous case, I made it the one that would be converted
to i386 or x86_64 since those could be passed in directly.

Seems that the best approach is still what is there :-/

-- Steve

2008-10-29 19:30:43

by Steven Rostedt

[permalink] [raw]
Subject: [PATCH] ftrace, kbuild: condense recordmcount.pl parameter code


Sam Ravnborg pointed out that I could condense the code for the parameters of
recordmcount.pl by using an $(if ...) condition.

Signed-off-by: Steven Rostedt <[email protected]>
---
scripts/Makefile.build | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

Index: linux-tip.git/scripts/Makefile.build
===================================================================
--- linux-tip.git.orig/scripts/Makefile.build 2008-10-27 15:29:01.000000000 -0400
+++ linux-tip.git/scripts/Makefile.build 2008-10-29 15:16:13.000000000 -0400
@@ -198,16 +198,10 @@ 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)" "$(arch_bits)" "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" \
- "$(NM)" "$(RM)" "$(MV)" "$(@)";
+cmd_record_mcount = perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
+ "$(if $(CONFIG_64BIT),64,32)" \
+ "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" "$(MV)" "$(@)";
endif

define rule_cc_o_c

2008-10-29 19:53:35

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 01/11] ftrace: handle generic arch calls

On Wed, Oct 29, 2008 at 03:24:19PM -0400, Steven Rostedt wrote:
>
> On Wed, 29 Oct 2008, Sam Ravnborg wrote:
> > >
> > > +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+<(.*?)>:";
> > >
> >
> > This looks strange to my eyes.
> > Why not do the more obvious:
> > if ($arch eq "x86" && $bits == 64) {
> >
> > The change above is like trying to stick to the old i386/x86_64
> > notation.
>
> Trying to fix it tells me my answer to why I did it his way ;-)
>
> I have queued patches that will support other archs so x86 is not the
> only arch that can be used here. But x86 is special, it seems to be the
> only arch (that I know of, correct me if I'm wrong) that can compile with
> multiple archs defined: make ARCH=x86_64, make ARCH=i386, or
> make ARCH=x86. All are legit.
>
> Now how do we handle this. I've been fine for all my testing to do just
> x86_64 and i386 because a normal make of x86 will use automatically set
> ARCH to i386 or x86_64 depending on the build.
>
> But then Adrian Bunk pointed out that "make ARCH=x86" fails. Now I need to
> add a case for x86, but still allow for x86_64 or i386 being passed in.
>
> Since x86 is the ambiguous case, I made it the one that would be converted
> to i386 or x86_64 since those could be passed in directly.
The trick is usually to replace use of ARCH with SRCARCH.

Sam

2008-10-29 20:18:23

by Adrian Bunk

[permalink] [raw]
Subject: Re: [PATCH 01/11] ftrace: handle generic arch calls

On Wed, Oct 29, 2008 at 08:49:56PM +0100, Sam Ravnborg wrote:
> On Wed, Oct 29, 2008 at 03:24:19PM -0400, Steven Rostedt wrote:
> >
> > On Wed, 29 Oct 2008, Sam Ravnborg wrote:
> > > >
> > > > +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+<(.*?)>:";
> > > >
> > >
> > > This looks strange to my eyes.
> > > Why not do the more obvious:
> > > if ($arch eq "x86" && $bits == 64) {
> > >
> > > The change above is like trying to stick to the old i386/x86_64
> > > notation.
> >
> > Trying to fix it tells me my answer to why I did it his way ;-)
> >
> > I have queued patches that will support other archs so x86 is not the
> > only arch that can be used here. But x86 is special, it seems to be the
> > only arch (that I know of, correct me if I'm wrong) that can compile with
> > multiple archs defined: make ARCH=x86_64, make ARCH=i386, or
> > make ARCH=x86. All are legit.
> >
> > Now how do we handle this. I've been fine for all my testing to do just
> > x86_64 and i386 because a normal make of x86 will use automatically set
> > ARCH to i386 or x86_64 depending on the build.
> >
> > But then Adrian Bunk pointed out that "make ARCH=x86" fails. Now I need to
> > add a case for x86, but still allow for x86_64 or i386 being passed in.
> >
> > Since x86 is the ambiguous case, I made it the one that would be converted
> > to i386 or x86_64 since those could be passed in directly.
> The trick is usually to replace use of ARCH with SRCARCH.

That won't help - what he wants to know is whether he's on 32bit or
on 64bit.

> Sam

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

2008-10-29 20:23:56

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 01/11] ftrace: handle generic arch calls


On Wed, 29 Oct 2008, Adrian Bunk wrote:
> > >
> > > Since x86 is the ambiguous case, I made it the one that would be converted
> > > to i386 or x86_64 since those could be passed in directly.
> > The trick is usually to replace use of ARCH with SRCARCH.
>
> That won't help - what he wants to know is whether he's on 32bit or
> on 64bit.

I will still get the "bits" parameter. The issue that we are talking about
here is that I have this ugly if statement that deals with the fact that
we can get "x86", "x86_64" or "i386" passed in as the ARCH. I'm guessing
if we switch ARCH to SRCARCH then we can just test against x86 and bits?

-- Steve

2008-10-29 20:24:25

by Adrian Bunk

[permalink] [raw]
Subject: Re: [PATCH 01/11] ftrace: handle generic arch calls

On Wed, Oct 29, 2008 at 03:24:19PM -0400, Steven Rostedt wrote:
>
> On Wed, 29 Oct 2008, Sam Ravnborg wrote:
> > >
> > > +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+<(.*?)>:";
> > >
> >
> > This looks strange to my eyes.
> > Why not do the more obvious:
> > if ($arch eq "x86" && $bits == 64) {
> >
> > The change above is like trying to stick to the old i386/x86_64
> > notation.
>
> Trying to fix it tells me my answer to why I did it his way ;-)
>
> I have queued patches that will support other archs so x86 is not the
> only arch that can be used here. But x86 is special, it seems to be the
> only arch (that I know of, correct me if I'm wrong) that can compile with
> multiple archs defined: make ARCH=x86_64, make ARCH=i386, or
> make ARCH=x86. All are legit.
>...

The multiple ARCH settings with different semantics for them are an
x86 curiosity.

But the MIPS, PowerPC and s390 architectures also have unified
32bit/64bit architectures, so whatever you do will most likely
also be required on these architectures.

> -- Steve

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

2008-10-29 20:33:00

by Adrian Bunk

[permalink] [raw]
Subject: Re: [PATCH 01/11] ftrace: handle generic arch calls

On Wed, Oct 29, 2008 at 04:23:34PM -0400, Steven Rostedt wrote:
>
> On Wed, 29 Oct 2008, Adrian Bunk wrote:
> > > >
> > > > Since x86 is the ambiguous case, I made it the one that would be converted
> > > > to i386 or x86_64 since those could be passed in directly.
> > > The trick is usually to replace use of ARCH with SRCARCH.
> >
> > That won't help - what he wants to know is whether he's on 32bit or
> > on 64bit.
>
> I will still get the "bits" parameter.

Ah, I didn't get this bit from your email.

> The issue that we are talking about
> here is that I have this ugly if statement that deals with the fact that
> we can get "x86", "x86_64" or "i386" passed in as the ARCH. I'm guessing
> if we switch ARCH to SRCARCH then we can just test against x86 and bits?

Yes.

And as a bonus you will automatically get the correct output when you'll
add support for UML.

> -- Steve

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

2008-10-30 23:38:33

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] ftrace, kbuild: condense recordmcount.pl parameter code


* Steven Rostedt <[email protected]> wrote:

>
> Sam Ravnborg pointed out that I could condense the code for the parameters of
> recordmcount.pl by using an $(if ...) condition.
>
> Signed-off-by: Steven Rostedt <[email protected]>
> ---
> scripts/Makefile.build | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)

Sam, would you like to see this cleanup in v2.6.28, or can it wait
until v2.6.29?

Ingo

2008-10-31 16:15:52

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH] ftrace, kbuild: condense recordmcount.pl parameter code

On Fri, Oct 31, 2008 at 12:37:33AM +0100, Ingo Molnar wrote:
>
> * Steven Rostedt <[email protected]> wrote:
>
> >
> > Sam Ravnborg pointed out that I could condense the code for the parameters of
> > recordmcount.pl by using an $(if ...) condition.
> >
> > Signed-off-by: Steven Rostedt <[email protected]>
> > ---
> > scripts/Makefile.build | 12 +++---------
> > 1 file changed, 3 insertions(+), 9 deletions(-)
>
> Sam, would you like to see this cleanup in v2.6.28, or can it wait
> until v2.6.29?

This is pure cleanup so it can/shall wait.

Sam