Skip to contentSkip to conversation

perf tools: Fix build failture on perl script context

PATCH In review Namhyung Kim 3 participants 7 messages Aug 2, 2016 – Aug 4, 2016 perf events

lore
Share & tools
lore

Namhyung Kim

author maintainer
#0 lore raw

PATCH 1/1 perf tools: Fix build failture on perl script context

On my Archlinux machine, perf faild to build like below:

CC scripts/perl/Perf-Trace-Util/Context.o
In file included from /usr/lib/perl5/core/perl/CORE/perl.h:3905:0,

                   from Context.xs:23:
  /usr/lib/perl5/core/perl/CORE/inline.h: In function :
  /usr/lib/perl5/core/perl/CORE/cop.h:612:13: warning: declaration of 'av'
                                  shadows a previous local [-Werror-shadow]
             AV *av =3D GvAV(PL_defgv);
                 ^
  /usr/lib/perl5/core/perl/CORE/inline.h:526:5: note: in expansion of
                                  macro 'CX_POP_SAVEARRAY'
         CX_POP_SAVEARRAY(cx);
         ^~~~~~~~~~~~~~~~
  In file included from /usr/lib/perl5/core/perl/CORE/perl.h:5853:0,
                   from Context.xs:23:
  /usr/lib/perl5/core/perl/CORE/inline.h:518:9: note:
                                  shadowed declaration is here
         AV *av;
             ^~
---
 tools/perf/scripts/perl/Perf-Trace-Util/Build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/scripts/perl/Perf-Trace-Util/Build +3 -1
index 928e110179cb..34faecf774ae 100644
@@ -1,3 +1,5 @@
 libperf-y += Context.o
 
-CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default
+CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
+CFLAGS_Context.o += -Wno-switch-default -Wno-shadow
Signature · 1 line
2.9.2
#1 lore raw

Em Tue, Aug 02, 2016 at 11:43:17AM +0900, Namhyung Kim escreveu:

Quoted 4 lines

On my Archlinux machine, perf faild to build like below:

CC scripts/perl/Perf-Trace-Util/Context.o
In file included from /usr/lib/perl5/core/perl/CORE/perl.h:3905:0,

Quoted 16 lines
                   from Context.xs:23:
  /usr/lib/perl5/core/perl/CORE/inline.h: In function :
  /usr/lib/perl5/core/perl/CORE/cop.h:612:13: warning: declaration of 'av'
                                  shadows a previous local [-Werror-shadow]
             AV *av =3D GvAV(PL_defgv);
                 ^
  /usr/lib/perl5/core/perl/CORE/inline.h:526:5: note: in expansion of
                                  macro 'CX_POP_SAVEARRAY'
         CX_POP_SAVEARRAY(cx);
         ^~~~~~~~~~~~~~~~
  In file included from /usr/lib/perl5/core/perl/CORE/perl.h:5853:0,
                   from Context.xs:23:
  /usr/lib/perl5/core/perl/CORE/inline.h:518:9: note:
                                  shadowed declaration is here
         AV *av;
             ^~

Ok, reproduced here with yet another container image for regularly building perf:

CC /tmp/build/perf/util/usage.o
In file included from /usr/lib/perl5/core_perl/CORE/perl.h:3905:0,

                 from Context.xs:23:
/usr/lib/perl5/core_perl/CORE/inline.h: In function 'S_cx_popsub_args':
/usr/lib/perl5/core_perl/CORE/cop.h:612:13: error: declaration of 'av'
shadows a previous local [-Werror=shadow]
         AV *av = GvAV(PL_defgv);
\
             ^
/usr/lib/perl5/core_perl/CORE/inline.h:526:5: note: in expansion of
macro 'CX_POP_SAVEARRAY'
     CX_POP_SAVEARRAY(cx);
     ^~~~~~~~~~~~~~~~
In file included from /usr/lib/perl5/core_perl/CORE/perl.h:5853:0,
                 from Context.xs:23:
