]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/perfmonctl.2
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man2 / perfmonctl.2
CommitLineData
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 9perfmonctl \- 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 :
19There is no glibc wrapper for this system call; see NOTES.
55b9301b 20.SH DESCRIPTION
3c7e310c
MK
21The IA-64-specific
22.BR perfmonctl ()
23system call provides an interface to the
24PMU (performance monitoring unit).
25The PMU consists of PMD (performance monitoring data) registers and
3dfb8d01 26PMC (performance monitoring control) registers,
3c7e310c 27which gather hardware statistics.
efeece04 28.PP
3c7e310c
MK
29.BR perfmonctl ()
30applies the operation
55b9301b 31.I cmd
3c7e310c
MK
32to the input arguments specified by
33.IR arg .
34The number of arguments is defined by \fInarg\fR.
35The
55b9301b 36.I fd
3c7e310c 37argument specifies the perfmon context to operate on.
efeece04 38.PP
3c7e310c 39Supported values for
55b9301b
IV
40.I cmd
41are:
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 47Set up a context.
efeece04 48.IP
55b9301b
IV
49The
50.I fd
3c7e310c
MK
51parameter is ignored.
52A new perfmon context is created as specified in
55b9301b
IV
53.I ctxt
54and its file descriptor is returned in \fIctxt->ctx_fd\fR.
efeece04 55.IP
0609db2a
MK
56The file descriptor can be used in subsequent calls to
57.BR perfmonctl ()
58and can be used to read event notifications (type
59.IR pfm_msg_t )
60using
61.BR read (2).
62The file descriptor is pollable using
63.BR select (2),
64.BR poll (2),
55b9301b 65and
0609db2a 66.BR epoll (7).
efeece04 67.IP
0609db2a 68The context can be destroyed by calling
55b9301b 69.BR close (2)
0609db2a 70on 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
77Set 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()
84Set 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 91Read 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 99Start 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 106Stop 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 113Attach 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 120Detach 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 127Restart 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
140If
141.I val
142is 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
149Reset 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 173returns zero when the operation is successful.
65d669f4
MK
174On error, \-1 is returned and
175.I errno
855d489a 176is set to indicate the error.
39e10583
MK
177.SH VERSIONS
178.BR perfmonctl ()
9c6ca43e
MK
179was added in Linux 2.4;
180.\" commit ecf5b72d5f66af843f189dfe9ce31598c3e48ad7
181it was removed in Linux 5.10.
3113c7f3 182.SH STANDARDS
39e10583 183.BR perfmonctl ()
76c637e1 184is Linux-specific and is available only on the IA-64 architecture.
439335f7 185.SH NOTES
9c6ca43e
MK
186This system call was broken for many years,
187and ultimately removed in Linux 5.10.
188.PP
189Glibc does not provide a wrapper for this system call;
190on 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 195The perfmon2 interface specification