Date: Mon, 15 Aug 2005 10:28:38 GMT From: Robert Watson <rwatson@FreeBSD.org> To: dunstan@freebsd.czest.pl, rwatson@FreeBSD.org, freebsd-doc@FreeBSD.org, rwatson@FreeBSD.org Subject: Re: docs/84946: 'Mbuf' instead of 'mbuf' in libmemstat(3) Message-ID: <200508151028.j7FASc2C099591@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508151028.j7FASc2C099591>