/usr/lib/perl5/core_perl/CORE/inline.h:518:9: note: shadowed declaration
is here
     AV *av;
         ^~

CC /tmp/build/perf/util/dso.o
cc1: all warnings being treated as errors
mv: cannot stat '/tmp/build/perf/scripts/perl/Perf-Trace-Util/.Context.o.tmp': No such file or directory
make[4]: *** [/git/linux/tools/build/Makefile.build:78:
/tmp/build/perf/scripts/perl/Perf-Trace-Util/Context.o] Error 1 make[3]: *** [/git/linux/tools/build/Makefile.build:116:
perl/Perf-Trace-Util] Error 2
make[2]: *** [/git/linux/tools/build/Makefile.build:116: scripts] Error 2
make[2]: *** Waiting for unfinished jobs....
CC /tmp/build/perf/util/symbol.o

---------------------------------------------------

this time based on:

docker run -v /home/acme/git:/git:Z --rm -ti docker.io/base/archlinux:2015.06.01 /bin/bash pacman -Syu --noconfirm && pacman -Sy --noconfirm make gcc flex bison

----

thanks for the patch, will test and push out.

- Arnaldo

Quoted 19 lines
---
 tools/perf/scripts/perl/Perf-Trace-Util/Build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/scripts/perl/Perf-Trace-Util/Build +3 -1
index 928e110179cb..34faecf774ae 100644
@@ -1,3 +1,5 @@
 libperf-y += Context.o
 
-CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default
+CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
+CFLAGS_Context.o += -Wno-switch-default -Wno-shadow
Signature · 1 line
2.9.2
#2 lore raw
In reply to Namhyung Kim

Em Tue, Aug 02, 2016 at 11:43:17AM +0900, Namhyung Kim escreveu:

Quoted 4 lines

On my Archlinux machine, perf faild to build like below:

CC scripts/perl/Perf-Trace-Util/Context.o
In file included from /usr/lib/perl5/core/perl/CORE/perl.h:3905:0,

Quoted 16 lines
                   from Context.xs:23:
  /usr/lib/perl5/core/perl/CORE/inline.h: In function :
  /usr/lib/perl5/core/perl/CORE/cop.h:612:13: warning: declaration of 'av'
                                  shadows a previous local [-Werror-shadow]
             AV *av =3D GvAV(PL_defgv);
                 ^
  /usr/lib/perl5/core/perl/CORE/inline.h:526:5: note: in expansion of
                                  macro 'CX_POP_SAVEARRAY'
         CX_POP_SAVEARRAY(cx);
         ^~~~~~~~~~~~~~~~
  In file included from /usr/lib/perl5/core/perl/CORE/perl.h:5853:0,
                   from Context.xs:23:
  /usr/lib/perl5/core/perl/CORE/inline.h:518:9: note:
                                  shadowed declaration is here
         AV *av;
             ^~

But you forgot to describe _what_ you did to "fix" the problem besides breaking down a long line, i.e. adding -Wno-shadow, is that what we want? To ignore such warnings?

Some explanation in the changelog as to why that is the wise solution would help a lot :-\

- Arnaldo

Quoted 19 lines
---
 tools/perf/scripts/perl/Perf-Trace-Util/Build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/scripts/perl/Perf-Trace-Util/Build +3 -1
index 928e110179cb..34faecf774ae 100644
@@ -1,3 +1,5 @@
 libperf-y += Context.o
 
-CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default
+CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
+CFLAGS_Context.o += -Wno-switch-default -Wno-shadow
Signature · 1 line
2.9.2
author maintainer
#3 lore raw

Hi Arnaldo,

Quoted 22 lines · Arnaldo Carvalho de Melo

Em Tue, Aug 02, 2016 at 11:43:17AM +0900, Namhyung Kim escreveu:

Quoted 4 lines

On my Archlinux machine, perf faild to build like below:

