]>
Commit | Line | Data |
---|---|---|
55b9301b | 1 | .\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. |
f2b29ffe | 2 | .\" and Copyright (C) 2013 Michael Kerrisk <mtk.manpages@gmail.com> |
55b9301b IV |
3 | .\" Written by Ivana Varekova <varekova@redhat.com> |
4 | .\" | |
5fbde956 | 5 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
55b9301b | 6 | .\" |
45186a5d | 7 | .TH PERFMONCTL 2 2021-03-22 "Linux man-pages (unreleased)" |
55b9301b | 8 | .SH NAME |
3dfb8d01 | 9 | perfmonctl \- interface to IA-64 performance monitoring unit |
55b9301b IV |
10 | .SH SYNOPSIS |
11 | .nf | |
12 | .B #include <syscall.h> | |
13 | .B #include <perfmon.h> | |
68e4db0a | 14 | .PP |
9bfc9cb1 | 15 | .BI "long perfmonctl(int " fd ", int " cmd ", void *" arg ", int " narg ");" |
55b9301b | 16 | .fi |
fb308416 | 17 | .PP |
439335f7 MK |
18 | .IR Note : |
19 | There is no glibc wrapper for this system call; see NOTES. | |
55b9301b | 20 | .SH DESCRIPTION |
3c7e310c MK |
21 | The IA-64-specific |
22 | .BR perfmonctl () | |
23 | system call provides an interface to the | |
24 | PMU (performance monitoring unit). | |
25 | The PMU consists of PMD (performance monitoring data) registers and | |
3dfb8d01 | 26 | PMC (performance monitoring control) registers, |
3c7e310c | 27 | which gather hardware statistics. |
efeece04 | 28 | .PP |
3c7e310c MK |
29 | .BR perfmonctl () |
30 | applies the operation | |
55b9301b | 31 | .I cmd |
3c7e310c MK |
32 | to the input arguments specified by |
33 | .IR arg . | |
34 | The number of arguments is defined by \fInarg\fR. | |
35 | The | |
55b9301b | 36 | .I fd |
3c7e310c | 37 | argument specifies the perfmon context to operate on. |
efeece04 | 38 | .PP |
3c7e310c | 39 | Supported values for |
55b9301b IV |
40 | .I cmd |
41 | are: | |
55b9301b | 42 | .TP |
3dfb8d01 | 43 | .B PFM_CREATE_CONTEXT |
55b9301b | 44 | .nf |
9bfc9cb1 | 45 | .BI "perfmonctl(int " fd ", PFM_CREATE_CONTEXT, pfarg_context_t *" ctxt ", 1);" |
55b9301b | 46 | .fi |
3dfb8d01 | 47 | Set up a context. |
efeece04 | 48 | .IP |
55b9301b IV |
49 | The |
50 | .I fd | |
3c7e310c MK |
51 | parameter is ignored. |
52 | A new perfmon context is created as specified in | |
55b9301b IV |
53 | .I ctxt |
54 | and its file descriptor is returned in \fIctxt->ctx_fd\fR. | |
efeece04 | 55 | .IP |
0609db2a MK |
56 | The file descriptor can be used in subsequent calls to |
57 | .BR perfmonctl () | |
58 | and can be used to read event notifications (type | |
59 | .IR pfm_msg_t ) | |
60 | using | |
61 | .BR read (2). | |
62 | The file descriptor is pollable using | |
63 | .BR select (2), | |
64 | .BR poll (2), | |
55b9301b | 65 | and |
0609db2a | 66 | .BR epoll (7). |
efeece04 | 67 | .IP |
0609db2a | 68 | The context can be destroyed by calling |
55b9301b | 69 | .BR close (2) |
0609db2a | 70 | on the file descriptor. |
55b9301b IV |
71 | .TP |
72 | .B PFM_WRITE_PMCS | |
3c7e310c | 73 | .\" pfm_write_pmcs() |
55b9301b | 74 | .nf |
9bfc9cb1 | 75 | .BI "perfmonctl(int " fd ", PFM_WRITE_PMCS, pfarg_reg_t *" pmcs ", n);" |
55b9301b | 76 | .fi |
3dfb8d01 MK |
77 | Set PMC registers. |
78 | .TP | |
3c7e310c | 79 | .B PFM_WRITE_PMDS |
55b9301b | 80 | .nf |
9bfc9cb1 | 81 | .BI "perfmonctl(int " fd ", PFM_WRITE_PMDS, pfarg_reg_t *" pmds ", n);" |
55b9301b | 82 | .fi |
3dfb8d01 MK |
83 | .\" pfm_write_pmds() |
84 | Set PMD registers. | |
55b9301b | 85 | .TP |
3c7e310c MK |
86 | .B PFM_READ_PMDS |
87 | .\" pfm_read_pmds() | |
55b9301b | 88 | .nf |
9bfc9cb1 | 89 | .BI "perfmonctl(int " fd ", PFM_READ_PMDS, pfarg_reg_t *" pmds ", n);" |
55b9301b | 90 | .fi |
3dfb8d01 | 91 | Read PMD registers. |
55b9301b | 92 | .TP |
3c7e310c MK |
93 | .B PFM_START |
94 | .\" pfm_start() | |
55b9301b | 95 | .nf |
3c7e310c | 96 | .\" .BI "perfmonctl(int " fd ", PFM_START, arg, 1); |
9bfc9cb1 | 97 | .BI "perfmonctl(int " fd ", PFM_START, NULL, 0);" |
55b9301b | 98 | .fi |
3dfb8d01 | 99 | Start monitoring. |
55b9301b | 100 | .TP |
3dfb8d01 | 101 | .B PFM_STOP |
3c7e310c | 102 | .\" pfm_stop() |
55b9301b | 103 | .nf |
9bfc9cb1 | 104 | .BI "perfmonctl(int " fd ", PFM_STOP, NULL, 0);" |
55b9301b | 105 | .fi |
3dfb8d01 | 106 | Stop monitoring. |
55b9301b | 107 | .TP |
3c7e310c MK |
108 | .B PFM_LOAD_CONTEXT |
109 | .\" pfm_context_load() | |
55b9301b | 110 | .nf |
9bfc9cb1 | 111 | .BI "perfmonctl(int " fd ", PFM_LOAD_CONTEXT, pfarg_load_t *" largs ", 1);" |
55b9301b | 112 | .fi |
3dfb8d01 | 113 | Attach the context to a thread. |
55b9301b | 114 | .TP |
3dfb8d01 | 115 | .B PFM_UNLOAD_CONTEXT |
3c7e310c | 116 | .\" pfm_context_unload() |
55b9301b | 117 | .nf |
9bfc9cb1 | 118 | .BI "perfmonctl(int " fd ", PFM_UNLOAD_CONTEXT, NULL, 0);" |
55b9301b | 119 | .fi |
3dfb8d01 | 120 | Detach the context from a thread. |
55b9301b | 121 | .TP |
3dfb8d01 | 122 | .B PFM_RESTART |
3c7e310c | 123 | .\" pfm_restart() |
55b9301b | 124 | .nf |
9bfc9cb1 | 125 | .BI "perfmonctl(int " fd ", PFM_RESTART, NULL, 0);" |
55b9301b | 126 | .fi |
3dfb8d01 | 127 | Restart monitoring after receiving an overflow notification. |
f2b29ffe MK |
128 | .TP |
129 | .B PFM_GET_FEATURES | |
130 | .\" pfm_get_features() | |
131 | .nf | |
9bfc9cb1 | 132 | .BI "perfmonctl(int " fd ", PFM_GET_FEATURES, pfarg_features_t *" arg ", 1);" |
f2b29ffe MK |
133 | .fi |
134 | .TP | |
135 | .B PFM_DEBUG | |
136 | .\" pfm_debug() | |
137 | .nf | |
9bfc9cb1 | 138 | .BI "perfmonctl(int " fd ", PFM_DEBUG, " val ", 0);" |
f2b29ffe MK |
139 | .fi |
140 | If | |
141 | .I val | |
142 | is nonzero, enable debugging mode, otherwise disable. | |
143 | .TP | |
144 | .B PFM_GET_PMC_RESET_VAL | |
145 | .\" pfm_get_pmc_reset() | |
146 | .nf | |
9bfc9cb1 | 147 | .BI "perfmonctl(int " fd ", PFM_GET_PMC_RESET_VAL, pfarg_reg_t *" req ", n);" |
f2b29ffe MK |
148 | .fi |
149 | Reset PMC registers to default values. | |
06a2b631 MK |
150 | .\" |
151 | .\" | |
734fd1f2 | 152 | .\" .TP |
3dfb8d01 MK |
153 | .\" .B PFM_CREATE_EVTSETS |
154 | .\" | |
734fd1f2 MK |
155 | .\" create or modify event sets |
156 | .\" .nf | |
157 | .\" .BI "perfmonctl(int " fd ", PFM_CREATE_EVTSETS, pfarg_setdesc_t *desc , n); | |
158 | .\" .fi | |
159 | .\" .TP | |
3dfb8d01 | 160 | .\" .B PFM_DELETE_EVTSETS |
734fd1f2 MK |
161 | .\" delete event sets |
162 | .\" .nf | |
163 | .\" .BI "perfmonctl(int " fd ", PFM_DELETE_EVTSET, pfarg_setdesc_t *desc , n); | |
164 | .\" .fi | |
165 | .\" .TP | |
3dfb8d01 MK |
166 | .\" .B PFM_GETINFO_EVTSETS |
167 | .\" get information about event sets | |
734fd1f2 MK |
168 | .\" .nf |
169 | .\" .BI "perfmonctl(int " fd ", PFM_GETINFO_EVTSETS, pfarg_setinfo_t *info, n); | |
170 | .\" .fi | |
47297adb | 171 | .SH RETURN VALUE |
9f001135 | 172 | .BR perfmonctl () |
55b9301b | 173 | returns zero when the operation is successful. |
65d669f4 MK |
174 | On error, \-1 is returned and |
175 | .I errno | |
855d489a | 176 | is set to indicate the error. |
39e10583 MK |
177 | .SH VERSIONS |
178 | .BR perfmonctl () | |
9c6ca43e MK |
179 | was added in Linux 2.4; |
180 | .\" commit ecf5b72d5f66af843f189dfe9ce31598c3e48ad7 | |
181 | it was removed in Linux 5.10. | |
3113c7f3 | 182 | .SH STANDARDS |
39e10583 | 183 | .BR perfmonctl () |
76c637e1 | 184 | is Linux-specific and is available only on the IA-64 architecture. |
439335f7 | 185 | .SH NOTES |
9c6ca43e MK |
186 | This system call was broken for many years, |
187 | and ultimately removed in Linux 5.10. | |
188 | .PP | |
189 | Glibc does not provide a wrapper for this system call; | |
190 | on kernels where it exists, call it using | |
439335f7 | 191 | .BR syscall (2). |
47297adb | 192 | .SH SEE ALSO |
e2b6e497 | 193 | .BR gprof (1) |
efeece04 | 194 | .PP |
e2b6e497 | 195 | The perfmon2 interface specification |