linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf arm64: Use local headers for target compiler
@ 2019-03-21 16:13 Daniel Thompson
  2019-03-21 16:39 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Thompson @ 2019-03-21 16:13 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo
  Cc: Daniel Thompson, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Kim Phillips, linux-kernel, patches

Currently the set of available syscalls is generated from the
target compilers default <asm-generic/unistd.h>
(i.e. /usr/include/asm-generic/unistd.h on a self-hosted system).
The numeric values are then generated by the host compiler using
tools/include/uapi/asm/unistd.h .

This leads to some nasty version skew problems (including failed perf
builds if you are running a bleeding edge distro and want to build an
older version of perf for testing).

Let's make the target compiler use the local headers too.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
---
 tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
index c88fd32563eb..1aca6a839e4f 100755
--- a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
+++ b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
@@ -56,7 +56,7 @@ create_table()
 	echo "};"
 }

-$gcc -E -dM -x c  $input	       \
-	|sed -ne 's/^#define __NR_//p' \
-	|sort -t' ' -k2 -nu	       \
+$gcc -I $incpath/include/uapi -E -dM -x c  $input \
+	|sed -ne 's/^#define __NR_//p'		  \
+	|sort -t' ' -k2 -nu			  \
 	|create_table
--
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf arm64: Use local headers for target compiler
  2019-03-21 16:13 [PATCH] perf arm64: Use local headers for target compiler Daniel Thompson
@ 2019-03-21 16:39 ` Arnaldo Carvalho de Melo
  2019-03-21 17:16   ` Daniel Thompson
  0 siblings, 1 reply; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-03-21 16:39 UTC (permalink / raw)
  To: Daniel Thompson
  Cc: Peter Zijlstra, Ingo Molnar, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, Kim Phillips, linux-kernel, patches

Em Thu, Mar 21, 2019 at 04:13:53PM +0000, Daniel Thompson escreveu:
> Currently the set of available syscalls is generated from the
> target compilers default <asm-generic/unistd.h>
> (i.e. /usr/include/asm-generic/unistd.h on a self-hosted system).

It shouldn't, Kim?

> The numeric values are then generated by the host compiler using
> tools/include/uapi/asm/unistd.h .
> 
> This leads to some nasty version skew problems (including failed perf
> builds if you are running a bleeding edge distro and want to build an
> older version of perf for testing).
> 
> Let's make the target compiler use the local headers too.
> 
> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
> ---
>  tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
> index c88fd32563eb..1aca6a839e4f 100755
> --- a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
> +++ b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
> @@ -56,7 +56,7 @@ create_table()
>  	echo "};"
>  }
> 
> -$gcc -E -dM -x c  $input	       \
> -	|sed -ne 's/^#define __NR_//p' \
> -	|sort -t' ' -k2 -nu	       \
> +$gcc -I $incpath/include/uapi -E -dM -x c  $input \
> +	|sed -ne 's/^#define __NR_//p'		  \
> +	|sort -t' ' -k2 -nu			  \
>  	|create_table
> --
> 2.20.1

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf arm64: Use local headers for target compiler
  2019-03-21 16:39 ` Arnaldo Carvalho de Melo
@ 2019-03-21 17:16   ` Daniel Thompson
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Thompson @ 2019-03-21 17:16 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Ingo Molnar, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, Kim Phillips, linux-kernel, patches

On Thu, Mar 21, 2019 at 01:39:17PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, Mar 21, 2019 at 04:13:53PM +0000, Daniel Thompson escreveu:
> > Currently the set of available syscalls is generated from the
> > target compilers default <asm-generic/unistd.h>
> > (i.e. /usr/include/asm-generic/unistd.h on a self-hosted system).
> 
> It shouldn't, Kim?

Adding a bit more detail... if I take that last line from mksyscalltbl
and run it without -dM we get the following:

ash$ gcc -E -x c $KDIR/tools/arch/arm64/include/uapi/asm/unistd.h | grep '^#'
# 1 "../arch/arm64/include/uapi/asm/unistd.h"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "../arch/arm64/include/uapi/asm/unistd.h"
# 21 "../arch/arm64/include/uapi/asm/unistd.h"
# 1 "/usr/include/asm-generic/unistd.h" 1 3 4
# 1 "/usr/include/asm/bitsperlong.h" 1 3 4
# 22 "/usr/include/asm/bitsperlong.h" 3 4
# 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4
# 23 "/usr/include/asm/bitsperlong.h" 2 3 4
# 3 "/usr/include/asm-generic/unistd.h" 2 3 4
# 34 "/usr/include/asm-generic/unistd.h" 3 4
# 502 "/usr/include/asm-generic/unistd.h" 3 4
# 707 "/usr/include/asm-generic/unistd.h" 3 4
# 828 "/usr/include/asm-generic/unistd.h" 3 4
# 21 "../arch/arm64/include/uapi/asm/unistd.h" 2

With the extra -I we pick up the included file from the $KDIR/tools
instead.


Daniel.

> 
> > The numeric values are then generated by the host compiler using
> > tools/include/uapi/asm/unistd.h .
> > 
> > This leads to some nasty version skew problems (including failed perf
> > builds if you are running a bleeding edge distro and want to build an
> > older version of perf for testing).
> > 
> > Let's make the target compiler use the local headers too.
> > 
> > Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
> > ---
> >  tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
> > index c88fd32563eb..1aca6a839e4f 100755
> > --- a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
> > +++ b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
> > @@ -56,7 +56,7 @@ create_table()
> >  	echo "};"
> >  }
> > 
> > -$gcc -E -dM -x c  $input	       \
> > -	|sed -ne 's/^#define __NR_//p' \
> > -	|sort -t' ' -k2 -nu	       \
> > +$gcc -I $incpath/include/uapi -E -dM -x c  $input \
> > +	|sed -ne 's/^#define __NR_//p'		  \
> > +	|sort -t' ' -k2 -nu			  \
> >  	|create_table
> > --
> > 2.20.1
> 
> -- 
> 
> - Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-21 17:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21 16:13 [PATCH] perf arm64: Use local headers for target compiler Daniel Thompson
2019-03-21 16:39 ` Arnaldo Carvalho de Melo
2019-03-21 17:16   ` Daniel Thompson

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).