| 1 |
.\" Copyright 2012, International Business Machines Corp. |
| 2 |
.\" Copyright, the authors of the Linux man-pages project |
| 3 |
.\" |
| 4 |
.\" SPDX-License-Identifier: GPL-2.0-or-later |
| 5 |
.\" |
| 6 |
.TH s390_runtime_instr 2 2026-02-08 "Linux man-pages 6.18" |
| 7 |
.SH NAME |
| 8 |
s390_runtime_instr \- enable/disable s390 CPU run-time instrumentation |
| 9 |
.SH LIBRARY |
| 10 |
Standard C library |
| 11 |
.RI ( libc ,\~ \-lc ) |
| 12 |
.SH SYNOPSIS |
| 13 |
.nf |
| 14 |
.BR "#include <asm/runtime_instr.h>" " /* Definition of " S390_* " constants */" |
| 15 |
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */" |
| 16 |
.B #include <unistd.h> |
| 17 |
.P |
| 18 |
.BI "int syscall(SYS_s390_runtime_instr, int " command ", int " signum ); |
| 19 |
.fi |
| 20 |
.P |
| 21 |
.IR Note : |
| 22 |
glibc provides no wrapper for |
| 23 |
.BR s390_runtime_instr (), |
| 24 |
necessitating the use of |
| 25 |
.BR syscall (2). |
| 26 |
.SH DESCRIPTION |
| 27 |
The |
| 28 |
.BR s390_runtime_instr () |
| 29 |
system call starts or stops CPU run-time instrumentation for the |
| 30 |
calling thread. |
| 31 |
.P |
| 32 |
The |
| 33 |
.I command |
| 34 |
argument controls whether run-time instrumentation is started |
| 35 |
.RB ( S390_RUNTIME_INSTR_START , |
| 36 |
1) or stopped |
| 37 |
.RB ( S390_RUNTIME_INSTR_STOP , |
| 38 |
2) for the calling thread. |
| 39 |
.P |
| 40 |
The |
| 41 |
.I signum |
| 42 |
argument specifies the number of a real-time signal. |
| 43 |
This argument was used to specify a signal number that should be delivered |
| 44 |
to the thread if the run-time instrumentation buffer was full or if |
| 45 |
the run-time-instrumentation-halted interrupt had occurred. |
| 46 |
This feature was never used, |
| 47 |
and in Linux 4.4 support for this feature was removed; |
| 48 |
.\" commit b38feccd663b55ab07116208b68e1ffc7c3c7e78 |
| 49 |
thus, in current kernels, this argument is ignored. |
| 50 |
.SH RETURN VALUE |
| 51 |
On success, |
| 52 |
.BR s390_runtime_instr () |
| 53 |
returns 0 and enables the thread for |
| 54 |
run-time instrumentation by assigning the thread a default run-time |
| 55 |
instrumentation control block. |
| 56 |
The caller can then read and modify the control block and start the run-time |
| 57 |
instrumentation. |
| 58 |
On error, \-1 is returned and |
| 59 |
.I errno |
| 60 |
is set to indicate the error. |
| 61 |
.SH ERRORS |
| 62 |
.TP |
| 63 |
.B EINVAL |
| 64 |
The value specified in |
| 65 |
.I command |
| 66 |
is not a valid command. |
| 67 |
.TP |
| 68 |
.B EINVAL |
| 69 |
The value specified in |
| 70 |
.I signum |
| 71 |
is not a real-time signal number. |
| 72 |
From Linux 4.4 onwards, the |
| 73 |
.I signum |
| 74 |
argument has no effect, |
| 75 |
so that an invalid signal number will not result in an error. |
| 76 |
.TP |
| 77 |
.B ENOMEM |
| 78 |
Allocating memory for the run-time instrumentation control block failed. |
| 79 |
.TP |
| 80 |
.B EOPNOTSUPP |
| 81 |
The run-time instrumentation facility is not available. |
| 82 |
.SH STANDARDS |
| 83 |
Linux on s390. |
| 84 |
.SH HISTORY |
| 85 |
Linux 3.7. |
| 86 |
System z EC12. |
| 87 |
.SH NOTES |
| 88 |
The |
| 89 |
.I asm/runtime_instr.h |
| 90 |
header file is available |
| 91 |
.\" commit df2f815a7df7edb5335a3bdeee6a8f9f6f9c35c4 |
| 92 |
since Linux 4.16. |
| 93 |
.P |
| 94 |
Starting with Linux 4.4, |
| 95 |
support for signalling was removed, as was the check whether |
| 96 |
.I signum |
| 97 |
is a valid real-time signal. |
| 98 |
For backwards compatibility with older kernels, it is recommended to pass |
| 99 |
a valid real-time signal number in |
| 100 |
.I signum |
| 101 |
and install a handler for that signal. |
| 102 |
.SH SEE ALSO |
| 103 |
.BR syscall (2), |
| 104 |
.BR signal (7) |