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