Lines Matching +full:1 +full:p1
141 "K Compressed, ", "K Uncompressed, ", ":1 Ratio, ",
157 static int onproc = -1;
235 return 1; in find_uid()
243 if (ncpus == 1) in toggle_pcpustats()
264 y_mem += ncpus - 1; in update_layout()
265 y_arc += ncpus - 1; in update_layout()
266 y_carc += ncpus - 1; in update_layout()
267 y_swap += ncpus - 1; in update_layout()
268 y_idlecursor += ncpus - 1; in update_layout()
269 y_message += ncpus - 1; in update_layout()
270 y_header += ncpus - 1; in update_layout()
271 y_procs += ncpus - 1; in update_layout()
272 Header_lines += ncpus - 1; in update_layout()
292 arc_enabled = 1; in machine_init()
296 NULL, 0) == 0 && carc_en == 1) { in machine_init()
306 carc_enabled = 1; in machine_init()
311 return (-1); in machine_init()
316 has_swap = 1; in machine_init()
327 onproc = -1; in machine_init()
332 while (pagesize > 1) { in machine_init()
334 pagesize >>= 1; in machine_init()
362 err(1, "calloc for kern.smp.maxcpus"); in machine_init()
364 if (sysctlbyname("kern.cp_times", times, &size, NULL, 0) == -1) in machine_init()
365 err(1, "sysctlbyname kern.cp_times"); in machine_init()
366 pcpu_cp_time = calloc(1, size); in machine_init()
367 maxid = MIN(size / CPUSTATES / sizeof(long) - 1, CPU_SETSIZE - 1); in machine_init()
370 empty = 1; in machine_init()
420 sbuf_printf(header, "%*s ", TOP_SWAP_LEN - 1, "SWAP"); in format_header()
448 static int swappgsin = -1;
449 static int swappgsout = -1;
463 size = (maxid + 1) * CPUSTATES * sizeof(long); in get_system_info()
464 if (sysctlbyname("kern.cp_times", pcpu_cp_time, &size, NULL, 0) == -1) in get_system_info()
465 err(1, "sysctlbyname kern.cp_times"); in get_system_info()
496 GETSYSCTL("vm.stats.vm.v_inactive_count", memory_stats[1]); in get_system_info()
504 memory_stats[1] = pagetok(memory_stats[1]); in get_system_info()
509 memory_stats[6] = -1; in get_system_info()
530 swap_stats[1] = swapavail - swapfree; in get_system_info()
533 swap_delay = 1; in get_system_info()
534 swap_stats[6] = -1; in get_system_info()
541 arc_stats[1] = arc_stat >> 10; in get_system_info()
562 carc_stats[1] = arc_stat >> 10; in get_system_info()
572 si->ncpus = 1; in get_system_info()
581 si->last_pid = -1; in get_system_info()
589 mib[1] = KERN_BOOTTIME; in get_system_info()
591 if (sysctl(mib, nitems(mib), &boottime, &size, NULL, 0) != -1 && in get_system_info()
595 si->boottime.tv_sec = -1; in get_system_info()
605 #define NOPROC ((void *)-1)
635 * 1) look up based on pid. in get_old_proc()
832 if (!sel->self && pp->ki_pid == mypid && sel->pid == -1) in get_process_info()
836 if (!sel->system && (pp->ki_flag & P_SYSTEM) && sel->pid == -1) in get_process_info()
852 if (!sel->kidle && pp->ki_tdflags & TDF_IDLETD && sel->pid == -1) in get_process_info()
869 if (sel->jid != -1 && pp->ki_jid != sel->jid) in get_process_info()
873 if (sel->uid[0] != -1 && !find_uid(pp->ki_ruid, sel->uid)) in get_process_info()
877 if (sel->pid != -1 && pp->ki_pid != sel->pid) in get_process_info()
909 return 1; in cmd_matches()
913 return 1; in cmd_matches()
923 return 1; in cmd_matches()
967 memmove(pp->ki_comm + 1, pp->ki_comm, len); in format_next_process()
969 pp->ki_comm[len + 1] = '>'; in format_next_process()
976 * ps(1) is similarly sloppy. in format_next_process()
1007 cmdbuf = calloc(screen_width + 1, 1); in format_next_process()
1009 warn("calloc(%d)", screen_width + 1); in format_next_process()
1042 argbuf = calloc(argbuflen + 1, 1); in format_next_process()
1044 warn("calloc(%zu)", argbuflen + 1); in format_next_process()
1057 len = (argbuflen - (dst - argbuf) - 1) / 4; in format_next_process()
1063 if ((argbuflen - (dst - argbuf) - 1) / 4 > 0) in format_next_process()
1066 if (dst != argbuf && dst[-1] == ' ') in format_next_process()
1113 sbuf_printf(procbuf, "%*d ", TOP_JID_LEN - 1, pp->ki_jid); in format_next_process()
1127 sbuf_printf(procbuf, "%*d ", TOP_JID_LEN - 1, pp->ki_jid); in format_next_process()
1143 TOP_SWAP_LEN - 1, in format_next_process()
1169 if (sysctlbyname(name, ptr, &nlen, NULL, 0) == -1) { in getsysctl()
1186 static char nicebuf[4 + 1]; in format_nice()
1240 compare_pid(const void *p1, const void *p2) in compare_pid() argument
1242 const struct kinfo_proc * const *pp1 = p1; in compare_pid()
1251 compare_tid(const void *p1, const void *p2) in compare_tid() argument
1253 const struct kinfo_proc * const *pp1 = p1; in compare_tid()
1274 [SRUN] = 1, /* running/runnable */
1291 return (diff > 0 ? 1 : -1); \
1297 return (diff > 0 ? 1 : -1); \
1303 return (diff > 0 ? 1 : -1); \
1309 return (diff > 0 ? 1 : -1); \
1315 return (diff > 0 ? 1 : -1); \
1321 return (diff > 0 ? 1 : -1); \
1327 return (diff > 0 ? 1 : -1); \
1333 return (diff > 0 ? 1 : -1); \
1339 return (diff > 0 ? 1 : -1); \
1347 const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; in compare_cpu() local
1350 ORDERKEY_PCTCPU(p1, p2); in compare_cpu()
1351 ORDERKEY_CPTICKS(p1, p2); in compare_cpu()
1352 ORDERKEY_STATE(p1, p2); in compare_cpu()
1353 ORDERKEY_PRIO(p1, p2); in compare_cpu()
1354 ORDERKEY_RSSIZE(p1, p2); in compare_cpu()
1355 ORDERKEY_MEM(p1, p2); in compare_cpu()
1365 const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; in compare_size() local
1368 ORDERKEY_MEM(p1, p2); in compare_size()
1369 ORDERKEY_RSSIZE(p1, p2); in compare_size()
1370 ORDERKEY_PCTCPU(p1, p2); in compare_size()
1371 ORDERKEY_CPTICKS(p1, p2); in compare_size()
1372 ORDERKEY_STATE(p1, p2); in compare_size()
1373 ORDERKEY_PRIO(p1, p2); in compare_size()
1383 const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; in compare_res() local
1386 ORDERKEY_RSSIZE(p1, p2); in compare_res()
1387 ORDERKEY_MEM(p1, p2); in compare_res()
1388 ORDERKEY_PCTCPU(p1, p2); in compare_res()
1389 ORDERKEY_CPTICKS(p1, p2); in compare_res()
1390 ORDERKEY_STATE(p1, p2); in compare_res()
1391 ORDERKEY_PRIO(p1, p2); in compare_res()
1401 const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; in compare_time() local
1404 ORDERKEY_CPTICKS(p1, p2); in compare_time()
1405 ORDERKEY_PCTCPU(p1, p2); in compare_time()
1406 ORDERKEY_STATE(p1, p2); in compare_time()
1407 ORDERKEY_PRIO(p1, p2); in compare_time()
1408 ORDERKEY_RSSIZE(p1, p2); in compare_time()
1409 ORDERKEY_MEM(p1, p2); in compare_time()
1419 const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; in compare_prio() local
1422 ORDERKEY_PRIO(p1, p2); in compare_prio()
1423 ORDERKEY_CPTICKS(p1, p2); in compare_prio()
1424 ORDERKEY_PCTCPU(p1, p2); in compare_prio()
1425 ORDERKEY_STATE(p1, p2); in compare_prio()
1426 ORDERKEY_RSSIZE(p1, p2); in compare_prio()
1427 ORDERKEY_MEM(p1, p2); in compare_prio()
1436 const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; in compare_threads() local
1439 ORDERKEY_THREADS(p1, p2); in compare_threads()
1440 ORDERKEY_PCTCPU(p1, p2); in compare_threads()
1441 ORDERKEY_CPTICKS(p1, p2); in compare_threads()
1442 ORDERKEY_STATE(p1, p2); in compare_threads()
1443 ORDERKEY_PRIO(p1, p2); in compare_threads()
1444 ORDERKEY_RSSIZE(p1, p2); in compare_threads()
1445 ORDERKEY_MEM(p1, p2); in compare_threads()
1454 const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; in compare_jid() local
1457 ORDERKEY_JID(p1, p2); in compare_jid()
1458 ORDERKEY_PCTCPU(p1, p2); in compare_jid()
1459 ORDERKEY_CPTICKS(p1, p2); in compare_jid()
1460 ORDERKEY_STATE(p1, p2); in compare_jid()
1461 ORDERKEY_PRIO(p1, p2); in compare_jid()
1462 ORDERKEY_RSSIZE(p1, p2); in compare_jid()
1463 ORDERKEY_MEM(p1, p2); in compare_jid()
1472 const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; in compare_swap() local
1475 ORDERKEY_SWAP(p1, p2); in compare_swap()
1476 ORDERKEY_PCTCPU(p1, p2); in compare_swap()
1477 ORDERKEY_CPTICKS(p1, p2); in compare_swap()
1478 ORDERKEY_STATE(p1, p2); in compare_swap()
1479 ORDERKEY_PRIO(p1, p2); in compare_swap()
1480 ORDERKEY_RSSIZE(p1, p2); in compare_swap()
1481 ORDERKEY_MEM(p1, p2); in compare_swap()
1491 const struct kinfo_proc * const p1 = *(const struct kinfo_proc * const *)arg1; in compare_iototal() local
1494 return (get_io_total(p2) - get_io_total(p1)); in compare_iototal()
1500 const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; in compare_ioread() local
1504 (void) get_io_stats(p1, &inp1, &dummy, &dummy, &dummy, &dummy); in compare_ioread()
1513 const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; in compare_iowrite() local
1517 (void) get_io_stats(p1, &dummy, &oup1, &dummy, &dummy, &dummy); in compare_iowrite()
1526 const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; in compare_iofault() local
1530 (void) get_io_stats(p1, &dummy, &dummy, &flp1, &dummy, &dummy); in compare_iofault()
1539 const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; in compare_vcsw() local
1543 (void) get_io_stats(p1, &dummy, &dummy, &dummy, &flp1, &dummy); in compare_vcsw()
1552 const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; in compare_ivcsw() local
1556 (void) get_io_stats(p1, &dummy, &dummy, &dummy, &dummy, &flp1); in compare_ivcsw()
1586 struct kvm_swap swapary[1]; in swapmode()
1595 n = kvm_getswapinfo(kd, swapary, 1, 0); in swapmode()