Skip to content

Commit 0efc88e

Browse files
committed
tools headers UAPI: Sync linux/prctl.h with the kernel sources
To pick the changes in: 628d701 ("powerpc/dexcr: Add DEXCR prctl interface") 6b9391b ("riscv: Include riscv_set_icache_flush_ctx prctl") That adds some PowerPC and a RISC-V specific prctl options: $ tools/perf/trace/beauty/prctl_option.sh > before $ cp include/uapi/linux/prctl.h tools/perf/trace/beauty/include/uapi/linux/prctl.h $ tools/perf/trace/beauty/prctl_option.sh > after $ diff -u before after --- before 2024-05-27 12:14:21.358032781 -0300 +++ after 2024-05-27 12:14:32.364530185 -0300 @@ -65,6 +65,9 @@ [68] = "GET_MEMORY_MERGE", [69] = "RISCV_V_SET_CONTROL", [70] = "RISCV_V_GET_CONTROL", + [71] = "RISCV_SET_ICACHE_FLUSH_CTX", + [72] = "PPC_GET_DEXCR", + [73] = "PPC_SET_DEXCR", }; static const char *prctl_set_mm_options[] = { [1] = "START_CODE", $ That now will be used to decode the syscall option and also to compose filters, for instance: [root@five ~]# perf trace -e syscalls:sys_enter_prctl --filter option==SET_NAME 0.000 Isolated Servi/3474327 syscalls:sys_enter_prctl(option: SET_NAME, arg2: 0x7f23f13b7aee) 0.032 DOM Worker/3474327 syscalls:sys_enter_prctl(option: SET_NAME, arg2: 0x7f23deb25670) 7.920 :3474328/3474328 syscalls:sys_enter_prctl(option: SET_NAME, arg2: 0x7f23e24fbb10) 7.935 StreamT~s #374/3474328 syscalls:sys_enter_prctl(option: SET_NAME, arg2: 0x7f23e24fb970) 8.400 Isolated Servi/3474329 syscalls:sys_enter_prctl(option: SET_NAME, arg2: 0x7f23e24bab10) 8.418 StreamT~s #374/3474329 syscalls:sys_enter_prctl(option: SET_NAME, arg2: 0x7f23e24ba970) ^C[root@five ~]# This addresses this perf build warning: Warning: Kernel ABI header differences: diff -u tools/include/uapi/linux/prctl.h include/uapi/linux/prctl.h Cc: Adrian Hunter <[email protected]> Cc: Benjamin Gray <[email protected]> Cc: Charlie Jenkins <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Palmer Dabbelt <[email protected]> Link: https://lore.kernel.org/lkml/ZlSklGWp--v_Ije7@x1 Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent e5c7bd4 commit 0efc88e

File tree

1 file changed

+22
-0
lines changed
  • tools/perf/trace/beauty/include/uapi/linux

1 file changed

+22
-0
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,4 +306,26 @@ struct prctl_mm_map {
306306
# define PR_RISCV_V_VSTATE_CTRL_NEXT_MASK 0xc
307307
# define PR_RISCV_V_VSTATE_CTRL_MASK 0x1f
308308

309+
#define PR_RISCV_SET_ICACHE_FLUSH_CTX 71
310+
# define PR_RISCV_CTX_SW_FENCEI_ON 0
311+
# define PR_RISCV_CTX_SW_FENCEI_OFF 1
312+
# define PR_RISCV_SCOPE_PER_PROCESS 0
313+
# define PR_RISCV_SCOPE_PER_THREAD 1
314+
315+
/* PowerPC Dynamic Execution Control Register (DEXCR) controls */
316+
#define PR_PPC_GET_DEXCR 72
317+
#define PR_PPC_SET_DEXCR 73
318+
/* DEXCR aspect to act on */
319+
# define PR_PPC_DEXCR_SBHE 0 /* Speculative branch hint enable */
320+
# define PR_PPC_DEXCR_IBRTPD 1 /* Indirect branch recurrent target prediction disable */
321+
# define PR_PPC_DEXCR_SRAPD 2 /* Subroutine return address prediction disable */
322+
# define PR_PPC_DEXCR_NPHIE 3 /* Non-privileged hash instruction enable */
323+
/* Action to apply / return */
324+
# define PR_PPC_DEXCR_CTRL_EDITABLE 0x1 /* Aspect can be modified with PR_PPC_SET_DEXCR */
325+
# define PR_PPC_DEXCR_CTRL_SET 0x2 /* Set the aspect for this process */
326+
# define PR_PPC_DEXCR_CTRL_CLEAR 0x4 /* Clear the aspect for this process */
327+
# define PR_PPC_DEXCR_CTRL_SET_ONEXEC 0x8 /* Set the aspect on exec */
328+
# define PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC 0x10 /* Clear the aspect on exec */
329+
# define PR_PPC_DEXCR_CTRL_MASK 0x1f
330+
309331
#endif /* _LINUX_PRCTL_H */

0 commit comments

Comments
 (0)