Date: Fri, 15 May 2009 18:25:44 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r192148 - head/lib/libmemstat Message-ID: <200905151825.n4FIPi2J030828@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Fri May 15 18:25:44 2009 New Revision: 192148 URL: http://svn.freebsd.org/changeset/base/192148 Log: Update the KVM backend for malloc stats to catch up to the internal structure BI change from the addition of DTrace malloc(9) probes. Submitted by: Ben Kelly ben of wanderview dot com Modified: head/lib/libmemstat/memstat_malloc.c Modified: head/lib/libmemstat/memstat_malloc.c ============================================================================== --- head/lib/libmemstat/memstat_malloc.c Fri May 15 17:02:11 2009 (r192147) +++ head/lib/libmemstat/memstat_malloc.c Fri May 15 18:25:44 2009 (r192148) @@ -296,6 +296,7 @@ memstat_kvm_malloc(struct memory_type_li int hint_dontsearch, j, mp_maxcpus, ret; char name[MEMTYPE_MAXNAME]; struct malloc_type_stats mts[MEMSTAT_MAXCPU], *mtsp; + struct malloc_type_internal *mtip; struct malloc_type type, *typep; kvm_t *kvm; @@ -349,13 +350,11 @@ memstat_kvm_malloc(struct memory_type_li } /* - * Take advantage of explicit knowledge that - * malloc_type_internal is simply an array of statistics - * structures of number MAXCPU. Since our compile-time - * value for MAXCPU may differ from the kernel's, we - * populate our own array. + * Since our compile-time value for MAXCPU may differ from the + * kernel's, we populate our own array. */ - ret = kread(kvm, type.ks_handle, mts, mp_maxcpus * + mtip = type.ks_handle; + ret = kread(kvm, mtip->mti_stats, mts, mp_maxcpus * sizeof(struct malloc_type_stats), 0); if (ret != 0) { _memstat_mtl_empty(list);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905151825.n4FIPi2J030828>