xref: /freebsd/lib/libpmc/pmc.tsc.3 (revision 195ebc7e9e4b129de810833791a19dfb4349d6a9)
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 Joseph Koshy ``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 Joseph Koshy 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.Os
28.Dt PMC.TSC 3
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.p4 3 ,
69.Xr pmc.p5 3 ,
70.Xr pmc.p6 3 ,
71.Xr pmclog 3 ,
72.Xr hwpmc 4
73.Sh HISTORY
74The
75.Nm pmc
76library first appeared in
77.Fx 6.0 .
78.Sh AUTHORS
79The
80.Lb libpmc
81library was written by
82.An "Joseph Koshy"
83.Aq jkoshy@FreeBSD.org .
84