CC scripts/perl/Perf-Trace-Util/Context.o
In file included from /usr/lib/perl5/core/perl/CORE/perl.h:3905:0,

Quoted 16 lines
                   from Context.xs:23:
  /usr/lib/perl5/core/perl/CORE/inline.h: In function :
  /usr/lib/perl5/core/perl/CORE/cop.h:612:13: warning: declaration of 'av'
                                  shadows a previous local [-Werror-shadow]
             AV *av =3D GvAV(PL_defgv);
                 ^
  /usr/lib/perl5/core/perl/CORE/inline.h:526:5: note: in expansion of
                                  macro 'CX_POP_SAVEARRAY'
         CX_POP_SAVEARRAY(cx);
         ^~~~~~~~~~~~~~~~
  In file included from /usr/lib/perl5/core/perl/CORE/perl.h:5853:0,
                   from Context.xs:23:
  /usr/lib/perl5/core/perl/CORE/inline.h:518:9: note:
                                  shadowed declaration is here
         AV *av;
             ^~
Quoted 6 lines

But you forgot to describe _what_ you did to "fix" the problem besides breaking down a long line, i.e. adding -Wno-shadow, is that what we want? To ignore such warnings?

Some explanation in the changelog as to why that is the wise solution would help a lot :-\

Oops, sorry.

What I did to fix is adding '-Wno-shadow' as the error message said it's the cause of the failure. Since it's from the perl (not perf) code base, we don't have the control so I just wanted to ignore the warning when compiling perl scripting code.

Is it ok for you?

Thanks,
Namhyung

Quoted 19 lines
Quoted 19 lines
---
 tools/perf/scripts/perl/Perf-Trace-Util/Build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/scripts/perl/Perf-Trace-Util/Build +3 -1
index 928e110179cb..34faecf774ae 100644
@@ -1,3 +1,5 @@
 libperf-y += Context.o
 
-CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default
+CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
+CFLAGS_Context.o += -Wno-switch-default -Wno-shadow
Signature · 1 line
2.9.2
#4 lore raw

Em Tue, Aug 02, 2016 at 11:03:02PM +0900, Namhyung Kim escreveu:

Quoted 32 lines

Hi Arnaldo,

Quoted 22 lines · Arnaldo Carvalho de Melo

Em Tue, Aug 02, 2016 at 11:43:17AM +0900, Namhyung Kim escreveu:

Quoted 4 lines

On my Archlinux machine, perf faild to build like below:

CC scripts/perl/Perf-Trace-Util/Context.o
In file included from /usr/lib/perl5/core/perl/CORE/perl.h:3905:0,

Quoted 16 lines
                   from Context.xs:23:
  /usr/lib/perl5/core/perl/CORE/inline.h: In function :
  /usr/lib/perl5/core/perl/CORE/cop.h:612:13: warning: declaration of 'av'
                                  shadows a previous local [-Werror-shadow]
             AV *av =3D GvAV(PL_defgv);
                 ^
  /usr/lib/perl5/core/perl/CORE/inline.h:526:5: note: in expansion of
                                  macro 'CX_POP_SAVEARRAY'
         CX_POP_SAVEARRAY(cx);
         ^~~~~~~~~~~~~~~~
  In file included from /usr/lib/perl5/core/perl/CORE/perl.h:5853:0,
                   from Context.xs:23:
  /usr/lib/perl5/core/perl/CORE/inline.h:518:9: note:
                                  shadowed declaration is here
         AV *av;
             ^~
Quoted 6 lines

But you forgot to describe _what_ you did to "fix" the problem besides breaking down a long line, i.e. adding -Wno-shadow, is that what we want? To ignore such warnings?

Some explanation in the changelog as to why that is the wise solution would help a lot :-\

Quoted 8 lines

Oops, sorry.

What I did to fix is adding '-Wno-shadow' as the error message said it's the cause of the failure. Since it's from the perl (not perf) code base, we don't have the control so I just wanted to ignore the warning when compiling perl scripting code.

