mbstat
struct mbstat mbs;
counters_read(mbstat, counters, mbs_ncounters, NULL);
struct cpumem *mbstat = COUNTERS_BOOT_INITIALIZER(mbstat_boot);
mbstat = counters_alloc_ncpus(mbstat, mbs_ncounters);
counters_dec(mbstat, m->m_type);
extern struct cpumem *mbstat; /* mbuf statistics counter */
counters_inc(mbstat, c);
size = sizeof(mbstat);
if (sysctl(mib, 2, &mbstat, &size, NULL, 0) == -1) {
totmbufs += (unsigned int)mbstat.m_mtypes[mp->mt_type];
if (mbstat.m_mtypes[mp->mt_type]) {
mbstat.m_mtypes[mp->mt_type],
plural(mbstat.m_mtypes[mp->mt_type]),
if (!seen[i] && mbstat.m_mtypes[i]) {
mbstat.m_mtypes[i],
plural(mbstat.m_mtypes[i]), i);
printf("%lu requests for memory denied\n", mbstat.m_drops);
printf("%lu requests for memory delayed\n", mbstat.m_wait);
printf("%lu calls to protocol drain routines\n", mbstat.m_drain);
printf("%lu defrag mbuf allocation\n", mbstat.m_defrag_alloc);
printf("%lu prepend mbuf allocation\n", mbstat.m_prepend_alloc);
printf("%lu pullup mbuf allocation\n", mbstat.m_pullup_alloc);
printf("%lu pullup memory copy\n", mbstat.m_pullup_copy);
printf("%lu pulldown mbuf allocation\n", mbstat.m_pulldown_alloc);
printf("%lu pulldown memory copy\n", mbstat.m_pulldown_copy);
struct mbstat mbstat;
int nmbtypes = sizeof(mbstat.m_mtypes) / sizeof(u_long);