xref: /freebsd/lib/libpmc/pmc_set.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1677d4530SJoseph Koshy.\" Copyright (c) 2007 Joseph Koshy.  All rights reserved.
2677d4530SJoseph Koshy.\"
3677d4530SJoseph Koshy.\" Redistribution and use in source and binary forms, with or without
4677d4530SJoseph Koshy.\" modification, are permitted provided that the following conditions
5677d4530SJoseph Koshy.\" are met:
6677d4530SJoseph Koshy.\" 1. Redistributions of source code must retain the above copyright
7677d4530SJoseph Koshy.\"    notice, this list of conditions and the following disclaimer.
8677d4530SJoseph Koshy.\" 2. Redistributions in binary form must reproduce the above copyright
9677d4530SJoseph Koshy.\"    notice, this list of conditions and the following disclaimer in the
10677d4530SJoseph Koshy.\"    documentation and/or other materials provided with the distribution.
11677d4530SJoseph Koshy.\"
12*026dbd29SChristian Brueffer.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13*026dbd29SChristian Brueffer.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14*026dbd29SChristian Brueffer.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15*026dbd29SChristian Brueffer.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16*026dbd29SChristian Brueffer.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17*026dbd29SChristian Brueffer.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18*026dbd29SChristian Brueffer.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19*026dbd29SChristian Brueffer.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20*026dbd29SChristian Brueffer.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21*026dbd29SChristian Brueffer.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22*026dbd29SChristian Brueffer.\" SUCH DAMAGE.
23677d4530SJoseph Koshy.\"
24677d4530SJoseph Koshy.Dd November 25, 2007
25677d4530SJoseph Koshy.Dt PMC_SET 3
26aa12cea2SUlrich Spörlein.Os
27677d4530SJoseph Koshy.Sh NAME
28677d4530SJoseph Koshy.Nm pmc_set
29677d4530SJoseph Koshy.Nd set the reload count of a sampling PMC
30677d4530SJoseph Koshy.Sh LIBRARY
31677d4530SJoseph Koshy.Lb libpmc
32677d4530SJoseph Koshy.Sh SYNOPSIS
33677d4530SJoseph Koshy.In pmc.h
34677d4530SJoseph Koshy.Ft int
35677d4530SJoseph Koshy.Fn pmc_set "pmc_id_t pmc" "pmc_value_t value"
36677d4530SJoseph Koshy.Sh DESCRIPTION
37677d4530SJoseph KoshyFunction
38677d4530SJoseph Koshy.Fn pmc_set
39677d4530SJoseph Koshyis used to set the reload value of sampling PMCs.
40677d4530SJoseph KoshyArgument
41677d4530SJoseph Koshy.Fa pmc
42677d4530SJoseph Koshyspecified the handle a previously allocate sampling mode PMC.
43677d4530SJoseph KoshyArgument
44677d4530SJoseph Koshy.Fa value
45677d4530SJoseph Koshyspecifies the reload count.
46677d4530SJoseph Koshy.Pp
47677d4530SJoseph KoshySampling PMCs will interrupt the CPU after the number of
48677d4530SJoseph Koshyhardware events specified by the reload count are seen.
49677d4530SJoseph KoshyAfter the sampling interrupt is processed the underlying hardware will
50677d4530SJoseph Koshybe reloaded with the specified count and the hardware
51677d4530SJoseph Koshyautomatically restarted by
52677d4530SJoseph Koshy.Xr hwpmc 4 .
53677d4530SJoseph Koshy.Pp
54677d4530SJoseph KoshyFunction
55677d4530SJoseph Koshy.Fn pmc_set
56677d4530SJoseph Koshyshould be called on PMC in a quiescent state.
57677d4530SJoseph Koshy.Sh RETURN VALUES
58677d4530SJoseph Koshy.Rv -std pmc_set
59677d4530SJoseph Koshy.Sh ERRORS
60677d4530SJoseph KoshyA call to
61677d4530SJoseph Koshy.Fn pmc_set
62677d4530SJoseph Koshymay fail with the following errors:
63677d4530SJoseph Koshy.Bl -tag -width Er
64677d4530SJoseph Koshy.It Bq Er EINVAL
65677d4530SJoseph KoshyThe current process did not own a PMC with the specified handle.
66677d4530SJoseph Koshy.It Bq Er EBUSY
67677d4530SJoseph KoshyThe specified PMC was already running.
68677d4530SJoseph Koshy.El
69677d4530SJoseph Koshy.Sh SEE ALSO
70677d4530SJoseph Koshy.Xr pmc 3 ,
71677d4530SJoseph Koshy.Xr hwpmc 4
72