Skip to content

Commit ab5fce8

Browse files
committed
Merge tag 'perf-tools-fixes-for-v7.1-2026-05-18' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools
Pull perf-tools fixes "An usual sync-up for the header files and related code: - copy headers that are used for perf trace syscall beautifier - update the beautifier scripts according to the changes - don't show differences in the headers by default" * tag 'perf-tools-fixes-for-v7.1-2026-05-18' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: perf trace: Update beautifier script for clone flags perf trace: Add beautifier script for fsmount flags perf build: Add make check-headers target perf trace: Sync uapi/linux/sched.h with the kernel source perf trace: Sync uapi/linux/mount.h with the kernel source perf trace: Sync uapi/linux/fs.h with the kernel source perf trace: Sync linux/socket.h with the kernel source
2 parents 8cf8b5a + 9a424b6 commit ab5fce8

12 files changed

Lines changed: 93 additions & 20 deletions

File tree

tools/perf/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,14 @@ build-test:
111111
build-test-tarball:
112112
@$(MAKE) -f tests/make REUSE_FEATURES_DUMP=1 MK=Makefile SET_PARALLEL=1 --no-print-directory out
113113

114+
check-headers:
115+
@./check-headers.sh
116+
114117
#
115118
# All other targets get passed through:
116119
#
117120
%: FORCE
118121
$(print_msg)
119122
$(make)
120123

121-
.PHONY: tags TAGS FORCE Makefile
124+
.PHONY: tags TAGS FORCE Makefile build-test build-test-tarball check-headers

tools/perf/Makefile.perf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ goals := $(filter-out all sub-make, $(MAKECMDGOALS))
285285
$(goals) all: sub-make
286286

287287
sub-make: fixdep
288-
@./check-headers.sh
289288
$(Q)$(MAKE) FIXDEP_BUILT=1 -f Makefile.perf $(goals)
290289

291290
else # force_fixdep
@@ -565,6 +564,12 @@ fsmount_tbls := $(srctree)/tools/perf/trace/beauty/fsmount.sh
565564
$(fsmount_arrays): $(beauty_uapi_linux_dir)/mount.h $(fsmount_tbls)
566565
$(Q)$(SHELL) '$(fsmount_tbls)' $(beauty_uapi_linux_dir) > $@
567566

567+
fsmount_attr_arrays := $(beauty_outdir)/fsmount_attr_arrays.c
568+
fsmount_attr_tbls := $(srctree)/tools/perf/trace/beauty/fsmount_attr.sh
569+
570+
$(fsmount_attr_arrays): $(beauty_uapi_linux_dir)/mount.h $(fsmount_attr_tbls)
571+
$(Q)$(SHELL) '$(fsmount_attr_tbls)' $(beauty_uapi_linux_dir) > $@
572+
568573
fspick_arrays := $(beauty_outdir)/fspick_arrays.c
569574
fspick_tbls := $(srctree)/tools/perf/trace/beauty/fspick.sh
570575

