[PATCH v2 7/7] perf trace: Update beautifier script for clone flags
From: Namhyung Kim
Date: Thu May 07 2026 - 03:27:33 EST
According to the change in the sched.h, update the script to generate
the flags array like below. Note that '+1' is needed to detect bitmask
pattern at index 0.
$ cat tools/perf/trace/beauty/generated/clone_flags_array.c
static const char *clone_flags[] = {
[32 + 1] = "CLEAR_SIGHAND",
[33 + 1] = "INTO_CGROUP",
[34 + 1] = "AUTOREAP",
[35 + 1] = "NNP",
[36 + 1] = "PIDFD_AUTOKILL",
[37 + 1] = "EMPTY_MNTNS",
};
This was found by Sashiko during review.
Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
---
tools/perf/trace/beauty/clone.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/trace/beauty/clone.sh b/tools/perf/trace/beauty/clone.sh
index 18b6c0d75693721d..f807372519fe2c88 100755
--- a/tools/perf/trace/beauty/clone.sh
+++ b/tools/perf/trace/beauty/clone.sh
@@ -10,8 +10,8 @@ fi
linux_sched=${beauty_uapi_linux_dir}/sched.h
printf "static const char *clone_flags[] = {\n"
-regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+CLONE_([^_]+[[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*'
+regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+CLONE_([^_]+[[:alnum:]_]+)[[:space:]]+\(1ULL[[:space:]]*<<[[:space:]]*([[:digit:]]+)\)[[:space:]]*.*'
grep -E $regex ${linux_sched} | \
sed -r "s/$regex/\2 \1/g" | \
- xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n"
+ xargs printf "\t[%s + 1] = \"%s\",\n"
printf "};\n"
--
2.53.0