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