@@ -855,6 +860,7 @@ prepare: $(OUTPUT)PERF-VERSION-FILE archheaders \
855860
$(fadvise_advice_array) \
856861
$(fsconfig_arrays) \
857862
$(fsmount_arrays) \
863+
$(fsmount_attr_arrays) \
858864
$(fspick_arrays) \
859865
$(pkey_alloc_access_rights_array) \
860866
$(sndrv_pcm_ioctl_array) \
@@ -1302,6 +1308,7 @@ clean:: $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBSYMBOL)-clean $(
13021308
$(OUTPUT)$(fadvise_advice_array) \
13031309
$(OUTPUT)$(fsconfig_arrays) \
13041310
$(OUTPUT)$(fsmount_arrays) \
1311+
$(OUTPUT)$(fsmount_attr_arrays) \
13051312
$(OUTPUT)$(fspick_arrays) \
13061313
$(OUTPUT)$(madvise_behavior_array) \
13071314
$(OUTPUT)$(mmap_flags_array) \

tools/perf/builtin-trace.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -771,11 +771,6 @@ static const char *bpf_cmd[] = {
771771
};
772772
static DEFINE_STRARRAY(bpf_cmd, "BPF_");
773773

774-
static const char *fsmount_flags[] = {
775-
[1] = "CLOEXEC",
776-
};
777-
static DEFINE_STRARRAY(fsmount_flags, "FSMOUNT_");
778-
779774
#include "trace/beauty/generated/fsconfig_arrays.c"
780775

781776
static DEFINE_STRARRAY(fsconfig_cmds, "FSCONFIG_");
@@ -1202,7 +1197,9 @@ static const struct syscall_fmt syscall_fmts[] = {
12021197
{ .name = "fsconfig",
12031198
.arg = { [1] = STRARRAY(cmd, fsconfig_cmds), }, },
12041199
{ .name = "fsmount",
1205-
.arg = { [1] = STRARRAY_FLAGS(flags, fsmount_flags),
1200+
.arg = { [1] = { .scnprintf = SCA_FSMOUNT_FLAGS, /* fsmount_flags */
1201+
.strtoul = STUL_STRARRAYS,
1202+
.show_zero = true, },
12061203
[2] = { .scnprintf = SCA_FSMOUNT_ATTR_FLAGS, /* attr_flags */ }, }, },
12071204
{ .name = "fspick",
12081205
.arg = { [0] = { .scnprintf = SCA_FDAT, /* dfd */ },

tools/perf/trace/beauty/beauty.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ size_t syscall_arg__scnprintf_fcntl_arg(char *bf, size_t size, struct syscall_ar
179179
size_t syscall_arg__scnprintf_flock(char *bf, size_t size, struct syscall_arg *arg);
180180
#define SCA_FLOCK syscall_arg__scnprintf_flock
181181

182+
size_t syscall_arg__scnprintf_fsmount_flags(char *bf, size_t size, struct syscall_arg *arg);
183+
#define SCA_FSMOUNT_FLAGS syscall_arg__scnprintf_fsmount_flags
184+
182185
size_t syscall_arg__scnprintf_fsmount_attr_flags(char *bf, size_t size, struct syscall_arg *arg);
183186
#define SCA_FSMOUNT_ATTR_FLAGS syscall_arg__scnprintf_fsmount_attr_flags
184187

tools/perf/trace/beauty/clone.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+CLONE_([^_]+[[:alnum:]_]+)[[:
1414
grep -E $regex ${linux_sched} | \
1515
sed -r "s/$regex/\2 \1/g" | \
1616
xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n"
17+
regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+CLONE_([^_]+[[:alnum:]_]+)[[:space:]]+\(1ULL[[:space:]]*<<[[:space:]]*([[:digit:]]+)\)[[:space:]]*.*'
18+
grep -E $regex ${linux_sched} | \
19+
sed -r "s/$regex/\2 \1/g" | \
20+
xargs printf "\t[%s + 1] = \"%s\",\n"
1721
printf "};\n"

tools/perf/trace/beauty/fsmount.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,25 @@
1616
#define MOUNT_ATTR_RELATIME 0x00000000 /* - Update atime relative to mtime/ctime. */
1717
#endif
1818

19-
static size_t fsmount__scnprintf_attr_flags(unsigned long flags, char *bf, size_t size, bool show_prefix)
19+
20+
static size_t fsmount__scnprintf_flags(unsigned long flags, char *bf, size_t size, bool show_prefix)
2021
{
2122
#include "trace/beauty/generated/fsmount_arrays.c"
23+
static DEFINE_STRARRAY(fsmount_flags, "FSMOUNT_");
24+
25+
return strarray__scnprintf_flags(&strarray__fsmount_flags, bf, size, show_prefix, flags);
26+
}
27+
28+
size_t syscall_arg__scnprintf_fsmount_flags(char *bf, size_t size, struct syscall_arg *arg)
29+
{
30+
unsigned long flags = arg->val;
31+
32+
return fsmount__scnprintf_flags(flags, bf, size, arg->show_string_prefix);
33+
}
34+
35+
static size_t fsmount__scnprintf_attr_flags(unsigned long flags, char *bf, size_t size, bool show_prefix)
36+
{
37+
#include "trace/beauty/generated/fsmount_attr_arrays.c"
2238
static DEFINE_STRARRAY(fsmount_attr_flags, "MOUNT_ATTR_");
2339
size_t printed = 0;
2440

tools/perf/trace/beauty/fsmount.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@ fi
99

1010
linux_mount=${beauty_uapi_linux_dir}/mount.h
1111

12-
# Remove MOUNT_ATTR_RELATIME as it is zeros, handle it a special way in the beautifier
13-
# Only handle MOUNT_ATTR_ followed by a capital letter/num as __ is special case
14-
# for things like MOUNT_ATTR__ATIME that is a mask for the possible ATIME handling
15-
# bits. Special case it as well in the beautifier
16-
17-
printf "static const char *fsmount_attr_flags[] = {\n"
18-
regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MOUNT_ATTR_([[:alnum:]][[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*'
19-
grep -E $regex ${linux_mount} | grep -v MOUNT_ATTR_RELATIME | \
12+
printf "static const char *fsmount_flags[] = {\n"
13+
regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+FSMOUNT_([[:alnum:]][[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*'
14+
grep -E $regex ${linux_mount} | \
2015
sed -r "s/$regex/\2 \1/g" | \
2116
xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n"
2217
printf "};\n"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
# SPDX-License-Identifier: LGPL-2.1
3+
4+
if [ $# -ne 1 ] ; then
5+
beauty_uapi_linux_dir=tools/perf/trace/beauty/include/uapi/linux/
6+
else
7+
beauty_uapi_linux_dir=$1
8+
fi
9+
10+
linux_mount=${beauty_uapi_linux_dir}/mount.h
11+
12+
# Remove MOUNT_ATTR_RELATIME as it is zeros, handle it a special way in the beautifier
13+
# Only handle MOUNT_ATTR_ followed by a capital letter/num as __ is special case
14+
# for things like MOUNT_ATTR__ATIME that is a mask for the possible ATIME handling
15+
# bits. Special case it as well in the beautifier
16+
17+
printf "static const char *fsmount_attr_flags[] = {\n"
18+
regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MOUNT_ATTR_([[:alnum:]][[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*'
19+
grep -E $regex ${linux_mount} | grep -v MOUNT_ATTR_RELATIME | \
20+
sed -r "s/$regex/\2 \1/g" | \
21+
xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n"
22+
printf "};\n"

tools/perf/trace/beauty/include/linux/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ struct __kernel_timespec;
415415
struct old_timespec32;
416416

417417
struct scm_timestamping_internal {
418-
struct timespec64 ts[3];
418+
ktime_t ts[3];
419419
};
420420

421421
extern void put_cmsg_scm_timestamping64(struct msghdr *msg, struct scm_timestamping_internal *tss);

tools/perf/trace/beauty/include/uapi/linux/fs.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,4 +657,16 @@ struct procmap_query {
657657
__u64 build_id_addr; /* in */
658658
};
659659

660+
/*
661+
* Shutdown the filesystem.
662+
*/
663+
#define FS_IOC_SHUTDOWN _IOR('X', 125, __u32)
664+
665+
/*
666+
* Flags for FS_IOC_SHUTDOWN
667+
*/
668+
#define FS_SHUTDOWN_FLAGS_DEFAULT 0x0
669+
#define FS_SHUTDOWN_FLAGS_LOGFLUSH 0x1 /* flush log but not data*/
670+
#define FS_SHUTDOWN_FLAGS_NOLOGFLUSH 0x2 /* don't flush log nor data */
671+
660672
#endif /* _UAPI_LINUX_FS_H */

0 commit comments

Comments
 (0)