Lines Matching +full:use +full:- +full:guard +full:- +full:pages
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
6 * Redistribution and use in source and binary forms, with or without
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48 uint32_t swapped; /* in pages */
65 uint32_t pages; member
83 uname = user_from_uid(pu[idx]->uid, 0); in display_proc_line()
84 swapbytes = ptoa(pu[idx]->pages); in display_proc_line()
86 snprintf(buf, sizeof(buf), "%6d %-10s %-10.10s", pu[idx]->pid, uname, in display_proc_line()
87 pu[idx]->command); in display_proc_line()
94 sysputuint64(wnd, y, offset, 4, pu[idx]->total, 0); in display_proc_line()
97 rate = pu[idx]->total > 1 ? 100 * swapbytes / pu[idx]->total : 0; in display_proc_line()
104 rate = 100 * pu[idx]->pages / totalswappages; in display_proc_line()
118 if (*aa == bb->kvo_me) in swobj_search()
120 return (*aa > bb->kvo_me ? -1 : 1); in swobj_search()
127 return ((((const struct swapvm *) a)->kvo_me > in swobj_sort()
128 ((const struct swapvm *) b)->kvo_me) ? -1 : 1); in swobj_sort()
170 } while (i <= cnt); /* extra safety guard */ in get_swap_vmobjects()
177 /* This returns the number of swap pages a process uses. */
182 uint32_t pages = 0; in per_proc_swap_usage() local
189 return (pages); in per_proc_swap_usage()
193 if (kve->kve_type == KVME_TYPE_DEFAULT || in per_proc_swap_usage()
194 kve->kve_type == KVME_TYPE_SWAP) { in per_proc_swap_usage()
195 vmobj = kve->kve_obj; in per_proc_swap_usage()
199 if (vm != NULL && vm->pid != kipp->ki_pid) { in per_proc_swap_usage()
200 pages += vm->swapped; in per_proc_swap_usage()
201 vmobj = vm->next; in per_proc_swap_usage()
202 vm->pid = kipp->ki_pid; in per_proc_swap_usage()
209 return (pages); in per_proc_swap_usage()
235 uint32_t pages; in procgetinfo() local
239 if ( ! get_swap_vmobjects() ) /* call failed or nothing is paged-out */ in procgetinfo()
252 memset(&pu[maxnproc], 0, (cnt - maxnproc) * sizeof(pu[0])); in procgetinfo()
257 pages = per_proc_swap_usage(&kipp[i]); in procgetinfo()
258 if (pages == 0) in procgetinfo()
265 strlcpy(pu[nproc]->command, kipp[i].ki_comm, in procgetinfo()
266 sizeof(pu[nproc]->command)); in procgetinfo()
267 pu[nproc]->pid = kipp[i].ki_pid; in procgetinfo()
268 pu[nproc]->uid = kipp[i].ki_uid; in procgetinfo()
269 pu[nproc]->pages = pages; in procgetinfo()
270 pu[nproc]->total = kipp[i].ki_size; in procgetinfo()
286 "Per-Process Per-System"); in proclabel()
295 return (aa->pages > bb->pages ? -1 : 1); in proc_compar()