docs/84946: 'Mbuf' instead of 'mbuf' in libmemstat(3)

Robert Watson rwatson at FreeBSD.org
Mon Aug 15 10:28:39 UTC 2005


Synopsis: 'Mbuf' instead of 'mbuf' in libmemstat(3)

State-Changed-From-To: open->patched
State-Changed-By: rwatson
State-Changed-When: Mon Aug 15 10:25:48 GMT 2005
State-Changed-Why: 

Slightly expanded version of patch applied (also renamed other references
to Mbuf) to HEAD, will MFC with re@'s permission.  Thanks for the bug
report!

FYI: I've actually been considering committing a slightly larger example
that also retrieves the count from the mbuf_packet zone, since those are
also allocated mbufs.  Something like the following:

        struct memory_type_list *mtlp;
        struct memory_type *mtp;
        uint64_t mbuf_count, mbuf_packet_count;

        mtlp = memstat_mtl_alloc();
        if (mtlp == NULL)
                err(-1, "memstat_mtl_alloc");
        if (memstat_sysctl_uma(mtlp, 0) < 0)
                err(-1, "memstat_sysctl_uma");
        mtp = memstat_mtl_find(mtlp, ALLOCATOR_UMA, "mbuf");
        if (mtp == NULL)
                errx(-1, "memstat_mtl_find: mbuf not found");
        mbuf_count = memstat_get_count(mtp);
        mtp = memstat_mtl_find(mtlp, ALLOCATOR_UMA, "mbuf_packet");
        if (mtp == NULL)
                errx(-1, "memstat_mtl_find: mbuf_packet not found");
        mbuf_packet_count = memstat_get_count(mtp);
        memstat_mtl_free(mtlp);

        printf("mbufs: %llu\n", (unsigned long long)(mbuf_count +
            mbuf_packet_count));




Responsible-Changed-From-To: freebsd-doc->rwatson
Responsible-Changed-By: rwatson
Responsible-Changed-When: Mon Aug 15 10:25:48 GMT 2005
Responsible-Changed-Why: 
Take ownership of this PR since I am responsible for libmemstat(3).
Pointed to by simon.


http://www.freebsd.org/cgi/query-pr.cgi?pr=84946



More information about the freebsd-doc mailing list