Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH] perf trace beauty fcntl: Fix build with older kernel headers
@ 2026-05-13 19:23 Florian Fainelli
  2026-05-13 20:58 ` Ian Rogers
  2026-05-14 15:56 ` Namhyung Kim
  0 siblings, 2 replies; 8+ messages in thread
From: Florian Fainelli @ 2026-05-13 19:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: mmayer, bcm-kernel-feedback-list, Florian Fainelli,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, James Clark,
	open list:PERFORMANCE EVENTS SUBSYSTEM

Toolchains with older kernel headers that do not include upstream commit
c75b1d9421f80f4143e389d2d50ddfc8a28c8c35 ("fs: add fcntl() interface for
setting/getting write life time hints") will now fail to build perf due
to missing definitions for
F_GET_RW_HINT/F_SET_RW_HINT/F_GET_FILE_RW_HINT/F_SET_FILE_RW_HINT.

Provide a fallback definition for these when they are not already
defined.

Fixes: 9c47f6674838 ("perf trace beauty fcntl: Basic 'arg' beautifier")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
 tools/perf/trace/beauty/fcntl.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tools/perf/trace/beauty/fcntl.c b/tools/perf/trace/beauty/fcntl.c
index d075904dccce..e1b99b8f55eb 100644
--- a/tools/perf/trace/beauty/fcntl.c
+++ b/tools/perf/trace/beauty/fcntl.c
@@ -9,6 +9,22 @@
 #include <linux/kernel.h>
 #include <linux/fcntl.h>
 
+#ifndef F_GET_RW_HINT
+#define F_GET_RW_HINT		(F_LINUX_SPECIFIC_BASE + 11)
+#endif
+
+#ifndef F_SET_RW_HINT
+#define F_SET_RW_HINT		(F_LINUX_SPECIFIC_BASE + 12)
+#endif
+
+#ifndef F_GET_FILE_RW_HINT
+#define F_GET_FILE_RW_HINT	(F_LINUX_SPECIFIC_BASE + 13)
+#endif
+
+#ifndef F_SET_FILE_RW_HINT
+#define F_SET_FILE_RW_HINT	(F_LINUX_SPECIFIC_BASE + 14)
+#endif
+
 static size_t fcntl__scnprintf_getfd(unsigned long val, char *bf, size_t size, bool show_prefix)
 {
 	return val ? scnprintf(bf, size, "%s", "0") :
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-05-14 17:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-13 19:23 [PATCH] perf trace beauty fcntl: Fix build with older kernel headers Florian Fainelli
2026-05-13 20:58 ` Ian Rogers
2026-05-13 21:56   ` Florian Fainelli
2026-05-13 23:13     ` Ian Rogers
2026-05-14 15:56 ` Namhyung Kim
2026-05-14 16:37   ` Ian Rogers
2026-05-14 16:57     ` Florian Fainelli
2026-05-14 17:13       ` Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox