From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752901AbdK1OqQ (ORCPT ); Tue, 28 Nov 2017 09:46:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:43374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751846AbdK1OqP (ORCPT ); Tue, 28 Nov 2017 09:46:15 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4161021943 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Tue, 28 Nov 2017 11:46:11 -0300 From: Arnaldo Carvalho de Melo To: Heiko Carstens Cc: Ingo Molnar , Hendrik Brueckner , Thomas Richter , Martin Schwidefsky , Adrian Hunter , David Ahern , Jiri Olsa , Namhyung Kim , Wang Nan , Linux Kernel Mailing List Subject: [FIX] perf tools broken for s/390 Message-ID: <20171128144611.GF3298@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, While preparing a pull request to Ingo for this merge window, I noticed a regression in one of my cross build containers, specifically: ubuntu:16.04-x-s390: FAIL LINK /tmp/build/perf/plugin_jbd2.so In file included from util/perf_regs.h:27:0, from util/event.h:11, from util/symbol.h:16, from util/block-range.h:5, from util/block-range.c:2: /git/linux/tools/perf/arch/s390/include/perf_regs.h:6:62: fatal error: ../../../../arch/s390/include/uapi/asm/perf_regs.h: No such file or directory compilation terminated. In file included from util/perf_regs.h:27:0, from util/event.h:11, from util/symbol.h:16, from util/sort.h:12, from util/annotate.c:14: /git/linux/tools/perf/arch/s390/include/perf_regs.h:6:62: fatal error: ../../../../arch/s390/include/uapi/asm/perf_regs.h: No such file or directory compilation terminated. LINK /tmp/build/perf/plugin_hrtimer.so mv: cannot stat '/tmp/build/perf/util/.annotate.o.tmp': No such file or directory mv: cannot stat '/tmp/build/perf/util/.block-range.o.tmp': No such file or directory /git/linux/tools/build/Makefile.build:96: recipe for target '/tmp/build/perf/util/block-range.o' failed make[4]: *** [/tmp/build/perf/util/block-range.o] Error 1 make[4]: *** Waiting for unfinished jobs.... /git/linux/tools/build/Makefile.build:96: recipe for target '/tmp/build/perf/util/annotate.o' failed make[4]: *** [/tmp/build/perf/util/annotate.o] Error 1 /git/linux/tools/build/Makefile.build:139: recipe for target 'util' failed make[3]: *** [util] Error 2 Makefile.perf:619: recipe for target '/tmp/build/perf/libperf-in.o' failed make[2]: *** [/tmp/build/perf/libperf-in.o] Error 2 make[2]: *** Waiting for unfinished jobs.... I bisected it to the following commit: commit f704ef44602fbf403e6722c7ed13f62d17e8cb20 Author: Heiko Carstens AuthorDate: Tue Jan 19 11:23:38 2016 +0100 Commit: Martin Schwidefsky CommitDate: Thu Nov 16 15:06:12 2017 +0100 s390/perf: add support for perf_regs and libdw With support for perf_regs and libdw, you can record and report call graphs for user space programs. Simply invoke perf with the --call-graph=dwarf command line option. Signed-off-by: Heiko Carstens [brueckner: added dwfl_thread_state_register_pc() call] Signed-off-by: Hendrik Brueckner Reviewed-and-tested-by: Thomas Richter Signed-off-by: Martin Schwidefsky ---------------------- It adds this new file: diff --git a/tools/perf/arch/s390/include/perf_regs.h b/tools/perf/arch/s390/include/perf_regs.h new file mode 100644 index 000000000000..ac4b8c8c49e2 --- /dev/null +++ b/tools/perf/arch/s390/include/perf_regs.h @@ -0,0 +1,63 @@ +#ifndef ARCH_PERF_REGS_H +#define ARCH_PERF_REGS_H + +#include +#include +#include <../../../../arch/s390/include/uapi/asm/perf_regs.h> ------------------------------------------ That will try to include a file from the kernel sources, directly, something we long decided to be verbotten to avoid disturbing kernel development (and perf's and other tools/) when, say, a kernel hacker adds something, tests everything but tools/ and have tools/ build broken. So, in this case: [acme@jouet linux]$ find tools/arch/ -name perf_regs.h tools/arch/arm/include/uapi/asm/perf_regs.h tools/arch/powerpc/include/uapi/asm/perf_regs.h tools/arch/x86/include/uapi/asm/perf_regs.h tools/arch/arm64/include/uapi/asm/perf_regs.h [acme@jouet linux]$ probably its just a matter of doing the usual copy from arch/ to tools/arch/ and add a line to tools/perf/check_headers.sh to make sure we notice when the kernel original changes, possibly meaning needed changes in tooling, but not necessarily. [acme@jouet linux]$ diff -u arch/arm64/include/uapi/asm/perf_regs.h tools/arch/arm64/include/uapi/asm/perf_regs.h [acme@jouet linux]$ diff -u arch/x86/include/uapi/asm/perf_regs.h tools/arch/x86/include/uapi/asm/perf_regs.h [acme@jouet linux]$ diff -u arch/powerpc/include/uapi/asm/perf_regs.h tools/arch/powerpc/include/uapi/asm/perf_regs.h [acme@jouet linux]$ diff -u arch/arm/include/uapi/asm/perf_regs.h tools/arch/arm/include/uapi/asm/perf_regs.h [acme@jouet linux]$ [acme@jouet linux]$ cp arch/s390/include/uapi/asm/perf_regs.h tools/arch/s390/include/uapi/asm/perf_regs.h [acme@jouet linux]$ ls -la tools/arch/s390/include/uapi/asm/ total 44 drwxrwxr-x. 2 acme acme 4096 Nov 28 11:01 . drwxrwxr-x. 3 acme acme 4096 Nov 23 15:29 .. -rw-rw-r--. 1 acme acme 292 Nov 28 10:50 bitsperlong.h -rw-rw-r--. 1 acme acme 7747 Nov 28 10:50 kvm.h -rw-rw-r--. 1 acme acme 671 Nov 28 10:50 kvm_perf.h -rw-rw-r--. 1 acme acme 267 Nov 28 10:50 mman.h -rw-rw-r--. 1 acme acme 824 Nov 28 11:01 perf_regs.h -rw-rw-r--. 1 acme acme 9470 Nov 28 10:50 sie.h [acme@jouet linux]$ And: [acme@jouet linux]$ grep perf_regs\.h tools/perf/arch/*/include/perf_regs.h tools/perf/arch/arm64/include/perf_regs.h:#include tools/perf/arch/arm/include/perf_regs.h:#include tools/perf/arch/powerpc/include/perf_regs.h:#include tools/perf/arch/s390/include/perf_regs.h:#include <../../../../arch/s390/include/uapi/asm/perf_regs.h> tools/perf/arch/x86/include/perf_regs.h:#include [acme@jouet linux]$ Fixing the s390 case we get: [acme@jouet linux]$ git diff diff --git a/tools/perf/arch/s390/include/perf_regs.h b/tools/perf/arch/s390/include/perf_regs.h index d2df54a6bc5a..bcfbaed78cc2 100644 --- a/tools/perf/arch/s390/include/perf_regs.h +++ b/tools/perf/arch/s390/include/perf_regs.h @@ -3,7 +3,7 @@ #include #include -#include <../../../../arch/s390/include/uapi/asm/perf_regs.h> +#include void perf_regs_load(u64 *regs); [acme@jouet linux]$ And the container builds ok again: ../tmp/perf: ELF 64-bit MSB shared object, IBM S/390, version 1 (SYSV), dynamically linked, interpreter /lib/ld64.so.1, for GNU/Linux 3.2.0, BuildID[sha1]=640f0477b0df899497855430154ad63d666cbc9d, with debug_info, not stripped # dm ubuntu:16.04-x-s390 1 ubuntu:16.04-x-s390: Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 # In the future, please send patches that touch tools/perf/ to me, The resulting patch is at: https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/commit/?h=perf/urgent&id=12507d0fc07ce2fa6ccdcdde819f26c4acb0d839 Best regards, - Arnaldo