]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libpmc/pmc_disable.3
unbound: Vendor import 1.19.0
[FreeBSD/FreeBSD.git] / lib / libpmc / pmc_disable.3
1 .\" Copyright (c) 2007-2008 Joseph Koshy.  All rights reserved.
2 .\"
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
5 .\" are met:
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\"    notice, this list of conditions and the following disclaimer.
8 .\" 2. Redistributions in binary form must reproduce the above copyright
9 .\"    notice, this list of conditions and the following disclaimer in the
10 .\"    documentation and/or other materials provided with the distribution.
11 .\"
12 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22 .\" SUCH DAMAGE.
23 .\"
24 .Dd September 22, 2008
25 .Dt PMC_ENABLE 3
26 .Os
27 .Sh NAME
28 .Nm pmc_disable ,
29 .Nm pmc_enable
30 .Nd administrative control of hardware performance counters
31 .Sh LIBRARY
32 .Lb libpmc
33 .Sh SYNOPSIS
34 .In pmc.h
35 .Ft int
36 .Fn pmc_disable "int cpu" "int pmc"
37 .Ft int
38 .Fn pmc_enable "int cpu" "int pmc"
39 .Sh DESCRIPTION
40 These functions allow specific hardware performance monitoring
41 counters in a system to be disabled and enabled administratively.
42 The hardware performance counters available on each CPU are numbered
43 using small non-negative integers, in a system dependent manner.
44 Disabled counters will not be available to applications for use.
45 .Pp
46 The invoking process needs to have the
47 .Dv PRIV_PMC_MANAGE
48 privilege to perform these operations.
49 .Pp
50 Function
51 .Fn pmc_disable
52 disables the hardware counter numbered by argument
53 .Fa pmc
54 on CPU number
55 .Fa cpu .
56 .Pp
57 Function
58 .Fn pmc_enable
59 enables the hardware counter numbered by argument
60 .Fa pmc
61 on CPU number
62 .Fa cpu .
63 .Sh IMPLEMENTATION NOTES
64 Hardware PMCs that are currently in use by applications cannot be
65 disabled.
66 Allocation of a process scope software PMC marks all
67 hardware PMCs in the system with the same pmc number as being in-use.
68 .Sh RETURN VALUES
69 .Rv -std
70 .Sh ERRORS
71 A call to these functions may fail with the following errors:
72 .Bl -tag -width Er
73 .It Bq Er EBUSY
74 Function
75 .Fn pmc_disable
76 specified a hardware PMC is currently in use.
77 .It Bq Er EINVAL
78 Arguments
79 .Fa cpu
80 or
81 .Fa pmc
82 were invalid.
83 .It Bq Er ENXIO
84 Argument
85 .Fa cpu
86 specified a disabled or absent CPU.
87 .It Bq Er EPERM
88 The current process lacks sufficient privilege to perform this
89 operation.
90 .El
91 .Sh SEE ALSO
92 .Xr pmc 3 ,
93 .Xr pmc_cpuinfo 3 ,
94 .Xr pmc_pmcinfo 3 ,
95 .Xr hwpmc 4 ,
96 .Xr pmccontrol 8 ,
97 .Xr priv_check 9