Skip to contentSkip to conversation

perf tools: Fix build break on powerpc

PATCH In review Sukadev Bhattiprolu 3 participants 6 messages Mar 26, 2016 – Mar 28, 2016 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf tools: Fix build break on powerpc

=46rom 502e8236082412db1d33abfad95aaf14b539502e Mon Sep 17 00:00:00 2001 =46rom: Sukadev Bhattiprolu <[email protected]>
Date: Sat, 26 Mar 2016 17:31:39 -0400
Subject: [PATCH 1/1] perf tools: Fix build break on powerpc
MIME-Version: 1.0
Content-Type: text/plain; charset=3DUTF-8
Content-Transfer-Encoding: 8bit

'Commit 531d2410635c ("perf tools: Do not include stringify.h from the kernel sources")' seems to have accidentially removed the inclusion of "util/header.h" from "arch/powerpc/util/header.c".

"util/header.h" provides the prototype for get_cpuid() and is needed to build perf on Powerpc.

	arch/powerpc/util/header.c:17:1: error: no previous prototype for
	=E2=80=98get_cpuid=E2=80=99 [-Werror=3Dmissing-prototypes]
---
 tools/perf/arch/powerpc/util/header.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/arch/powerp= renamed from tools/perf/arch/powerpc/util/header.c +0 -0

c/util/header.c
index 6138bde..5111e34 100644

tools/perf/arch/powerpc/util/header.c +1 -0
@@ -4,6 +4,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <linux/stringify.h>
+#include "../../util/header.h"

