libgeom.3 (110809) | libgeom.3 (111447) |
---|---|
1.\" Copyright (c) 2003 Poul-Henning Kamp 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 11 unchanged lines hidden (view full) --- 20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" | 1.\" Copyright (c) 2003 Poul-Henning Kamp 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 11 unchanged lines hidden (view full) --- 20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" |
28.\" $FreeBSD: head/lib/libgeom/libgeom.3 110809 2003-02-13 18:25:48Z phantom $ | 28.\" $FreeBSD: head/lib/libgeom/libgeom.3 111447 2003-02-24 22:53:26Z ru $ |
29.\" 30.Dd February 8, 2003 31.Dt LIBGEOM 3 32.Os 33.Sh NAME 34.Nm geom_stats_open , 35.Nm geom_stats_close , 36.Nm geom_stats_resync , 37.Nm geom_stats_snapshot_get , 38.Nm geom_stats_snapshot_free , 39.Nm geom_stats_snapshot_timestamp , 40.Nm geom_stats_snapshot_reset , 41.Nm geom_stats_snapshot_next 42.Nd userland API library for kernel GEOM subsystem 43.Sh LIBRARY 44.Lb libgeom 45.Sh SYNOPSIS 46.In libgeom.h | 29.\" 30.Dd February 8, 2003 31.Dt LIBGEOM 3 32.Os 33.Sh NAME 34.Nm geom_stats_open , 35.Nm geom_stats_close , 36.Nm geom_stats_resync , 37.Nm geom_stats_snapshot_get , 38.Nm geom_stats_snapshot_free , 39.Nm geom_stats_snapshot_timestamp , 40.Nm geom_stats_snapshot_reset , 41.Nm geom_stats_snapshot_next 42.Nd userland API library for kernel GEOM subsystem 43.Sh LIBRARY 44.Lb libgeom 45.Sh SYNOPSIS 46.In libgeom.h |
47.Ss "Statistics functions" | 47.Ss "Statistics Functions" |
48.Ft void 49.Fn geom_stats_close void 50.Ft int 51.Fn geom_stats_open void 52.Ft void 53.Fn geom_stats_resync void | 48.Ft void 49.Fn geom_stats_close void 50.Ft int 51.Fn geom_stats_open void 52.Ft void 53.Fn geom_stats_resync void |
54.Ft void * | 54.Ft "void *" |
55.Fn geom_stats_snapshot_get void 56.Ft void 57.Fn geom_stats_snapshot_free "void *arg" 58.Ft void 59.Fn geom_stats_snapshot_timestamp "void *arg" "struct timespec *tp" 60.Ft void 61.Fn geom_stats_snapshot_reset "void *arg" | 55.Fn geom_stats_snapshot_get void 56.Ft void 57.Fn geom_stats_snapshot_free "void *arg" 58.Ft void 59.Fn geom_stats_snapshot_timestamp "void *arg" "struct timespec *tp" 60.Ft void 61.Fn geom_stats_snapshot_reset "void *arg" |
62.Ft struct g_stat * | 62.Ft "struct g_stat *" |
63.Fn geom_stats_snapshot_next "void *arg" 64.Sh DESCRIPTION | 63.Fn geom_stats_snapshot_next "void *arg" 64.Sh DESCRIPTION |
65.Nm Libgeom 66is the library which contains the official and publicized API for | 65The 66.Nm geom 67library contains the official and publicized API for |
67interacting with the GEOM subsystem in the kernel. | 68interacting with the GEOM subsystem in the kernel. |
68.Ss "Statistics functions" | 69.Ss "Statistics Functions" |
69GEOM collects statistics data for all consumers and providers, but does 70not perform any normalization or presentation on the raw data, this is 71left as an excercize for user-land presentation utilities. 72.Pp 73The 74.Fn geom_stats_open | 70GEOM collects statistics data for all consumers and providers, but does 71not perform any normalization or presentation on the raw data, this is 72left as an excercize for user-land presentation utilities. 73.Pp 74The 75.Fn geom_stats_open |
75and | 76and |
76.Fn geom_stats_close | 77.Fn geom_stats_close |
77functions opens and closes the necessary pathways to access the raw 78statistics information in the kernel. These functions are likely to 79open one or more files and cache the filedescriptors locally. | 78functions open and close the necessary pathways to access the raw 79statistics information in the kernel. 80These functions are likely to 81open one or more files and cache the file descriptors locally. |
80.Fn geom_stats_open | 82.Fn geom_stats_open |
81returns zero on success, and sets errno if not. | 83returns zero on success, and sets 84.Va errno 85if not. |
82.Pp 83The 84.Fn geom_stats_resync 85function will check if more statistics collection points have been 86added in the kernel since 87.Fn geom_stats_open 88or the previous call to 89.Fn geom_stats_resync . 90.Pp | 86.Pp 87The 88.Fn geom_stats_resync 89function will check if more statistics collection points have been 90added in the kernel since 91.Fn geom_stats_open 92or the previous call to 93.Fn geom_stats_resync . 94.Pp |
95The |
|
91.Fn geom_stats_snapshot_get | 96.Fn geom_stats_snapshot_get |
92will aquire a snapshot of the raw data from the kernel and while a | 97function 98will acquire a snapshot of the raw data from the kernel, and while a |
93reasonable effort is made to make this snapshot as atomic and consistent 94as possible, no guarantee is given that it will actually be so. 95The snapshot must be freed again using the 96.Fn geom_stats_snapshot_free 97function. 98.Fn geom_stats_snapshot_get | 99reasonable effort is made to make this snapshot as atomic and consistent 100as possible, no guarantee is given that it will actually be so. 101The snapshot must be freed again using the 102.Fn geom_stats_snapshot_free 103function. 104.Fn geom_stats_snapshot_get |
99returns NULL on failure. | 105returns 106.Dv NULL 107on failure. |
100.Pp | 108.Pp |
109The |
|
101.Fn geom_stats_snapshot_timestamp | 110.Fn geom_stats_snapshot_timestamp |
102provides access to the timestamp aquired in the snapshot. | 111function 112provides access to the timestamp acquired in the snapshot. |
103.Pp | 113.Pp |
114The |
|
104.Fn geom_stats_snapshot_reset 105and 106.Fn geom_stats_snapshot_next | 115.Fn geom_stats_snapshot_reset 116and 117.Fn geom_stats_snapshot_next |
107provides an iterator over the statistics slots in the snapshot. | 118functions 119provide an iterator over the statistics slots in the snapshot. 120The |
108.Fn geom_stats_snapshot_reset | 121.Fn geom_stats_snapshot_reset |
122function |
|
109forces the internal pointer in the snapshot back to before the first item. | 123forces the internal pointer in the snapshot back to before the first item. |
124The |
|
110.Fn geom_stats_snapshot_next | 125.Fn geom_stats_snapshot_next |
111returns the next item and NULL if there are no more items in the snapshot. | 126function 127returns the next item, and 128.Dv NULL 129if there are no more items in the snapshot. |
112.Sh AUTHORS 113.An Poul-Henning Kamp Aq phk@FreeBSD.org 114.Sh HISTORY | 130.Sh AUTHORS 131.An Poul-Henning Kamp Aq phk@FreeBSD.org 132.Sh HISTORY |
133The |
|
115.Nm geom | 134.Nm geom |
116library appeard in | 135library appeared in |
117.Fx 5.1 . | 136.Fx 5.1 . |