Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1260707ybm; Tue, 21 May 2019 11:05:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4dEN87gOIaiolJ5rnZRkBYcWQRy6imXZeIjLHcc3XdcwIQGRtFxDHUyU+8ZrVT3KFe6LE X-Received: by 2002:a17:902:9a81:: with SMTP id w1mr82077247plp.71.1558461928081; Tue, 21 May 2019 11:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558461928; cv=none; d=google.com; s=arc-20160816; b=gKA1TSJgFQkwmrAKzaNZlyNlPrhcHnLSMl9ut/EiJJgJOXV0+0fL89hK80VIgigyzg mr5FM8hJrMqD6Q2C3fKvlVKku+wv9R1wqT9EMGsTrE9zCCqhxLM7tfg6tPxVvtNqutbl iUOUHm0Xz6slg5uih80ELmoBWbrSRvp0QhwPR5en1gkB+drRn0ucLnlcWX9fUMiphZTC Dd589gbxeGhc8Y8jP7aTda8uN32XXYDYLDetTfBHg7JPbY8Qq1gP4z/mEAgu7UFpYzij tcX6nukLr5QtCKT9mMM2snH3/1LEPbEYlWYqSUR5thQZ3CF/rPdt/C7PbNswcEXkZR6C FFxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=kDWkGHshH7SIjjv0a0jvn7btoTP1C/ycawb8P/q+eYU=; b=iKpzPcSD+obsc9/yvI/XUlbS2LmA2VrTiWauTXEfBHBX1BX5sIb/aF+w4LGDw0m40F uJdiYplOafj0P1J6gFMpe2t+2+8I6QbsxHDPFlrH5Iav/UvI5hgmErYpdeG9+CxWxcGU hwNJJILr7UJMjHdAgWY0/EKWQuTGsjaLDggmYmK0haIxh2sFGmXkHr/pNsOEQ3M/k83h jIcS1xJXj/stDIJNp9hm59NuNjXqNCZBoZd8PzYC6KS+fw+hqruLnNHQqZSmQpGG0J7N Oohhv9GwwOsMwlb0FBbv44+PjTGwJKxeKNG6f4lquxKFBs/bn+9Xc/IEObwd/3PyKJ2a Q4Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bfHg9KXI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si23058020plb.123.2019.05.21.11.05.12; Tue, 21 May 2019 11:05:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bfHg9KXI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729098AbfEUSD7 (ORCPT + 99 others); Tue, 21 May 2019 14:03:59 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:35301 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727969AbfEUSD7 (ORCPT ); Tue, 21 May 2019 14:03:59 -0400 Received: by mail-qk1-f193.google.com with SMTP id c15so11655621qkl.2 for ; Tue, 21 May 2019 11:03:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kDWkGHshH7SIjjv0a0jvn7btoTP1C/ycawb8P/q+eYU=; b=bfHg9KXIbv6ZUzxyhXdQ7PvTDbMs0AHBj/gxSvUXIwpn5NjI4Hq9+NY3+YWN6tXI86 e7qGTi4MlIUXCqyjvk3NF3W202oToF+h45pDqxEvUTvVFJzoRQVI3K97/75gbtxQvYJd feb4FXIdbbK6tNRj3v9jEqtOvuED9o+U/Wz3R1w2+uw/yY9IUzNG35RV3C2U4qm2fQz8 f872RAveE0GDXGuCLtJOiTxc2e/c9gOr2QFdrCeUKGpT/Z1DwLlPp03hoQPUNRt98iLG b8e1PezCAMGCcmAadOaxQco/8V/ZmIXzVXw6yjFV3RlIcIlK0rFlLWIEE3a7zP+edhGI N8FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kDWkGHshH7SIjjv0a0jvn7btoTP1C/ycawb8P/q+eYU=; b=ItOl15E//5nfPQqVYobR+8NJdTZutmqe8zV+Y1N7dyP2JBA+u8t/wLchAcU4ewaX0g dlRQCRXF4jRNBSKBoQl/lOy6xSZL23RWjHorF50C+XG2INYM7znd1kECATQpXD0ATI3f vrs2RIGFeRg4bqzOO0pObeRpTxaXZ2JhRek4WqnEnBUWaiSQiBnt9Ylfb54Sx3cyaZ1e KTgMUAPMCRkgGk92BH8T/FOvjsGJvw8eWh9cZdfMegkdspyeXZF4xRQgoFDRsQ1T98/D cr4a8ahuHcpWYdgQRnv9UmtCMLYrYZbJPQFeevFTIj8IwEMTPFjLmP5Q3N7iU15gW+As 6Ywg== X-Gm-Message-State: APjAAAVJL7u+RlhAVG2UnxuQ9iBgxhYwBxN/l3ezrEvHgvvHHSJH15DO /lC9qPbwAvvU+BUSqxgOIAo= X-Received: by 2002:a37:4fca:: with SMTP id d193mr64466123qkb.298.1558461837811; Tue, 21 May 2019 11:03:57 -0700 (PDT) Received: from quaco.ghostprotocols.net ([179.97.35.11]) by smtp.gmail.com with ESMTPSA id w48sm2286736qtb.91.2019.05.21.11.03.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 21 May 2019 11:03:56 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 63509404A1; Tue, 21 May 2019 15:03:54 -0300 (-03) Date: Tue, 21 May 2019 15:03:54 -0300 To: Vitaly Chikunov Cc: Michael Petlan , Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, Alexander Shishkin , Hendrik Brueckner , Jiri Olsa , Kim Phillips , Namhyung Kim , Ravi Bangoria Subject: Re: [PATCH] perf arm64: Fix mksyscalltbl when system kernel headers are ahead of the kernel Message-ID: <20190521180354.GE26253@kernel.org> References: <20190521030203.1447-1-vt@altlinux.org> <20190521132838.GB26253@kernel.org> <20190521151918.GD26253@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190521151918.GD26253@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, May 21, 2019 at 12:19:18PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Tue, May 21, 2019 at 04:34:47PM +0200, Michael Petlan escreveu: > > On Tue, 21 May 2019, Arnaldo Carvalho de Melo wrote: > > > Em Tue, May 21, 2019 at 06:02:03AM +0300, Vitaly Chikunov escreveu: > > > > When a host system has kernel headers that are newer than a compiling > > > > kernel, mksyscalltbl fails with errors such as: > > > > : In function 'main': > > > > :271:44: error: '__NR_kexec_file_load' undeclared (first use in this function) > > > > :271:44: note: each undeclared identifier is reported only once for each function it appears in > > > > :272:46: error: '__NR_pidfd_send_signal' undeclared (first use in this function) > > > > :273:43: error: '__NR_io_uring_setup' undeclared (first use in this function) > > > > :274:43: error: '__NR_io_uring_enter' undeclared (first use in this function) > > > > :275:46: error: '__NR_io_uring_register' undeclared (first use in this function) > > > > tools/perf/arch/arm64/entry/syscalls//mksyscalltbl: line 48: /tmp/create-table-xvUQdD: Permission denied > > > > mksyscalltbl is compiled with default host includes, but run with > > > It shouldn't :-\ So with this you're making it use the ones shipped in > > > tools/include? Good, I'll test it, thanks! > > I've hit the issue too, this patch fixes it for me. > > Tested. > Thanks, I'll add your Tested-by, appreciated. Was this in a cross-build environment? Native? I'm asking because I test this on several cross build environments, like on ubuntu 19.04 cross building to aarch64: perfbuilder@15e0b7c211c2:/git/perf$ grep PRETTY_NAME /etc/os-release PRETTY_NAME="Ubuntu 19.04" perfbuilder@15e0b7c211c2:/git/perf$ aarch64-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=aarch64-linux-gnu-gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/aarch64-linux-gnu/8/lto-wrapper Target: aarch64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 8.3.0-6ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --disable-libphobos --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=aarch64-linux-gnu --program-prefix=aarch64-linux-gnu- --includedir=/usr/aarch64-linux-gnu/include Thread model: posix gcc version 8.3.0 (Ubuntu/Linaro 8.3.0-6ubuntu1) perfbuilder@15e0b7c211c2:/git/perf$ I'm building it as: $ make CORESIGHT=1 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- EXTRA_CFLAGS= -C /git/perf/tools/perf O=/tmp/build/perf The end result is: $ file /tmp/build/perf/perf /tmp/build/perf/perf: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=5b4fd9f0f92cc331e43e6e4da9791c473524383d, for GNU/Linux 3.7.0, with debug_info, not stripped I.e. it didn't fail the build, but in the end these new syscalls are not there, while with your patch, they are: perfbuilder@6e20056ed532:/git/perf$ tail /tmp/build/perf/arch/arm64/include/generated/asm/syscalls.c [292] = "io_pgetevents", [293] = "rseq", [294] = "kexec_file_load", [424] = "pidfd_send_signal", [425] = "io_uring_setup", [426] = "io_uring_enter", [427] = "io_uring_register", [428] = "syscalls", #define SYSCALLTBL_ARM64_MAX_ID 428 }; perfbuilder@6e20056ed532:/git/perf$ perfbuilder@6e20056ed532:/git/perf$ strings /tmp/build/perf/perf | egrep '^(io_uring_|pidfd_|kexec_file)' kexec_file_load pidfd_send_signal io_uring_setup io_uring_enter io_uring_register perfbuilder@6e20056ed532:/git/perf$ Thanks, applied. - Arnaldo