=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/systat/mbufs.c,v retrieving revision 1.42 retrieving revision 1.43 diff -c -r1.42 -r1.43 *** src/usr.bin/systat/mbufs.c 2019/06/28 13:35:04 1.42 --- src/usr.bin/systat/mbufs.c 2020/06/15 10:54:29 1.43 *************** *** 1,4 **** ! /* $OpenBSD: mbufs.c,v 1.42 2019/06/28 13:35:04 deraadt Exp $ */ /* * Copyright (c) 2008 Can Erkin Acar * --- 1,4 ---- ! /* $OpenBSD: mbufs.c,v 1.43 2020/06/15 10:54:29 dlg Exp $ */ /* * Copyright (c) 2008 Can Erkin Acar * *************** *** 57,62 **** --- 57,63 ---- /* Define fields */ field_def fields_mbuf[] = { {"IFACE", 8, 16, 1, FLD_ALIGN_LEFT, -1, 0, 0, 0}, + {"RING", 8, 8, 1, FLD_ALIGN_LEFT, -1, 0, 0, 0}, {"RXDELAY", 5, 8, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0}, {"TXDELAY", 5, 8, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0}, {"LIVELOCKS", 5, 10, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0}, *************** *** 69,87 **** #define FLD_MB_IFACE FIELD_ADDR(fields_mbuf,0) ! #define FLD_MB_RXDELAY FIELD_ADDR(fields_mbuf,1) ! #define FLD_MB_TXDELAY FIELD_ADDR(fields_mbuf,2) ! #define FLD_MB_LLOCKS FIELD_ADDR(fields_mbuf,3) ! #define FLD_MB_MSIZE FIELD_ADDR(fields_mbuf,4) ! #define FLD_MB_MALIVE FIELD_ADDR(fields_mbuf,5) ! #define FLD_MB_MLWM FIELD_ADDR(fields_mbuf,6) ! #define FLD_MB_MHWM FIELD_ADDR(fields_mbuf,7) ! #define FLD_MB_MCWM FIELD_ADDR(fields_mbuf,8) /* Define views */ field_def *view_mbuf[] = { ! FLD_MB_IFACE, FLD_MB_LLOCKS, FLD_MB_MSIZE, FLD_MB_MALIVE, FLD_MB_MLWM, FLD_MB_MHWM, FLD_MB_MCWM, NULL }; --- 70,89 ---- #define FLD_MB_IFACE FIELD_ADDR(fields_mbuf,0) ! #define FLD_MB_RING FIELD_ADDR(fields_mbuf,1) ! #define FLD_MB_RXDELAY FIELD_ADDR(fields_mbuf,2) ! #define FLD_MB_TXDELAY FIELD_ADDR(fields_mbuf,3) ! #define FLD_MB_LLOCKS FIELD_ADDR(fields_mbuf,4) ! #define FLD_MB_MSIZE FIELD_ADDR(fields_mbuf,5) ! #define FLD_MB_MALIVE FIELD_ADDR(fields_mbuf,6) ! #define FLD_MB_MLWM FIELD_ADDR(fields_mbuf,7) ! #define FLD_MB_MHWM FIELD_ADDR(fields_mbuf,8) ! #define FLD_MB_MCWM FIELD_ADDR(fields_mbuf,9) /* Define views */ field_def *view_mbuf[] = { ! FLD_MB_IFACE, FLD_MB_RING, FLD_MB_LLOCKS, FLD_MB_MSIZE, FLD_MB_MALIVE, FLD_MB_MLWM, FLD_MB_MHWM, FLD_MB_MCWM, NULL }; *************** *** 173,181 **** /* NOTREACHED */ } ! snprintf(ifr[mclpool_count].ifr_name, ! sizeof(ifr[mclpool_count].ifr_name), "%dk", ! pool.pr_size / 1024); ifr[mclpool_count].ifr_size = pool.pr_size; mclpools_index[mclpool_count++] = i; --- 175,182 ---- /* NOTREACHED */ } ! strlcpy(ifr[mclpool_count].ifr_name, pname, ! sizeof(ifr[mclpool_count].ifr_name)); ifr[mclpool_count].ifr_size = pool.pr_size; mclpools_index[mclpool_count++] = i; *************** *** 367,373 **** for (p = 0; p < ifi->data.ifri_total; p++) { struct if_rxring_info *ifr = &ifi->data.ifri_entries[p]; ! if (ifr->ifr_info.rxr_alive == 0) continue; if (n++ >= dispstart) { showmbuf(ifi, p, showif); --- 368,374 ---- for (p = 0; p < ifi->data.ifri_total; p++) { struct if_rxring_info *ifr = &ifi->data.ifri_entries[p]; ! if (ifr->ifr_info.rxr_hwm == 0) continue; if (n++ >= dispstart) { showmbuf(ifi, p, showif); *************** *** 394,399 **** --- 395,401 ---- print_fld_str(FLD_MB_IFACE, ifi->name); if (p == -1 && ifi == interfaces) { + print_fld_str(FLD_MB_RING, "mbufs"); print_fld_uint(FLD_MB_LLOCKS, mcllivelocks_diff); print_fld_size(FLD_MB_MSIZE, mbpool.pr_size); print_fld_size(FLD_MB_MALIVE, mbpool.pr_nget - mbpool.pr_nput); *************** *** 403,408 **** --- 405,411 ---- if (p >= 0 && p < mclpool_count) { struct if_rxring_info *ifr = &ifi->data.ifri_entries[p]; struct if_rxring *rxr= &ifr->ifr_info; + print_fld_str(FLD_MB_RING, ifr->ifr_name); print_fld_uint(FLD_MB_MSIZE, ifr->ifr_size); print_fld_uint(FLD_MB_MALIVE, rxr->rxr_alive); if (rxr->rxr_lwm)