mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wang Xiang <xiangw985@gmail.com>
To: acme@kernel.org, namhyung@kernel.org
Cc: peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	irogers@google.com, adrian.hunter@intel.com,
	james.clark@linaro.org, yangsonghua@lixiang.com,
	wangxiang3@lixiang.com, linux-perf-users@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] tools headers: Sync UAPI linux/openat2.h with the kernel sources
Date: Mon, 12 Jan 2026 15:31:25 +0800	[thread overview]
Message-ID: <20260112073125.4115607-1-xiangw985@gmail.com> (raw)

From: Wang Xiang <wangxiang3@lixiang.com>

Since commit 3d6cfbaf279d ("perf beauty: Introduce scrape script for
various fs syscalls 'flags' arguments"), the file
tools/perf/trace/beauty/include/uapi/linux/fcntl.h includes
<linux/openat2.h>, but openat2.h was never synced to the
tools/perf/trace/beauty/include/uapi/linux/ directory, even though it
was added to the BEAUTY_FILES check list in tools/perf/check-headers.sh.

This causes a compilation failure:
  $ aarch64-linux-gnu-gcc -E
  tools/perf/trace/beauty/include/uapi/linux/fcntl.h \
  -I./tools/perf/trace/beauty/include/uapi

  tools/perf/trace/beauty/include/uapi/linux/fcntl.h:6:10: fatal error:
  linux/openat2.h: No such file or directory 6 | #include
  <linux/openat2.h>

So, now we need sync openat2.h from include/uapi/linux/openat2.h to fix this
dependency.

Signed-off-by: Wang Xiang <wangxiang3@lixiang.com>
---
 tools/perf/check-headers.sh                   |  1 +
 .../trace/beauty/include/uapi/linux/openat2.h | 43 +++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 tools/perf/trace/beauty/include/uapi/linux/openat2.h

diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index e0537f275da2..411a45d8f9f6 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -95,6 +95,7 @@ declare -a BEAUTY_FILES=(
   "include/uapi/linux/fcntl.h"
   "include/uapi/linux/fs.h"
   "include/uapi/linux/mount.h"
+  "include/uapi/linux/openat2.h"
   "include/uapi/linux/prctl.h"
   "include/uapi/linux/sched.h"
   "include/uapi/linux/stat.h"
diff --git a/tools/perf/trace/beauty/include/uapi/linux/openat2.h b/tools/perf/trace/beauty/include/uapi/linux/openat2.h
new file mode 100644
index 000000000000..a5feb7604948
--- /dev/null
+++ b/tools/perf/trace/beauty/include/uapi/linux/openat2.h
@@ -0,0 +1,43 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef _UAPI_LINUX_OPENAT2_H
+#define _UAPI_LINUX_OPENAT2_H
+
+#include <linux/types.h>
+
+/*
+ * Arguments for how openat2(2) should open the target path. If only @flags and
+ * @mode are non-zero, then openat2(2) operates very similarly to openat(2).
+ *
+ * However, unlike openat(2), unknown or invalid bits in @flags result in
+ * -EINVAL rather than being silently ignored. @mode must be zero unless one of
+ * {O_CREAT, O_TMPFILE} are set.
+ *
+ * @flags: O_* flags.
+ * @mode: O_CREAT/O_TMPFILE file mode.
+ * @resolve: RESOLVE_* flags.
+ */
+struct open_how {
+	__u64 flags;
+	__u64 mode;
+	__u64 resolve;
+};
+
+/* how->resolve flags for openat2(2). */
+#define RESOLVE_NO_XDEV		0x01 /* Block mount-point crossings
+					(includes bind-mounts). */
+#define RESOLVE_NO_MAGICLINKS	0x02 /* Block traversal through procfs-style
+					"magic-links". */
+#define RESOLVE_NO_SYMLINKS	0x04 /* Block traversal through all symlinks
+					(implies OEXT_NO_MAGICLINKS) */
+#define RESOLVE_BENEATH		0x08 /* Block "lexical" trickery like
+					"..", symlinks, and absolute
+					paths which escape the dirfd. */
+#define RESOLVE_IN_ROOT		0x10 /* Make all jumps to "/" and ".."
+					be scoped inside the dirfd
+					(similar to chroot(2)). */
+#define RESOLVE_CACHED		0x20 /* Only complete if resolution can be
+					completed through cached lookup. May
+					return -EAGAIN if that's not
+					possible. */
+
+#endif /* _UAPI_LINUX_OPENAT2_H */
-- 
2.25.1


                 reply	other threads:[~2026-01-12  7:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260112073125.4115607-1-xiangw985@gmail.com \
    --to=xiangw985@gmail.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=wangxiang3@lixiang.com \
    --cc=yangsonghua@lixiang.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

all inboxes | Powered by JetHome®