xref: /freebsd/lib/libpmc/pmc_name_of_capability.3 (revision 8fc257994d0ce2396196d7a06d50d20c8015f4b7)
1.\" Copyright (c) 2007 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 November 24, 2007
27.Dt PMC_NAME_OF_CAPABILITY 3
28.Os
29.Sh NAME
30.Nm pmc_name_of_capability ,
31.Nm pmc_name_of_class ,
32.Nm pmc_name_of_cputype ,
33.Nm pmc_name_of_disposition ,
34.Nm pmc_name_of_event ,
35.Nm pmc_name_of_mode ,
36.Nm pmc_name_of_state
37.Nd human readable names for numeric constants used by
38.Xr pmc 3
39and
40.Xr hwpmc 4
41.Sh LIBRARY
42.Lb libpmc
43.Sh SYNOPSIS
44.In pmc.h
45.Ft "const char *"
46.Fn pmc_name_of_capability "enum pmc_caps pc"
47.Ft "const char *"
48.Fn pmc_name_of_class "enum pmc_class pc"
49.Ft "const char *"
50.Fn pmc_name_of_cputype "enum pmc_cputype ct"
51.Ft "const char *"
52.Fn pmc_name_of_disposition "enum pmc_disp pd"
53.Ft "const char *"
54.Fn pmc_name_of_event "enum pmc_event pe"
55.Ft "const char *"
56.Fn pmc_name_of_mode "enum pmc_mode pm"
57.Ft "const char *"
58.Fn pmc_name_of_state "enum pmc_state ps"
59.Sh DESCRIPTION
60These convenience functions translate numeric constants used by the
61.Lb libpmc
62to
63.Vt "const char *"
64pointers to human readable representations of their arguments.
65.Pp
66Function
67.Fn pmc_name_of_capability
68translates a PMC capability flag given in argument
69.Fa pc
70to a human readable string.
71PMC capabilities are described in
72.Xr pmc 3 .
73.Pp
74Function
75.Fn pmc_name_of_class
76translates the PMC class value specified in argument
77.Fa pc
78to a human readable name.
79PMC classes are described in
80.Xr pmc 3 .
81.Pp
82Function
83.Fn pmc_name_of_cputype
84translates the CPU type value specified in argument
85.Fa ct
86to a human readable name.
87CPU types known to the library are described in
88.Xr pmc 3 .
89.Pp
90Function
91.Fn pmc_name_of_disposition
92translates the PMC row disposition specified in argument
93.Fa pd
94to a human readable name.
95PMC row dispositions are described in
96.Xr hwpmc 4 .
97.Pp
98Function
99.Fn pmc_name_of_event
100translates the PMC event number specified by argument
101.Fa pe
102to a string.
103PMC event names are documented in section
104.Sx EVENT SPECIFIERS
105of
106.Xr pmc 3 .
107.Pp
108Function
109.Fn pmc_name_of_mode
110translates the PMC mode specified by argument
111.Fa pm
112to a human readable string.
113PMC modes are described in
114.Xr pmc 3 .
115.Pp
116Function
117.Fn pmc_name_of_state
118translates the value of argument
119.Fa ps
120to a human readable name.
121.Sh IMPLEMENTATION NOTES
122The returned pointers point to static storage inside the PMC
123library and should not be freed by the caller.
124.Sh RETURN VALUES
125These functions return a non-NULL pointer on successful completion.
126In case of an error, a NULL pointer is returned and the global
127variable
128.Va errno
129is set to indicate the error.
130.Sh ERRORS
131A call to these functions may fail with the following errors:
132.Bl -tag -width Er
133.It Bq Er EINVAL
134The function argument specified an invalid value.
135.El
136.Sh SEE ALSO
137.Xr pmc 3 ,
138.Xr pmc_cpuinfo 3 ,
139.Xr pmc_pmcinfo 3 ,
140.Xr hwpmc 4
141