pmc.3 (5138c36a1bf9c514074a375465592947064e0bbd) pmc.3 (110e1704d33d8632ce8febdd36a0143ca8b2ef0e)
1.\" Copyright (c) 2003-2005 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

--- 177 unchanged lines hidden (view full) ---

186.Xr hwpmc 4
187driver manages system-wide statistical sampling; for more
188information please see
189.Xr hwpmc 4 .
190.Ss Application Programming Interface
191The function
192.Fn pmc_init
193initializes the
1.\" Copyright (c) 2003-2005 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

--- 177 unchanged lines hidden (view full) ---

186.Xr hwpmc 4
187driver manages system-wide statistical sampling; for more
188information please see
189.Xr hwpmc 4 .
190.Ss Application Programming Interface
191The function
192.Fn pmc_init
193initializes the
194.Xr pmc 3
194.Nm pmc
195library.
196This function must be called first, before any of the other
197functions in the library.
198.Pp
199The function
200.Fn pmc_allocate
201allocates a counter that counts the events named by
202.Fa eventspecifier ,

--- 227 unchanged lines hidden (view full) ---

430Event names are PMC architecture dependent, but the
431.Xr hwpmc 4
432library defines machine independent aliases for commonly used
433events.
434.Ss Event Name Aliases
435Event name aliases are CPU architecture independent names for commonly
436used events.
437The following aliases are known to this version of the
195library.
196This function must be called first, before any of the other
197functions in the library.
198.Pp
199The function
200.Fn pmc_allocate
201allocates a counter that counts the events named by
202.Fa eventspecifier ,

--- 227 unchanged lines hidden (view full) ---

430Event names are PMC architecture dependent, but the
431.Xr hwpmc 4
432library defines machine independent aliases for commonly used
433events.
434.Ss Event Name Aliases
435Event name aliases are CPU architecture independent names for commonly
436used events.
437The following aliases are known to this version of the
438.Xr pmc 3
438.Nm pmc
439library:
440.Bl -tag -width indent
441.It Li branches
442Measure the number of branches retired.
443.It Li branch-mispredicts
444Measure the number of retired branches that were mispredicted.
445.It Li cycles
446Measure processor cycles.

--- 2813 unchanged lines hidden (view full) ---

32600
3261if successful; otherwise the value
3262\-1
3263is returned and the global variable
3264.Va errno
3265is set to indicate the error.
3266.Sh COMPATIBILITY
3267The interface between the
439library:
440.Bl -tag -width indent
441.It Li branches
442Measure the number of branches retired.
443.It Li branch-mispredicts
444Measure the number of retired branches that were mispredicted.
445.It Li cycles
446Measure processor cycles.

--- 2813 unchanged lines hidden (view full) ---

32600
3261if successful; otherwise the value
3262\-1
3263is returned and the global variable
3264.Va errno
3265is set to indicate the error.
3266.Sh COMPATIBILITY
3267The interface between the
3268.Xr pmc 3
3268.Nm pmc
3269library and the
3270.Xr hwpmc 4
3271driver is intended to be private to the implementation and may
3272change.
3273In order to ease forward compatibility with future versions of the
3274.Xr hwpmc 4
3275driver, applications are urged to dynamically link with the
3269library and the
3270.Xr hwpmc 4
3271driver is intended to be private to the implementation and may
3272change.
3273In order to ease forward compatibility with future versions of the
3274.Xr hwpmc 4
3275driver, applications are urged to dynamically link with the
3276.Xr pmc 3
3276.Nm pmc
3277library.
3278.Pp
3279The
3277library.
3278.Pp
3279The
3280.Xr pmc 3
3280.Nm pmc
3281API is
3282.Ud
3283.Sh ERRORS
3284A call to
3285.Fn pmc_init
3286may fail with the following errors in addition to those returned by
3287.Xr modfind 2 ,
3288.Xr modstat 2
3289and
3290.Xr hwpmc 4 :
3291.Bl -tag -width Er
3292.It Bq Er ENXIO
3293An unknown CPU type was encountered during initialization.
3294.It Bq Er EPROGMISMATCH
3295The version number of the
3296.Xr hwpmc 4
3297kernel module did not match that compiled into the
3281API is
3282.Ud
3283.Sh ERRORS
3284A call to
3285.Fn pmc_init
3286may fail with the following errors in addition to those returned by
3287.Xr modfind 2 ,
3288.Xr modstat 2
3289and
3290.Xr hwpmc 4 :
3291.Bl -tag -width Er
3292.It Bq Er ENXIO
3293An unknown CPU type was encountered during initialization.
3294.It Bq Er EPROGMISMATCH
3295The version number of the
3296.Xr hwpmc 4
3297kernel module did not match that compiled into the
3298.Xr pmc 3
3298.Nm pmc
3299library.
3300.El
3301.Pp
3302A call to
3303.Fn pmc_capabilities ,
3304.Fn pmc_name_of_capability ,
3305.Fn pmc_name_of_disposition ,
3306.Fn pmc_name_of_state ,

