Deleted Added
full compact
libprocstat.3 (235286) libprocstat.3 (249666)
1.\" Copyright (c) 2011 Sergey Kandaurov <pluknet@FreeBSD.org>
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.

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

17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
1.\" Copyright (c) 2011 Sergey Kandaurov <pluknet@FreeBSD.org>
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.

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

17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD: head/lib/libprocstat/libprocstat.3 235286 2012-05-11 20:06:46Z gjb $
25.\" $FreeBSD: head/lib/libprocstat/libprocstat.3 249666 2013-04-20 07:47:26Z trociny $
26.\"
27.Dd April 1, 2012
28.Dt LIBPROCSTAT 3
29.Os
30.Sh NAME
26.\"
27.Dd April 1, 2012
28.Dt LIBPROCSTAT 3
29.Os
30.Sh NAME
31.Nm procstat_open_core ,
31.Nm procstat_open_kvm ,
32.Nm procstat_open_sysctl ,
33.Nm procstat_close ,
34.Nm procstat_getfiles ,
35.Nm procstat_getprocs ,
36.Nm procstat_freefiles ,
37.Nm procstat_freeprocs ,
38.Nm procstat_get_pipe_info ,

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

100.Ft "struct kinfo_proc *"
101.Fo procstat_getprocs
102.Fa "struct procstat *procstat"
103.Fa "int what"
104.Fa "int arg"
105.Fa "unsigned int *count"
106.Fc
107.Ft "struct procstat *"
32.Nm procstat_open_kvm ,
33.Nm procstat_open_sysctl ,
34.Nm procstat_close ,
35.Nm procstat_getfiles ,
36.Nm procstat_getprocs ,
37.Nm procstat_freefiles ,
38.Nm procstat_freeprocs ,
39.Nm procstat_get_pipe_info ,

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

101.Ft "struct kinfo_proc *"
102.Fo procstat_getprocs
103.Fa "struct procstat *procstat"
104.Fa "int what"
105.Fa "int arg"
106.Fa "unsigned int *count"
107.Fc
108.Ft "struct procstat *"
109.Fn procstat_open_core "const char *filename"
110.Ft "struct procstat *"
108.Fn procstat_open_kvm "const char *nlistf" "const char *memf"
109.Ft "struct procstat *"
110.Fn procstat_open_sysctl void
111.Sh DESCRIPTION
112The
113.Nm libprocstat
114library contains the API for runtime file and process information
115retrieval from the running kernel via the
116.Xr sysctl 3
117library backend, and for post-mortem analysis via the
118.Xr kvm 3
111.Fn procstat_open_kvm "const char *nlistf" "const char *memf"
112.Ft "struct procstat *"
113.Fn procstat_open_sysctl void
114.Sh DESCRIPTION
115The
116.Nm libprocstat
117library contains the API for runtime file and process information
118retrieval from the running kernel via the
119.Xr sysctl 3
120library backend, and for post-mortem analysis via the
121.Xr kvm 3
119library backend.
122library backend, or from the process
123.Xr core 5
124file, searching for statistics in special
125.Xr elf 3
126note sections.
120.Pp
121The
122.Fn procstat_open_kvm
123and
124.Fn procstat_open_sysctl
125functions use the
126.Xr kvm 3
127or
128.Xr sysctl 3
129library routines, respectively, to access kernel state information
130used to retrieve processes and files states.
131The
127.Pp
128The
129.Fn procstat_open_kvm
130and
131.Fn procstat_open_sysctl
132functions use the
133.Xr kvm 3
134or
135.Xr sysctl 3
136library routines, respectively, to access kernel state information
137used to retrieve processes and files states.
138The
139.Fn procstat_open_core
140uses
141.Xr elf 3
142routines to access statistics stored as a set of notes in a process
143.Xr core 5
144file, written by the kernel at the moment of the process abnormal termination.
145The
146.Fa filename
147argument is the process core file name.
148The
132.Fa nlistf
133argument is the executable image of the kernel being examined.
134If this argument is
135.Dv NULL ,
136the currently running kernel is assumed.
137The
138.Fa memf
139argument is the kernel memory device file.
140If this argument is
141.Dv NULL ,
142then
143.Pa /dev/mem
144is assumed.
145See
146.Xr kvm_open 3
147for more details.
149.Fa nlistf
150argument is the executable image of the kernel being examined.
151If this argument is
152.Dv NULL ,
153the currently running kernel is assumed.
154The
155.Fa memf
156argument is the kernel memory device file.
157If this argument is
158.Dv NULL ,
159then
160.Pa /dev/mem
161is assumed.
162See
163.Xr kvm_open 3
164for more details.
148Both functions dynamically allocate and return a
165The functions dynamically allocate and return a
149.Vt procstat
150structure pointer used in the rest of the
151.Nm libprocstat
152library routines until the corresponding
153.Fn procstat_close
154call that cleans up the resources allocated by the
155.Fn procstat_open_*
156functions.

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

245.Nm procstat_get_shm_info
246.El
247.Sh SEE ALSO
248.Xr fstat 1 ,
249.Xr fuser 1 ,
250.Xr pipe 2 ,
251.Xr shm_open 2 ,
252.Xr socket 2 ,
166.Vt procstat
167structure pointer used in the rest of the
168.Nm libprocstat
169library routines until the corresponding
170.Fn procstat_close
171call that cleans up the resources allocated by the
172.Fn procstat_open_*
173functions.

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

262.Nm procstat_get_shm_info
263.El
264.Sh SEE ALSO
265.Xr fstat 1 ,
266.Xr fuser 1 ,
267.Xr pipe 2 ,
268.Xr shm_open 2 ,
269.Xr socket 2 ,
270.Xr elf 3 ,
253.Xr kvm 3 ,
254.Xr queue 3 ,
255.Xr sysctl 3 ,
256.Xr pts 4 ,
271.Xr kvm 3 ,
272.Xr queue 3 ,
273.Xr sysctl 3 ,
274.Xr pts 4 ,
275.Xr core 5 ,
257.Xr vnode 9
258.Sh HISTORY
259The
260.Nm libprocstat
261library appeared in
262.Fx 9.0 .
263.Sh AUTHORS
264.An -nosplit
265The
266.Nm libprocstat
267library was written by
268.An Stanislav Sedov Aq stas@FreeBSD.org .
269.Pp
270This manual page was written by
271.An Sergey Kandaurov Aq pluknet@FreeBSD.org .
276.Xr vnode 9
277.Sh HISTORY
278The
279.Nm libprocstat
280library appeared in
281.Fx 9.0 .
282.Sh AUTHORS
283.An -nosplit
284The
285.Nm libprocstat
286library was written by
287.An Stanislav Sedov Aq stas@FreeBSD.org .
288.Pp
289This manual page was written by
290.An Sergey Kandaurov Aq pluknet@FreeBSD.org .