linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Vitaly Chikunov <vt@altlinux.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Michael Petlan <mpetlan@redhat.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Hendrik Brueckner <brueckner@linux.ibm.com>,
	Jiri Olsa <jolsa@redhat.com>, Kim Phillips <kim.phillips@arm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Subject: [PATCH 06/44] perf arm64: Fix mksyscalltbl when system kernel headers are ahead of the kernel
Date: Mon, 27 May 2019 19:36:52 -0300	[thread overview]
Message-ID: <20190527223730.11474-7-acme@kernel.org> (raw)
In-Reply-To: <20190527223730.11474-1-acme@kernel.org>

From: Vitaly Chikunov <vt@altlinux.org>

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
compiling kernel tree includes, causing some syscall numbers to being
undeclared.

Committer testing:

Before this patch, in my cross build environment, no build problems, but
these new syscalls were not in the syscalls.c generated from the
unistd.h file, which is a bug, this patch fixes it:

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",
};
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$
$

Well, there is that last "syscalls" thing, but that looks like some
other bug.

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Michael Petlan <mpetlan@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Hendrik Brueckner <brueckner@linux.ibm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kim Phillips <kim.phillips@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20190521030203.1447-1-vt@altlinux.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
index c88fd32563eb..459469b7222c 100755
--- a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
+++ b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
@@ -56,7 +56,7 @@ create_table()
 	echo "};"
 }
 
-$gcc -E -dM -x c  $input	       \
+$gcc -E -dM -x c -I $incpath/include/uapi $input \
 	|sed -ne 's/^#define __NR_//p' \
 	|sort -t' ' -k2 -nu	       \
 	|create_table
-- 
2.20.1

  parent reply	other threads:[~2019-05-27 22:36 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27 22:36 [GIT PULL] perf/urgent improvements and fixes Arnaldo Carvalho de Melo
2019-05-27 22:36 ` [PATCH 01/44] perf-with-kcore.sh: Always allow fix_buildid_cache_permissions Arnaldo Carvalho de Melo
2019-05-27 22:36 ` [PATCH 02/44] perf intel-pt: Fix itrace defaults for perf script Arnaldo Carvalho de Melo
2019-05-27 22:36 ` [PATCH 03/44] perf auxtrace: " Arnaldo Carvalho de Melo
2019-05-27 22:36 ` [PATCH 04/44] perf intel-pt: Fix itrace defaults for perf script intel-pt documentation Arnaldo Carvalho de Melo
2019-05-27 22:36 ` [PATCH 05/44] perf data: Fix 'strncat may truncate' build failure with recent gcc Arnaldo Carvalho de Melo
2019-05-27 22:46   ` Shawn Landden
2019-05-28 13:04     ` Arnaldo Carvalho de Melo
2019-05-28 16:59       ` Shawn Landden
2019-05-28 17:39         ` Arnaldo Carvalho de Melo
2019-05-27 22:36 ` Arnaldo Carvalho de Melo [this message]
2019-05-27 22:36 ` [PATCH 07/44] tools include UAPI: Update copy of files related to new fspick, fsmount, fsconfig, fsopen, move_mount and open_tree syscalls Arnaldo Carvalho de Melo
2019-05-27 22:36 ` [PATCH 08/44] perf augmented_raw_syscalls: Fix up comment Arnaldo Carvalho de Melo
2019-05-27 22:36 ` [PATCH 09/44] perf beauty: Add generator for 'move_mount' flags argument Arnaldo Carvalho de Melo
2019-05-27 22:36 ` [PATCH 10/44] perf trace: Beautify 'move_mount' arguments Arnaldo Carvalho de Melo
2019-05-27 22:36 ` [PATCH 11/44] perf beauty: Add generator for fspick's 'flags' arg values Arnaldo Carvalho de Melo
2019-05-27 22:36 ` [PATCH 12/44] perf trace: Beautify 'fspick' arguments Arnaldo Carvalho de Melo
2019-05-27 22:36 ` [PATCH 13/44] perf beauty: Add generator for fsconfig's 'cmd' arg values Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 14/44] perf trace: Beautify 'fsconfig' arguments Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 15/44] perf beauty: Add generator for fsmount's 'attr_flags' arg values Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 16/44] perf trace: Introduce syscall_arg__scnprintf_strarray_flags Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 17/44] perf trace: Beautify 'fsmount' arguments Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 18/44] tools arch x86: Sync asm/cpufeatures.h with the with the kernel Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 19/44] tools headers UAPI: Sync linux/sched.h " Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 20/44] perf trace beauty clone: Handle CLONE_PIDFD Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 21/44] tools headers UAPI: Sync linux/fs.h with the kernel Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 22/44] perf beauty: Add generator for sync_file_range's 'flags' arg values Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 23/44] perf trace: Beautify 'sync_file_range' arguments Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 24/44] tools headers UAPI: Sync drm/i915_drm.h with the kernel Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 25/44] tools headers UAPI: Sync drm/drm.h " Arnaldo Carvalho de Melo
2019-05-28  3:17   ` Zhou, David(ChunMing)
2019-05-28  8:07   ` Lionel Landwerlin
2019-05-28 12:53     ` Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 26/44] perf namespace: Protect reading thread's namespace Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 27/44] perf session: Add missing swap ops for namespace events Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 28/44] perf top: Add --namespaces option Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 29/44] perf tools: Remove const from thread read accessors Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 30/44] perf dso: Separate generic code in dso__data_file_size() Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 31/44] perf dso: Separate generic code in dso_cache__read Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 32/44] perf dso: Simplify dso_cache__read function Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 33/44] perf dso: Add BPF DSO read and size hooks Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 34/44] perf test vmlinux-kallsyms: Ignore aliases to _etext when searching on kallsyms Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 35/44] perf machine: Read also the end of the kernel Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 36/44] perf machine: Keep zero in pgoff BPF map Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 37/44] perf tools: Preserve eBPF maps when loading kcore Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 38/44] perf script: Pad DSO name for --call-trace Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 39/44] perf tests: Add map_groups__merge_in test Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 40/44] perf script: Add --show-bpf-events to show eBPF related events Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 41/44] perf script: Remove superfluous BPF event titles Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 42/44] perf version: Append 12 git SHA chars to the version string Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 43/44] perf record: Fix s390 missing module symbol and warning for non-root users Arnaldo Carvalho de Melo
2019-05-27 22:37 ` [PATCH 44/44] tools headers UAPI: Sync kvm.h headers with the kernel sources Arnaldo Carvalho de Melo

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=20190527223730.11474-7-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=brueckner@linux.ibm.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=kim.phillips@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=vt@altlinux.org \
    --cc=williams@redhat.com \
    /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).