=20
#define mfspr(rn) ({unsigned long rval; \
asm volatile("mfspr %0," __stringify(rn) \
--=20
1.8.3.1

#1 lore raw
Quoted 29 lines · Sukadev Bhattiprolu

From 502e8236082412db1d33abfad95aaf14b539502e Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <[email protected]>
Date: Sat, 26 Mar 2016 17:31:39 -0400
Subject: [PATCH 1/1] perf tools: Fix build break on powerpc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

'Commit 531d2410635c ("perf tools: Do not include stringify.h from the kernel sources")' seems to have accidentially removed the inclusion of "util/header.h" from "arch/powerpc/util/header.c".

"util/header.h" provides the prototype for get_cpuid() and is needed to build perf on Powerpc.

arch/powerpc/util/header.c:17:1: error: no previous prototype for ‘get_cpuid’ [-Werror=missing-prototypes]

---
 tools/perf/arch/powerpc/util/header.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/arch/powerpc/util/header.c +0 -0
index 6138bde..5111e34 100644

tools/perf/arch/powerpc/util/header.c line 7

Quoted 4 lines
tools/perf/arch/powerpc/util/header.c +1 -0
@@ -4,6 +4,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <linux/stringify.h>
+#include "../../util/header.h"

you could use just "header.h" right?

jirka

#2 lore raw

Em Sun, Mar 27, 2016 at 01:19:03PM +0200, Jiri Olsa escreveu:

Quoted 25 lines · Sukadev Bhattiprolu
Quoted 24 lines

From 502e8236082412db1d33abfad95aaf14b539502e Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <[email protected]>
Date: Sat, 26 Mar 2016 17:31:39 -0400
Subject: [PATCH 1/1] perf tools: Fix build break on powerpc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

'Commit 531d2410635c ("perf tools: Do not include stringify.h from the kernel sources")' seems to have accidentially removed the inclusion of "util/header.h" from "arch/powerpc/util/header.c".

"util/header.h" provides the prototype for get_cpuid() and is needed to build perf on Powerpc.

arch/powerpc/util/header.c:17:1: error: no previous prototype for ‘get_cpuid’ [-Werror=missing-prototypes]

---
 tools/perf/arch/powerpc/util/header.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

tools/perf/arch/powerpc/util/header.c line 7

Quoted 9 lines
tools/perf/arch/powerpc/util/header.c +1 -0
index 6138bde..5111e34 100644
@@ -4,6 +4,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <linux/stringify.h>
+#include "../../util/header.h"

you could use just "header.h" right?

Like this? I'm trying to find a way to do ppc cross builds, one more thing to have in the build-tests...

commit 150da025b7f135450ca833fb80d54d59f0ddf185

Author: Sukadev Bhattiprolu <[email protected]>
Date:   Mon Mar 28 09:31:41 2016 -0300

perf tools: Fix build break on powerpc

Commit 531d2410635c ("perf tools: Do not include stringify.h from the kernel sources") seems to have accidentially removed the inclusion of "util/header.h" from "arch/powerpc/util/header.c".

"util/header.h" provides the prototype for get_cpuid() and is needed to build perf on Powerpc:

arch/powerpc/util/header.c:17:1: error: no previous prototype for ‘get_cpuid’ [-Werror=missing-prototypes]

Fixes 531d2410635c ("perf tools: Do not include stringify.h from the kernel sources")
tools/perf/arch/powerpc/util/header.c +1 -0
index 6138bdef6e63..6de1a93241ae 100644
@@ -4,6 +4,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <linux/stringify.h>
+#include "header.h"
 
 #define mfspr(rn)       ({unsigned long rval; \
 			 asm volatile("mfspr %0," __stringify(rn) \
#3 lore raw

Em Mon, Mar 28, 2016 at 09:35:31AM -0300, Arnaldo Carvalho de Melo escreveu:

Quoted 38 lines

Em Sun, Mar 27, 2016 at 01:19:03PM +0200, Jiri Olsa escreveu:

Quoted 25 lines · Sukadev Bhattiprolu
Quoted 24 lines

From 502e8236082412db1d33abfad95aaf14b539502e Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <[email protected]>
Date: Sat, 26 Mar 2016 17:31:39 -0400
Subject: [PATCH 1/1] perf tools: Fix build break on powerpc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

'Commit 531d2410635c ("perf tools: Do not include stringify.h from the kernel sources")' seems to have accidentially removed the inclusion of "util/header.h" from "arch/powerpc/util/header.c".

"util/header.h" provides the prototype for get_cpuid() and is needed to build perf on Powerpc.

arch/powerpc/util/header.c:17:1: error: no previous prototype for ‘get_cpuid’ [-Werror=missing-prototypes]

---
 tools/perf/arch/powerpc/util/header.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

tools/perf/arch/powerpc/util/header.c line 7

Quoted 9 lines
tools/perf/arch/powerpc/util/header.c +1 -0
index 6138bde..5111e34 100644
@@ -4,6 +4,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <linux/stringify.h>
+#include "../../util/header.h"

you could use just "header.h" right?

Quoted 2 lines

Like this? I'm trying to find a way to do ppc cross builds, one more thing to have in the build-tests...

Argh, only kernel x-builds are supported on Fedora, checking if this is the case with Debian, if this is supported there, one more Docker image for building perf :-)

[acme@jouet linux]$ make ARCH=ppc64 CROSS_COMPILE=ppc64-linux-gnu- O=/tmp/build/perf-ppc64/ -C tools/perf install-bin
make: Entering directory '/home/acme/git/linux/tools/perf'
BUILD: Doing 'make -j4' parallel build

Auto-detecting system features:
... dwarf: [ OFF ]
... glibc: [ OFF ]
... gtk2: [ OFF ]
... libaudit: [ OFF ]
... libbfd: [ OFF ]
... libelf: [ OFF ]
... libnuma: [ OFF ]
... numa_num_possible_cpus: [ OFF ]
... libperl: [ OFF ]
... libpython: [ OFF ]
... libslang: [ OFF ]
... libcrypto: [ OFF ]
... libunwind: [ OFF ]
... libdw-dwarf-unwind: [ OFF ]
... zlib: [ OFF ]
... lzma: [ OFF ]
... get_cpuid: [ OFF ]
... bpf: [ OFF ]

config/Makefile:258: *** No gnu/libc-version.h found, please install glibc-dev[el]. Stop.
Makefile:108: recipe for target 'install-bin' failed
make: *** [install-bin] Error 2
make: Leaving directory '/home/acme/git/linux/tools/perf' [acme@jouet linux]$ rpm -q --qf "%{description}\n" gcc-powerpc64-linux-gnu
Cross-build GNU C compiler.

Only building kernels is currently supported. Support for cross-building user space programs is not currently provided as that would massively multiply the number of packages. [acme@jouet linux]$

#4 lore raw

Em Mon, Mar 28, 2016 at 10:21:45AM -0300, Arnaldo Carvalho de Melo escreveu:

Quoted 15 lines

Em Mon, Mar 28, 2016 at 09:35:31AM -0300, Arnaldo Carvalho de Melo escreveu:

Quoted 11 lines

Em Sun, Mar 27, 2016 at 01:19:03PM +0200, Jiri Olsa escreveu:

Quoted 9 lines · Sukadev Bhattiprolu

tools/perf/arch/powerpc/util/header.c line 7

Quoted 6 lines

+++ b/tools/perf/arch/powerpc/util/header.c

tools/perf/arch/powerpc/util/header.c +1 -0
@@ -4,6 +4,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <linux/stringify.h>
+#include "../../util/header.h"

you could use just "header.h" right?

Quoted 2 lines

Like this? I'm trying to find a way to do ppc cross builds, one more thing to have in the build-tests...

Quoted 8 lines

Argh, only kernel x-builds are supported on Fedora, checking if this is the case with Debian, if this is supported there, one more Docker image for building perf :-)