--- 11 unchanged lines hidden (view full) ---

3318A call to
3319.Fn pmc_cpuinfo
3320or
3321.Fn pmc_ncpu
3322may fail with the following error:
3323.Bl -tag -width Er
3324.It Bq Er ENXIO
3325The
3299library.
3300.El
3301.Pp
3302A call to
3303.Fn pmc_capabilities ,
3304.Fn pmc_name_of_capability ,
3305.Fn pmc_name_of_disposition ,
3306.Fn pmc_name_of_state ,

--- 11 unchanged lines hidden (view full) ---

3318A call to
3319.Fn pmc_cpuinfo
3320or
3321.Fn pmc_ncpu
3322may fail with the following error:
3323.Bl -tag -width Er
3324.It Bq Er ENXIO
3325The
3326.Xr pmc 3
3326.Nm pmc
3327has not been initialized.
3328.El
3329.Pp
3330A call to
3331.Fn pmc_npmc
3332may fail with the following errors:
3333.Bl -tag -width Er
3334.It Bq Er EINVAL
3335The argument passed in was out of range.
3336.It Bq Er ENXIO
3337The
3327has not been initialized.
3328.El
3329.Pp
3330A call to
3331.Fn pmc_npmc
3332may fail with the following errors:
3333.Bl -tag -width Er
3334.It Bq Er EINVAL
3335The argument passed in was out of range.
3336.It Bq Er ENXIO
3337The
3338.Xr pmc 3
3338.Nm pmc
3339library has not been initialized.
3340.El
3341.Pp
3342A call to
3343.Fn pmc_pmcinfo
3344may fail with the following errors, in addition to those returned by
3345.Xr hwpmc 4 :
3346.Bl -tag -width Er
3347.It Bq Er ENXIO
3348The
3339library has not been initialized.
3340.El
3341.Pp
3342A call to
3343.Fn pmc_pmcinfo
3344may fail with the following errors, in addition to those returned by
3345.Xr hwpmc 4 :
3346.Bl -tag -width Er
3347.It Bq Er ENXIO
3348The
3349.Xr pmc 3
3349.Nm pmc
3350library is not yet initialized.
3351.El
3352.Pp
3353A call to
3354.Fn pmc_allocate
3355may fail with the following errors, in addition to those returned by
3356.Xr hwpmc 4 :
3357.Bl -tag -width Er

--- 40 unchanged lines hidden (view full) ---

3398.Xr modstat 2 ,
3399.Xr calloc 3 ,
3400.Xr pmclog 3 ,
3401.Xr hwpmc 4 ,
3402.Xr pmccontrol 8 ,
3403.Xr pmcstat 8
3404.Sh HISTORY
3405The
3350library is not yet initialized.
3351.El
3352.Pp
3353A call to
3354.Fn pmc_allocate
3355may fail with the following errors, in addition to those returned by
3356.Xr hwpmc 4 :
3357.Bl -tag -width Er

--- 40 unchanged lines hidden (view full) ---

3398.Xr modstat 2 ,
3399.Xr calloc 3 ,
3400.Xr pmclog 3 ,
3401.Xr hwpmc 4 ,
3402.Xr pmccontrol 8 ,
3403.Xr pmcstat 8
3404.Sh HISTORY
3405The
3406.Xr pmc 3
3406.Nm pmc
3407library first appeared in
3408.Fx 6.0 .
3409.Sh BUGS
3410The information returned by
3411.Fn pmc_cpuinfo ,
3412.Fn pmc_ncpu
3413and possibly
3414.Fn pmc_npmc
3415should really be available all the time, through a better designed
3416interface and not just when
3417.Xr hwpmc 4
3418is present in the kernel.
3407library first appeared in
3408.Fx 6.0 .
3409.Sh BUGS
3410The information returned by
3411.Fn pmc_cpuinfo ,
3412.Fn pmc_ncpu
3413and possibly
3414.Fn pmc_npmc
3415should really be available all the time, through a better designed
3416interface and not just when
3417.Xr hwpmc 4
3418is present in the kernel.