tools/headers: Synchronize kernel ABI headers
After the SPDX license tags were added a number of tooling headers got out of
sync with their kernel variants, generating lots of build warnings.
Sync them:
- tools/arch/x86/include/asm/disabled-features.h,
tools/arch/x86/include/asm/required-features.h,
tools/include/linux/hash.h:
Remove the SPDX tag where the kernel version does not have it.
- tools/include/asm-generic/bitops/__fls.h,
tools/include/asm-generic/bitops/arch_hweight.h,
tools/include/asm-generic/bitops/const_hweight.h,
tools/include/asm-generic/bitops/fls.h,
tools/include/asm-generic/bitops/fls64.h,
tools/include/uapi/asm-generic/ioctls.h,
tools/include/uapi/asm-generic/mman-common.h,
tools/include/uapi/sound/asound.h,
tools/include/uapi/linux/kvm.h,
tools/include/uapi/linux/perf_event.h,
tools/include/uapi/linux/sched.h,
tools/include/uapi/linux/vhost.h,
tools/include/uapi/sound/asound.h:
Add the SPDX tag of the respective kernel header.
- tools/include/uapi/linux/bpf_common.h,
tools/include/uapi/linux/fcntl.h,
tools/include/uapi/linux/hw_breakpoint.h,
tools/include/uapi/linux/mman.h,
tools/include/uapi/linux/stat.h,
Change the tag to the kernel header version:
-/* SPDX-License-Identifier: GPL-2.0 */
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
Also sync other header details:
- include/uapi/sound/asound.h:
Fix pointless end of line whitespace noise the header grew in this cycle.
- tools/arch/x86/lib/memcpy_64.S:
Sync the code and add tools/include/asm/export.h with dummy wrappers
to support building the kernel side code in a tooling header environment.
- tools/include/uapi/asm-generic/mman.h,
tools/include/uapi/linux/bpf.h:
Sync other details that don't impact tooling's use of the ABIs.
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-11-03 19:18:37 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
2017-03-30 22:16:59 +08:00
|
|
|
#ifndef _UAPI_LINUX_FCNTL_H
|
|
|
|
#define _UAPI_LINUX_FCNTL_H
|
|
|
|
|
|
|
|
#include <asm/fcntl.h>
|
tools include UAPI: Sync x86's syscalls_64.tbl, generic unistd.h and fcntl.h to pick up openat2 and pidfd_getfd
fddb5d430ad9 ("open: introduce openat2(2) syscall")
9a2cef09c801 ("arch: wire up pidfd_getfd syscall")
We also need to grab a copy of uapi/linux/openat2.h since it is now
needed by fcntl.h, add it to tools/perf/check_headers.h.
$ diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
--- tools/perf/arch/x86/entry/syscalls/syscall_64.tbl 2019-12-20 16:43:57.662429958 -0300
+++ arch/x86/entry/syscalls/syscall_64.tbl 2020-02-10 16:36:22.070012468 -0300
@@ -357,6 +357,8 @@
433 common fspick __x64_sys_fspick
434 common pidfd_open __x64_sys_pidfd_open
435 common clone3 __x64_sys_clone3/ptregs
+437 common openat2 __x64_sys_openat2
+438 common pidfd_getfd __x64_sys_pidfd_getfd
#
# x32-specific system call numbers start at 512 to avoid cache impact
$
Update tools/'s copy of that file:
$ cp arch/x86/entry/syscalls/syscall_64.tbl tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
See the result:
$ diff -u /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c.before /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c
--- /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c.before 2020-02-10 16:42:59.010636041 -0300
+++ /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c 2020-02-10 16:43:24.149958337 -0300
@@ -346,5 +346,7 @@
[433] = "fspick",
[434] = "pidfd_open",
[435] = "clone3",
+ [437] = "openat2",
+ [438] = "pidfd_getfd",
};
-#define SYSCALLTBL_x86_64_MAX_ID 435
+#define SYSCALLTBL_x86_64_MAX_ID 438
$
Now one can use:
perf trace -e openat2,pidfd_getfd
To get just those syscalls or use in things like:
perf trace -e open*
To get all the open variant (open, openat, openat2, etc) or:
perf trace pidfd*
To get the pidfd syscalls.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Aleksa Sarai <cyphar@cyphar.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Sargun Dhillon <sargun@sargun.me>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-02-11 22:58:56 +08:00
|
|
|
#include <linux/openat2.h>
|
2017-03-30 22:16:59 +08:00
|
|
|
|
|
|
|
#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
|
|
|
|
#define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Cancel a blocking posix lock; internal use only until we expose an
|
|
|
|
* asynchronous lock api to userspace:
|
|
|
|
*/
|
|
|
|
#define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5)
|
|
|
|
|
|
|
|
/* Create a file descriptor with FD_CLOEXEC set. */
|
|
|
|
#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Request nofications on a directory.
|
|
|
|
* See below for events that may be notified.
|
|
|
|
*/
|
|
|
|
#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Set and get of pipe page size array
|
|
|
|
*/
|
|
|
|
#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
|
|
|
|
#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Set/Get seals
|
|
|
|
*/
|
|
|
|
#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
|
|
|
|
#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Types of seals
|
|
|
|
*/
|
|
|
|
#define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */
|
|
|
|
#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */
|
|
|
|
#define F_SEAL_GROW 0x0004 /* prevent file from growing */
|
|
|
|
#define F_SEAL_WRITE 0x0008 /* prevent writes */
|
2019-03-26 01:22:47 +08:00
|
|
|
#define F_SEAL_FUTURE_WRITE 0x0010 /* prevent future writes while mapped */
|
2017-03-30 22:16:59 +08:00
|
|
|
/* (1U << 31) is reserved for signed error codes */
|
|
|
|
|
2017-07-14 04:15:24 +08:00
|
|
|
/*
|
|
|
|
* Set/Get write life time hints. {GET,SET}_RW_HINT operate on the
|
|
|
|
* underlying inode, while {GET,SET}_FILE_RW_HINT operate only on
|
|
|
|
* the specific file.
|
|
|
|
*/
|
|
|
|
#define F_GET_RW_HINT (F_LINUX_SPECIFIC_BASE + 11)
|
|
|
|
#define F_SET_RW_HINT (F_LINUX_SPECIFIC_BASE + 12)
|
|
|
|
#define F_GET_FILE_RW_HINT (F_LINUX_SPECIFIC_BASE + 13)
|
|
|
|
#define F_SET_FILE_RW_HINT (F_LINUX_SPECIFIC_BASE + 14)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Valid hint values for F_{GET,SET}_RW_HINT. 0 is "not set", or can be
|
|
|
|
* used to clear any hints previously set.
|
|
|
|
*/
|
2019-09-20 23:58:21 +08:00
|
|
|
#define RWH_WRITE_LIFE_NOT_SET 0
|
2017-07-14 04:15:24 +08:00
|
|
|
#define RWH_WRITE_LIFE_NONE 1
|
|
|
|
#define RWH_WRITE_LIFE_SHORT 2
|
|
|
|
#define RWH_WRITE_LIFE_MEDIUM 3
|
|
|
|
#define RWH_WRITE_LIFE_LONG 4
|
|
|
|
#define RWH_WRITE_LIFE_EXTREME 5
|
|
|
|
|
2019-09-20 23:58:21 +08:00
|
|
|
/*
|
|
|
|
* The originally introduced spelling is remained from the first
|
|
|
|
* versions of the patch set that introduced the feature, see commit
|
|
|
|
* v4.13-rc1~212^2~51.
|
|
|
|
*/
|
|
|
|
#define RWF_WRITE_LIFE_NOT_SET RWH_WRITE_LIFE_NOT_SET
|
|
|
|
|
2017-03-30 22:16:59 +08:00
|
|
|
/*
|
|
|
|
* Types of directory notifications that may be requested.
|
|
|
|
*/
|
|
|
|
#define DN_ACCESS 0x00000001 /* File accessed */
|
|
|
|
#define DN_MODIFY 0x00000002 /* File modified */
|
|
|
|
#define DN_CREATE 0x00000004 /* File created */
|
|
|
|
#define DN_DELETE 0x00000008 /* File removed */
|
|
|
|
#define DN_RENAME 0x00000010 /* File renamed */
|
|
|
|
#define DN_ATTRIB 0x00000020 /* File changed attibutes */
|
|
|
|
#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
|
|
|
|
|
2020-06-06 00:36:38 +08:00
|
|
|
/*
|
|
|
|
* The constants AT_REMOVEDIR and AT_EACCESS have the same value. AT_EACCESS is
|
|
|
|
* meaningful only to faccessat, while AT_REMOVEDIR is meaningful only to
|
|
|
|
* unlinkat. The two functions do completely different things and therefore,
|
|
|
|
* the flags can be allowed to overlap. For example, passing AT_REMOVEDIR to
|
|
|
|
* faccessat would be undefined behavior and thus treating it equivalent to
|
|
|
|
* AT_EACCESS is valid undefined behavior.
|
|
|
|
*/
|
2017-03-30 22:16:59 +08:00
|
|
|
#define AT_FDCWD -100 /* Special value used to indicate
|
|
|
|
openat should use the current
|
|
|
|
working directory. */
|
|
|
|
#define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
|
2020-06-06 00:36:38 +08:00
|
|
|
#define AT_EACCESS 0x200 /* Test access permitted for
|
|
|
|
effective IDs, not real IDs. */
|
2017-03-30 22:16:59 +08:00
|
|
|
#define AT_REMOVEDIR 0x200 /* Remove directory instead of
|
|
|
|
unlinking file. */
|
|
|
|
#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
|
|
|
|
#define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal */
|
|
|
|
#define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname */
|
|
|
|
|
|
|
|
#define AT_STATX_SYNC_TYPE 0x6000 /* Type of synchronisation required from statx() */
|
|
|
|
#define AT_STATX_SYNC_AS_STAT 0x0000 /* - Do whatever stat() does */
|
|
|
|
#define AT_STATX_FORCE_SYNC 0x2000 /* - Force the attributes to be sync'd with the server */
|
|
|
|
#define AT_STATX_DONT_SYNC 0x4000 /* - Don't sync attributes with the server */
|
|
|
|
|
2019-05-20 23:03:30 +08:00
|
|
|
#define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */
|
|
|
|
|
2017-03-30 22:16:59 +08:00
|
|
|
#endif /* _UAPI_LINUX_FCNTL_H */
|