[acme@jouet linux]$ make ARCH=ppc64 CROSS_COMPILE=ppc64-linux-gnu- O=/tmp/build/perf-ppc64/ -C tools/perf install-bin
make: Entering directory '/home/acme/git/linux/tools/perf'
BUILD: Doing 'make -j4' parallel build

Ok, couldn't quickly find it on Debian, but found it for ppc64el on Ubuntu, this way I can reproduce the problem:

root@df2c38ce15fe:/git/linux# make ARCH=ppc64el CROSS_COMPILE=powerpc64le-linux-gnu- -C tools/perf O=/tmp/build/perf install-bin
make: Entering directory `/git/linux/tools/perf'
  BUILD:   Doing 'make -j4' parallel build

Auto-detecting system features:
... dwarf: [ OFF ]
... glibc: [ on ]
... gtk2: [ OFF ]
... libaudit: [ OFF ]
... libbfd: [ OFF ]
... libelf: [ OFF ]
... libnuma: [ OFF ]
... numa_num_possible_cpus: [ OFF ]
... libperl: [ OFF ]
... libpython: [ OFF ]
... libslang: [ OFF ]
... libcrypto: [ OFF ]
... libunwind: [ OFF ]
... libdw-dwarf-unwind: [ OFF ]
... zlib: [ OFF ]
... lzma: [ OFF ]
... get_cpuid: [ OFF ]
... bpf: [ on ]

config/Makefile:246: No libelf found, disables 'probe' tool and BPF support in 'perf record', please install elfutils-libelf-devel/libelf-dev config/Makefile:364: Disabling post unwind, no support found.
config/Makefile:405: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev config/Makefile:416: No libcrypto.h found, disables jitted code injection, please install libssl-devel or libssl-dev config/Makefile:431: slang not found, disables TUI support. Please install slang-devel or libslang-dev config/Makefile:445: GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev config/Makefile:473: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev config/Makefile:516: No 'Python.h' (for Python 2.x support) was found: disables Python support - please install python-devel/python-dev config/Makefile:606: No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev config/Makefile:619: No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev config/Makefile:676: Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc
CC /tmp/build/perf/arch/powerpc/util/header.o
arch/powerpc/util/header.c:18:1: error: no previous prototype for 'get_cpuid' [-Werror=missing-prototypes]
get_cpuid(char *buffer, size_t sz)
^
arch/powerpc/util/header.c: In function 'get_cpuid':
arch/powerpc/util/header.c:25:2: error: implicit declaration of function 'scnprintf' [-Werror=implicit-function-declaration]
nb = scnprintf(buffer, sz, "%lu,%lu$", PVR_VER(pvr), PVR_REV(pvr));
^
arch/powerpc/util/header.c:25:2: error: nested extern declaration of 'scnprintf' [-Werror=nested-externs]
cc1: all warnings being treated as errors

  INSTALL  binaries
  INSTALL  tests
  INSTALL  libexec
  INSTALL  perf-archive
  INSTALL  perf-with-kcore
  INSTALL  perf_completion-script
  INSTALL  perf-tip

make: Leaving directory `/git/linux/tools/perf'
root@df2c38ce15fe:/git/linux#

