Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage

2020-10-13 Thread Arnaldo Carvalho de Melo
Em Mon, Oct 12, 2020 at 08:59:36AM +1100, Stephen Rothwell escreveu:
> Hi all,
> 
> On Fri, 9 Oct 2020 14:41:11 +0200 Jiri Olsa  wrote:
> >
> > On Fri, Oct 09, 2020 at 02:25:23PM +0200, Vasily Gorbik wrote:
> > > Currently BUILD_BUG() macro is expanded to smth like the following:
> > >do {
> > >extern void __compiletime_assert_0(void)
> > >__attribute__((error("BUILD_BUG failed")));
> > >if (!(!(1)))
> > >__compiletime_assert_0();
> > >} while (0);
> > > 
> > > If used in a function body this obviously would produce build errors
> > > with -Wnested-externs and -Werror.
> > > 
> > > To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
> > > includes in intel-pt-decoder, build perf without -Wnested-externs.
> > > 
> > > Reported-by: Stephen Rothwell 
> > > Signed-off-by: Vasily Gorbik   
> > 
> > that one applied nicely ;-) thanks
> > 
> > Acked-by: Jiri Olsa 
> 
> I will apply that patch to the merge of the tip tree today (instead of
> reverting the series I reverted in Friday) (unless I get an update of
> the tip tree containing it, of course).

Applied to perf/core that will go to Linus this week, maybe even today.

- Arnaldo


Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage

2020-10-13 Thread Arnaldo Carvalho de Melo
Em Fri, Oct 09, 2020 at 02:41:11PM +0200, Jiri Olsa escreveu:
> On Fri, Oct 09, 2020 at 02:25:23PM +0200, Vasily Gorbik wrote:
> > Currently BUILD_BUG() macro is expanded to smth like the following:
> >do {
> >extern void __compiletime_assert_0(void)
> >__attribute__((error("BUILD_BUG failed")));
> >if (!(!(1)))
> >__compiletime_assert_0();
> >} while (0);
> > 
> > If used in a function body this obviously would produce build errors
> > with -Wnested-externs and -Werror.
> > 
> > To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
> > includes in intel-pt-decoder, build perf without -Wnested-externs.
> > 
> > Reported-by: Stephen Rothwell 
> > Signed-off-by: Vasily Gorbik 
> 
> that one applied nicely ;-) thanks
> 
> Acked-by: Jiri Olsa 



Thanks, applied.

- Arnaldo



Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage

2020-10-12 Thread Sedat Dilek
On Fri, Oct 9, 2020 at 8:35 PM Vasily Gorbik  wrote:
>
> Currently BUILD_BUG() macro is expanded to smth like the following:

Two feedbacks:

#1: Greg KH told me to expand abbreviated words, here "smth = something".

#2: Interesting to see an ASCII-art in the signature is causing such troubles.

- Sedat -


>do {
>extern void __compiletime_assert_0(void)
>__attribute__((error("BUILD_BUG failed")));
>if (!(!(1)))
>__compiletime_assert_0();
>} while (0);
>
> If used in a function body this obviously would produce build errors
> with -Wnested-externs and -Werror.
>
> To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
> includes in intel-pt-decoder, build perf without -Wnested-externs.
>
> Reported-by: Stephen Rothwell 
> Signed-off-by: Vasily Gorbik 
> ---
>  Resend with no fancy signatures.
>
>  tools/perf/Makefile.config | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index 854da830b5ca..834061e94e7c 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -16,7 +16,7 @@ $(shell printf "" > $(OUTPUT).config-detected)
>  detected = $(shell echo "$(1)=y"   >> $(OUTPUT).config-detected)
>  detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
>
> -CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
> +CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
>
>  include $(srctree)/tools/scripts/Makefile.arch
>
> --
> 2.25.4


Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage

2020-10-11 Thread Stephen Rothwell
Hi all,