Is it ok for you?

Now it is :-)

I'll stick this to the changeset log as the reason for adding -wno-shadow just for building the perl code.

Sometimes we'll get to this conclusion after some thinking, if you add these explanations to the changelog then it speeds up reviewing.

Thanks,

- Arnaldo

Quoted 23 lines

Thanks,
Namhyung

Quoted 19 lines
Quoted 19 lines
---
 tools/perf/scripts/perl/Perf-Trace-Util/Build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/scripts/perl/Perf-Trace-Util/Build +3 -1
index 928e110179cb..34faecf774ae 100644
@@ -1,3 +1,5 @@
 libperf-y += Context.o
 
-CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default
+CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
+CFLAGS_Context.o += -Wno-switch-default -Wno-shadow
Signature · 1 line
2.9.2
#5 lore raw

Em Tue, Aug 02, 2016 at 11:12:32AM -0300, Arnaldo Carvalho de Melo escreveu:

Quoted 8 lines

Em Tue, Aug 02, 2016 at 11:03:02PM +0900, Namhyung Kim escreveu:

Quoted 6 lines

What I did to fix is adding '-Wno-shadow' as the error message said it's the cause of the failure. Since it's from the perl (not perf) code base, we don't have the control so I just wanted to ignore the warning when compiling perl scripting code.

Is it ok for you?

Quoted 7 lines

Now it is :-)

I'll stick this to the changeset log as the reason for adding -wno-shadow just for building the perl code.

Sometimes we'll get to this conclusion after some thinking, if you add these explanations to the changelog then it speeds up reviewing.

Cool, this fixed the build as well for fedora rawhide.

- Arnaldo

#6 lore raw

[tip:perf/urgent] perf tools: Fix build failure on perl script context

In reply to Namhyung Kim
perf tools: Fix build failure on perl script context
Commit-ID:  b581c01fff646b5075d65359c8667de9c667da9e
Gitweb:     http://git.kernel.org/tip/b581c01fff646b5075d65359c8667de9c667da9e
Author:     Namhyung Kim <[email protected]>
AuthorDate: Tue, 2 Aug 2016 11:43:17 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 2 Aug 2016 12:11:06 -0300

perf tools: Fix build failure on perl script context

On my Archlinux machine, perf faild to build like below:

CC scripts/perl/Perf-Trace-Util/Context.o
In file included from /usr/lib/perl5/core/perl/CORE/perl.h:3905:0,

                   from Context.xs:23:
  /usr/lib/perl5/core/perl/CORE/inline.h: In function :
  /usr/lib/perl5/core/perl/CORE/cop.h:612:13: warning: declaration of 'av'
                                  shadows a previous local [-Werror-shadow]
             AV *av =3D GvAV(PL_defgv);
                 ^
  /usr/lib/perl5/core/perl/CORE/inline.h:526:5: note: in expansion of
                                  macro 'CX_POP_SAVEARRAY'
         CX_POP_SAVEARRAY(cx);
         ^~~~~~~~~~~~~~~~
  In file included from /usr/lib/perl5/core/perl/CORE/perl.h:5853:0,
                   from Context.xs:23:
  /usr/lib/perl5/core/perl/CORE/inline.h:518:9: note:
                                  shadowed declaration is here
         AV *av;
             ^~

What I did to fix is adding '-Wno-shadow' as the error message said it's the cause of the failure. Since it's from the perl (not perf) code base, we don't have the control so I just wanted to ignore the warning when compiling perl scripting code.

Committer note:

This also fixes the build on Fedora Rawhide.

---
 tools/perf/scripts/perl/Perf-Trace-Util/Build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/scripts/perl/Perf-Trace-Util/Build +3 -1
index 928e110..34faecf 100644
@@ -1,3 +1,5 @@
 libperf-y += Context.o
 
-CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default
+CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
+CFLAGS_Context.o += -Wno-switch-default -Wno-shadow