From owner-svn-src-stable-7@FreeBSD.ORG Mon Jun 22 13:46:00 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 658C3106566C; Mon, 22 Jun 2009 13:46:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 533CB8FC08; Mon, 22 Jun 2009 13:46:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5MDk0Dw040867; Mon, 22 Jun 2009 13:46:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5MDk0VM040865; Mon, 22 Jun 2009 13:46:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906221346.n5MDk0VM040865@svn.freebsd.org> From: John Baldwin Date: Mon, 22 Jun 2009 13:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194623 - stable/7/lib/libmemstat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2009 13:46:01 -0000 Author: jhb Date: Mon Jun 22 13:46:00 2009 New Revision: 194623 URL: http://svn.freebsd.org/changeset/base/194623 Log: MFC: Update the KVM backend for malloc stats to catch up to the internal structure BI change from the addition of DTrace malloc(9) probes. Modified: stable/7/lib/libmemstat/ (props changed) stable/7/lib/libmemstat/memstat_malloc.c Modified: stable/7/lib/libmemstat/memstat_malloc.c ============================================================================== --- stable/7/lib/libmemstat/memstat_malloc.c Mon Jun 22 10:59:34 2009 (r194622) +++ stable/7/lib/libmemstat/memstat_malloc.c Mon Jun 22 13:46:00 2009 (r194623) @@ -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);