On Mon, 12 Oct 2020 08:59:36 +1100 Stephen Rothwell  
wrote:
>
> On Fri, 9 Oct 2020 14:41:11 +0200 Jiri Olsa  wrote:
> >
> > On Fri, Oct 09, 2020 at 02:25:23PM +0200, Vasily Gorbik wrote:  
> > > Currently BUILD_BUG() macro is expanded to smth like the following:
> > >do {
> > >extern void __compiletime_assert_0(void)
> > >__attribute__((error("BUILD_BUG failed")));
> > >if (!(!(1)))
> > >__compiletime_assert_0();
> > >} while (0);
> > > 
> > > If used in a function body this obviously would produce build errors
> > > with -Wnested-externs and -Werror.
> > > 
> > > To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
> > > includes in intel-pt-decoder, build perf without -Wnested-externs.
> > > 
> > > Reported-by: Stephen Rothwell 
> > > Signed-off-by: Vasily Gorbik 
> > 
> > that one applied nicely ;-) thanks
> > 
> > Acked-by: Jiri Olsa   
> 
> I will apply that patch to the merge of the tip tree today (instead of
> reverting the series I reverted in Friday) (unless I get an update of
> the tip tree containing it, of course).

Tested-by: Stephen Rothwell  # build tested

-- 
Cheers,
Stephen Rothwell


pgpjfEKz89xom.pgp
Description: OpenPGP digital signature


Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage

2020-10-11 Thread Stephen Rothwell
Hi all,

On Fri, 9 Oct 2020 14:41:11 +0200 Jiri Olsa  wrote:
>
> On Fri, Oct 09, 2020 at 02:25:23PM +0200, Vasily Gorbik wrote:
> > Currently BUILD_BUG() macro is expanded to smth like the following:
> >do {
> >extern void __compiletime_assert_0(void)
> >__attribute__((error("BUILD_BUG failed")));
> >if (!(!(1)))
> >__compiletime_assert_0();
> >} while (0);
> > 
> > If used in a function body this obviously would produce build errors
> > with -Wnested-externs and -Werror.
> > 
> > To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
> > includes in intel-pt-decoder, build perf without -Wnested-externs.
> > 
> > Reported-by: Stephen Rothwell 
> > Signed-off-by: Vasily Gorbik   
> 
> that one applied nicely ;-) thanks
> 
> Acked-by: Jiri Olsa 

I will apply that patch to the merge of the tip tree today (instead of
reverting the series I reverted in Friday) (unless I get an update of
the tip tree containing it, of course).

-- 
Cheers,
Stephen Rothwell


pgpGvb2wZGvlZ.pgp
Description: OpenPGP digital signature


Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage

2020-10-09 Thread Jiri Olsa
On Fri, Oct 09, 2020 at 02:25:23PM +0200, Vasily Gorbik wrote:
> Currently BUILD_BUG() macro is expanded to smth like the following:
>do {
>extern void __compiletime_assert_0(void)
>__attribute__((error("BUILD_BUG failed")));
>if (!(!(1)))
>__compiletime_assert_0();
>} while (0);
> 
> If used in a function body this obviously would produce build errors
> with -Wnested-externs and -Werror.
> 
> To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
> includes in intel-pt-decoder, build perf without -Wnested-externs.
> 
> Reported-by: Stephen Rothwell 
> Signed-off-by: Vasily Gorbik 

that one applied nicely ;-) thanks

Acked-by: Jiri Olsa 

jirka

> ---
>  Resend with no fancy signatures.
> 
>  tools/perf/Makefile.config | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index 854da830b5ca..834061e94e7c 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -16,7 +16,7 @@ $(shell printf "" > $(OUTPUT).config-detected)
>  detected = $(shell echo "$(1)=y"   >> $(OUTPUT).config-detected)
>  detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
>  
> -CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
> +CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
>  
>  include $(srctree)/tools/scripts/Makefile.arch
>  
> -- 
> 2.25.4
> 



[PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage

2020-10-09 Thread Vasily Gorbik
Currently BUILD_BUG() macro is expanded to smth like the following:
   do {
   extern void __compiletime_assert_0(void)
   __attribute__((error("BUILD_BUG failed")));
   if (!(!(1)))
   __compiletime_assert_0();
   } while (0);

If used in a function body this obviously would produce build errors
with -Wnested-externs and -Werror.

To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
includes in intel-pt-decoder, build perf without -Wnested-externs.

Reported-by: Stephen Rothwell 
Signed-off-by: Vasily Gorbik 
---
 Resend with no fancy signatures.

 tools/perf/Makefile.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 854da830b5ca..834061e94e7c 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -16,7 +16,7 @@ $(shell printf "" > $(OUTPUT).config-detected)
 detected = $(shell echo "$(1)=y"   >> $(OUTPUT).config-detected)
 detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
 
-CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
+CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
 
 include $(srctree)/tools/scripts/Makefile.arch
 
-- 
2.25.4