]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - lib/libpmc/pmc_disable.3
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.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 .\" $FreeBSD$
25 .\"
26 .Dd September 22, 2008
27 .Dt PMC_ENABLE 3
28 .Os
29 .Sh NAME
30 .Nm pmc_disable ,
31 .Nm pmc_enable
32 .Nd administrative control of hardware performance counters
33 .Sh LIBRARY
34 .Lb libpmc
35 .Sh SYNOPSIS
36 .In pmc.h
37 .Ft int
38 .Fn pmc_disable "int cpu" "int pmc"
39 .Ft int
40 .Fn pmc_enable "int cpu" "int pmc"
41 .Sh DESCRIPTION
42 These functions allow specific hardware performance monitoring
43 counters in a system to be disabled and enabled administratively.
44 The hardware performance counters available on each CPU are numbered
45 using small non-negative integers, in a system dependent manner.
46 Disabled counters will not be available to applications for use.
47 .Pp
48 The invoking process needs to have the
49 .Dv PRIV_PMC_MANAGE
50 privilege to perform these operations.
51 .Pp
52 Function
53 .Fn pmc_disable
54 disables the hardware counter numbered by argument
55 .Fa pmc
56 on CPU number
57 .Fa cpu .
58 .Pp
59 Function
60 .Fn pmc_enable
61 enables the hardware counter numbered by argument
62 .Fa pmc
63 on CPU number
64 .Fa cpu .
65 .Sh IMPLEMENTATION NOTES
66 Hardware PMCs that are currently in use by applications cannot be
67 disabled.
68 Allocation of a process scope software PMC marks all
69 hardware PMCs in the system with the same pmc number as being in-use.
70 .Sh RETURN VALUES
71 .Rv -std
72 .Sh ERRORS
73 A call to these functions may fail with the following errors:
74 .Bl -tag -width Er
75 .It Bq Er EBUSY
76 Function
77 .Fn pmc_disable
78 specified a hardware PMC is currently in use.
79 .It Bq Er EINVAL
80 Arguments
81 .Fa cpu
82 or
83 .Fa pmc
84 were invalid.
85 .It Bq Er ENXIO
86 Argument
87 .Fa cpu
88 specified a disabled or absent CPU.
89 .It Bq Er EPERM
90 The current process lacks sufficient privilege to perform this
91 operation.
92 .El
93 .Sh SEE ALSO
94 .Xr pmc 3 ,
95 .Xr pmc_cpuinfo 3 ,
96 .Xr pmc_pmcinfo 3 ,
97 .Xr hwpmc 4 ,
98 .Xr pmccontrol 8 ,
99 .Xr priv_check 9