linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Vitaly Chikunov <vt@altlinux.org>
Cc: Michael Petlan <mpetlan@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Hendrik Brueckner <brueckner@linux.ibm.com>,
	Jiri Olsa <jolsa@redhat.com>, Kim Phillips <kim.phillips@arm.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Subject: Re: [PATCH] perf arm64: Fix mksyscalltbl when system kernel headers are ahead of the kernel
Date: Tue, 21 May 2019 15:03:54 -0300	[thread overview]
Message-ID: <20190521180354.GE26253@kernel.org> (raw)
In-Reply-To: <20190521151918.GD26253@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:

> > > >   <stdin>: In function 'main':
> > > >   <stdin>:271:44: error: '__NR_kexec_file_load' undeclared (first use in this function)
> > > >   <stdin>:271:44: note: each undeclared identifier is reported only once for each function it appears in
> > > >   <stdin>:272:46: error: '__NR_pidfd_send_signal' undeclared (first use in this function)
> > > >   <stdin>:273:43: error: '__NR_io_uring_setup' undeclared (first use in this function)
> > > >   <stdin>:274:43: error: '__NR_io_uring_enter' undeclared (first use in this function)
> > > >   <stdin>: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

  reply	other threads:[~2019-05-21 18:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-21  3:02 [PATCH] perf arm64: Fix mksyscalltbl when system kernel headers are ahead of the kernel Vitaly Chikunov
2019-05-21 13:28 ` Arnaldo Carvalho de Melo
2019-05-21 14:34   ` Michael Petlan
2019-05-21 15:19     ` Arnaldo Carvalho de Melo
2019-05-21 18:03       ` Arnaldo Carvalho de Melo [this message]
2019-05-21 20:53         ` Vitaly Chikunov
2019-05-22  0:29           ` Arnaldo Carvalho de Melo
2019-05-28 21:22 ` [tip:perf/urgent] " tip-bot for Vitaly Chikunov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190521180354.GE26253@kernel.org \
    --to=arnaldo.melo@gmail.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=brueckner@linux.ibm.com \
    --cc=jolsa@redhat.com \
    --cc=kim.phillips@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@linux.vnet.ibm.com \
    --cc=vt@altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).