xref: /freebsd/lib/libpmc/pmc.tsc.3 (revision 2e3f49888ec8851bafb22011533217487764fdb0)
1.\" Copyright (c) 2003-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 October 4, 2008
25.Dt PMC.TSC 3
26.Os
27.Sh NAME
28.Nm pmc.tsc
29.Nd measurements using the i386 timestamp counter
30.Sh LIBRARY
31.Lb libpmc
32.Sh SYNOPSIS
33.In pmc.h
34.Sh DESCRIPTION
35In the i386 architecture, the timestamp counter is a monotonically
36non-decreasing counter that counts processor cycles.
37.Pp
38This counter may be selected specifying an event specifier
39.Dq Li tsc
40to
41.Xr pmc_allocate 3 .
42The TSC is a read-only counter that may only be allocated in
43system-wide counting mode.
44The
45.Dq Li tsc
46event does not support further event qualifiers.
47.Pp
48Multiple processes are allowed to allocate the TSC.
49Once allocated, the TSC may be read using the
50.Fn pmc_read
51function, or by using the
52.Li RDTSC
53instruction.
54.Ss Event Name Aliases
55The alias
56.Dq Li cycles
57maps to the TSC.
58.Sh SEE ALSO
59.Xr pmc 3 ,
60.Xr pmc.amd 3 ,
61.Xr pmc.atom 3 ,
62.Xr pmc.core 3 ,
63.Xr pmc.core2 3 ,
64.Xr pmc.iaf 3 ,
65.Xr pmc.soft 3 ,
66.Xr pmclog 3 ,
67.Xr hwpmc 4
68.Sh HISTORY
69The
70.Nm pmc
71library first appeared in
72.Fx 6.0 .
73.Sh AUTHORS
74The
75.Lb libpmc
76library was written by
77.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
78