Re: [PATCH] perf trace beauty fcntl: Fix build with older kernel headers

From: Florian Fainelli

Date: Thu May 14 2026 - 12:57:56 EST




On 5/14/2026 9:37 AM, Ian Rogers wrote:
On Thu, May 14, 2026 at 8:56 AM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:

Hello,

On Wed, May 13, 2026 at 12:23:46PM -0700, Florian Fainelli 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.

Can you share the error messages?

The compile errors look like this:

trace/beauty/fcntl.c: In function 'syscall_arg__scnprintf_fcntl_arg':
trace/beauty/fcntl.c:96:13: error: 'F_GET_RW_HINT' undeclared (first use in this function); did you mean 'F_GETOWN'?
cmd == F_GET_RW_HINT || cmd == F_SET_RW_HINT ||
^~~~~~~~~~~~~
F_GETOWN
trace/beauty/fcntl.c:96:13: note: each undeclared identifier is reported only once for each function it appears in
trace/beauty/fcntl.c:96:37: error: 'F_SET_RW_HINT' undeclared (first use in this function); did you mean 'F_SETOWN'?
cmd == F_GET_RW_HINT || cmd == F_SET_RW_HINT ||
^~~~~~~~~~~~~
F_SETOWN
trace/beauty/fcntl.c:97:13: error: 'F_GET_FILE_RW_HINT' undeclared (first use in this function); did you mean 'F_GETOWNER_UIDS'?
cmd == F_GET_FILE_RW_HINT || cmd == F_SET_FILE_RW_HINT)
^~~~~~~~~~~~~~~~~~
F_GETOWNER_UIDS
trace/beauty/fcntl.c:97:42: error: 'F_SET_FILE_RW_HINT' undeclared (first use in this function)
cmd == F_GET_FILE_RW_HINT || cmd == F_SET_FILE_RW_HINT)
^~~~~~~~~~~~~~~~~~


I think this code should use a copy of the header in
trace/beauty/include/uapi/linux/fcntl.h which has the definitions.

I don't think the beauty headers are in the include path.

I suppose if it were however that would provide the missing definition, maybe that's a better path forward to front load the inclusion of trace/beauty/include/uapi/linux/fcntl.h?
--
Florian