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
  0 siblings, 1 reply; 4+ 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] 4+ messages in thread

* Re: [PATCH] perf trace beauty fcntl: Fix build with older kernel headers
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Rogers @ 2026-05-13 20:58 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: linux-kernel, mmayer, bcm-kernel-feedback-list, Peter Zijlstra,
	Ingo Molnar, Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Adrian Hunter, James Clark,
	open list:PERFORMANCE EVENTS SUBSYSTEM

On Wed, May 13, 2026 at 12:23 PM Florian Fainelli
<florian.fainelli@broadcom.com> wrote:
>
> 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.

This seems fine but the commit you mention was added to Linux 4.13. Is
there a reason you've run into this problem? The oldest active LTS
kernel is 4.19.

Thanks,
Ian

> 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	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf trace beauty fcntl: Fix build with older kernel headers
  2026-05-13 20:58 ` Ian Rogers
@ 2026-05-13 21:56   ` Florian Fainelli
  2026-05-13 23:13     ` Ian Rogers
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2026-05-13 21:56 UTC (permalink / raw)
  To: Ian Rogers
  Cc: linux-kernel, mmayer, bcm-kernel-feedback-list, Peter Zijlstra,
	Ingo Molnar, Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Adrian Hunter, James Clark,
	open list:PERFORMANCE EVENTS SUBSYSTEM

On 5/13/26 13:58, Ian Rogers wrote:
> On Wed, May 13, 2026 at 12:23 PM Florian Fainelli
> <florian.fainelli@broadcom.com> wrote:
>>
>> 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.
> 
> This seems fine but the commit you mention was added to Linux 4.13. Is
> there a reason you've run into this problem? The oldest active LTS
> kernel is 4.19.

The toolchain I am using is still on kernel headers 4.9.x, I am 
cognizant this is a very old set of kernel headers, this is specific and 
unique to building for MIPS, our ARM/ARM64 targets are using more modern 
components.
-- 
Florian

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

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

On Wed, May 13, 2026 at 2:56 PM Florian Fainelli
<florian.fainelli@broadcom.com> wrote:
>
> On 5/13/26 13:58, Ian Rogers wrote:
> > On Wed, May 13, 2026 at 12:23 PM Florian Fainelli
> > <florian.fainelli@broadcom.com> wrote:
> >>
> >> 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.
> >
> > This seems fine but the commit you mention was added to Linux 4.13. Is
> > there a reason you've run into this problem? The oldest active LTS
> > kernel is 4.19.
>
> The toolchain I am using is still on kernel headers 4.9.x, I am
> cognizant this is a very old set of kernel headers, this is specific and
> unique to building for MIPS, our ARM/ARM64 targets are using more modern
> components.

Sgtm. I have some libunwind clean up for MIPS that I'll add you to, in
case it is of interest since I can't test it myself :-)

For this patch:
Reviewed-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> --
> Florian

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

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

Thread overview: 4+ 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

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