----------------------------------------------------------------
And test the fix:
----------------------------------------------------------------

root@df2c38ce15fe:/git/linux# make ARCH=ppc64el CROSS_COMPILE=powerpc64le-linux-gnu- -C tools/perf O=/tmp/build/perf install-bin
make: Entering directory `/git/linux/tools/perf'
  BUILD:   Doing 'make -j4' parallel build

Auto-detecting system features:
... dwarf: [ OFF ]
... glibc: [ on ]
... gtk2: [ OFF ]
... libaudit: [ OFF ]
... libbfd: [ OFF ]
... libelf: [ OFF ]
... libnuma: [ OFF ]
... numa_num_possible_cpus: [ OFF ]
... libperl: [ OFF ]
... libpython: [ OFF ]
... libslang: [ OFF ]
... libcrypto: [ OFF ]
... libunwind: [ OFF ]
... libdw-dwarf-unwind: [ OFF ]
... zlib: [ OFF ]
... lzma: [ OFF ]
... get_cpuid: [ OFF ]
... bpf: [ on ]

config/Makefile:246: No libelf found, disables 'probe' tool and BPF support in 'perf record', please install elfutils-libelf-devel/libelf-dev config/Makefile:364: Disabling post unwind, no support found.
config/Makefile:405: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev config/Makefile:416: No libcrypto.h found, disables jitted code injection, please install libssl-devel or libssl-dev config/Makefile:431: slang not found, disables TUI support. Please install slang-devel or libslang-dev config/Makefile:445: GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev config/Makefile:473: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev config/Makefile:516: No 'Python.h' (for Python 2.x support) was found: disables Python support - please install python-devel/python-dev config/Makefile:606: No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev config/Makefile:619: No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev config/Makefile:676: Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc

  CC       /tmp/build/perf/arch/powerpc/util/header.o
  LD       /tmp/build/perf/arch/powerpc/util/libperf-in.o
  LD       /tmp/build/perf/arch/powerpc/libperf-in.o
  LD       /tmp/build/perf/arch/libperf-in.o
  LD       /tmp/build/perf/libperf-in.o
  AR       /tmp/build/perf/libperf.a
  LINK     /tmp/build/perf/perf
  INSTALL  binaries
  INSTALL  tests
  INSTALL  libexec
  INSTALL  perf-archive
  INSTALL  perf-with-kcore
  INSTALL  perf_completion-script
  INSTALL  perf-tip

make: Leaving directory `/git/linux/tools/perf'
root@df2c38ce15fe:/git/linux#

Adding this container to the set I run when testing perf csets, with this in place we'll catch such bugs sooner in the future.

- Arnaldo

#5 lore raw
In reply to Sukadev Bhattiprolu

Em Sat, Mar 26, 2016 at 11:01:47AM -0700, Sukadev Bhattiprolu escreveu:

Quoted 11 lines

From 502e8236082412db1d33abfad95aaf14b539502e Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <[email protected]>
Date: Sat, 26 Mar 2016 17:31:39 -0400
Subject: [PATCH 1/1] perf tools: Fix build break on powerpc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

'Commit 531d2410635c ("perf tools: Do not include stringify.h from the kernel sources")' seems to have accidentially removed the inclusion of "util/header.h" from "arch/powerpc/util/header.c".

My bad, will push this via perf/urgent, after fixing what Jiri reported.

Quoted 26 lines

"util/header.h" provides the prototype for get_cpuid() and is needed to build perf on Powerpc.

arch/powerpc/util/header.c:17:1: error: no previous prototype for ‘get_cpuid’ [-Werror=missing-prototypes]

---
 tools/perf/arch/powerpc/util/header.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/arch/powerpc/util/header.c +1 -0
index 6138bde..5111e34 100644
@@ -4,6 +4,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <linux/stringify.h>
+#include "../../util/header.h"
 
 #define mfspr(rn)       ({unsigned long rval; \
 			 asm volatile("mfspr %0," __stringify(rn) \
Signature · 1 line
1.8.3.1