tools headers UAPI: Sync linux/prctl.h with the kernel sources
To pick new prctl options introduced in:
b507808ebce23561 ("mm: implement memory-deny-write-execute as a prctl")
That results in:
$ diff -u tools/include/uapi/linux/prctl.h include/uapi/linux/prctl.h
--- tools/include/uapi/linux/prctl.h 2022-06-20 17:54:43.
884515663 -0300
+++ include/uapi/linux/prctl.h 2023-03-03 11:18:51.
090923569 -0300
@@ -281,6 +281,12 @@
# define PR_SME_VL_LEN_MASK 0xffff
# define PR_SME_VL_INHERIT (1 << 17) /* inherit across exec */
+/* Memory deny write / execute */
+#define PR_SET_MDWE 65
+# define PR_MDWE_REFUSE_EXEC_GAIN 1
+
+#define PR_GET_MDWE 66
+
#define PR_SET_VMA 0x53564d41
# define PR_SET_VMA_ANON_NAME 0
$ tools/perf/trace/beauty/prctl_option.sh > before
$ cp include/uapi/linux/prctl.h tools/include/uapi/linux/prctl.h
$ tools/perf/trace/beauty/prctl_option.sh > after
$ diff -u before after
--- before 2023-03-03 11:47:43.
320013146 -0300
+++ after 2023-03-03 11:47:50.
937216229 -0300
@@ -59,6 +59,8 @@
[62] = "SCHED_CORE",
[63] = "SME_SET_VL",
[64] = "SME_GET_VL",
+ [65] = "SET_MDWE",
+ [66] = "GET_MDWE",
};
static const char *prctl_set_mm_options[] = {
[1] = "START_CODE",
$
Now users can do:
# perf trace -e syscalls:sys_enter_prctl --filter "option==SET_MDWE||option==GET_MDWE"
^C#
# trace -v -e syscalls:sys_enter_prctl --filter "option==SET_MDWE||option==GET_MDWE"
New filter for syscalls:sys_enter_prctl: (option==65||option==66) && (common_pid != 5519 && common_pid != 3404)
^C#
And when these prctl options appears in a session, they will be
translated to the corresponding string.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joey Gouly <joey.gouly@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/lkml/ZAI%2FAoPXb%2Fsxz1%2Fm@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>