From owner-freebsd-gnome@FreeBSD.ORG Mon Nov 22 20:49:53 2004 Return-Path: Delivered-To: freebsd-gnome@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9A87D16A4D3 for ; Mon, 22 Nov 2004 20:49:53 +0000 (GMT) Received: from rooster.cisco.com (hen.cisco.com [64.102.19.198]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A44F43D46 for ; Mon, 22 Nov 2004 20:49:53 +0000 (GMT) (envelope-from marcus@FreeBSD.org) Received: from [64.102.192.40] (dhcp-64-102-192-40.cisco.com [64.102.192.40]) by rooster.cisco.com (8.11.7+Sun/8.8.8) with ESMTP id iAMKnqe03205 for ; Mon, 22 Nov 2004 15:49:52 -0500 (EST) Message-ID: <41A250FD.2070509@FreeBSD.org> Date: Mon, 22 Nov 2004 15:50:05 -0500 From: Joe Marcus Clarke Organization: FreeBSD, Inc. User-Agent: Mozilla Thunderbird 0.9 (Macintosh/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: gnome@FreeBSD.org X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------030806040301060503010609" Subject: New patch for libgtop2 on -CURRENT X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2004 20:49:53 -0000 This is a multi-part message in MIME format. --------------030806040301060503010609 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Attached is a patch that attempts to fix the recent vnode/inode problems in libgtop2 while still preserving functionality. If you have a recent 6-CURRENT, please try this patch, and let me know how it goes. Thanks. Joe - -- Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBolD9b2iPiv4Uz4cRAqbWAJ9A/sNY2HFx+XPyWrMGgjrwsP9KiwCfbR1s 97EIy3XRLAsEq4nNIEksFHA= =s+3y -----END PGP SIGNATURE----- --------------030806040301060503010609 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="patch-ah" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-ah" --- sysdeps/freebsd/procmap.c.orig Fri Sep 24 18:49:06 2004 +++ sysdeps/freebsd/procmap.c Mon Nov 22 15:46:38 2004 @@ -47,7 +47,13 @@ #endif #endif +#ifdef __FreeBSD__ +#define _KVM_VNODE +#endif #include +#ifdef __FreeBSD__ +#undef _KVM_VNODE +#endif #include #include #include @@ -104,7 +110,7 @@ glibtop_map_entry *maps; #if defined __FreeBSD__ struct vnode vnode; -#if __FreeBSD_version >= 500039 +#if __FreeBSD_version < 500039 struct inode inode; #endif #endif @@ -122,8 +128,10 @@ /* Get the process data */ pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count); - if ((pinfo == NULL) || (count < 1)) + if ((pinfo == NULL) || (count < 1)) { glibtop_error_io_r (server, "kvm_getprocs (%d)", pid); + return NULL; + } /* Now we get the memory maps. */ @@ -261,7 +269,7 @@ &vnode, sizeof (vnode)) != sizeof (vnode)) glibtop_error_io_r (server, "kvm_read (vnode)"); -#if defined(__FreeBSD__) && (__FreeBSD_version >= 500039) +#if defined(__FreeBSD__) && (__FreeBSD_version >= 500039 && __FreeBSD_version < 600006) switch (vnode.v_type) { case VREG: maps [i-1].inode = vnode.v_cachedid; @@ -278,13 +286,9 @@ &inode, sizeof (inode)) != sizeof (inode)) glibtop_error_io_r (server, "kvm_read (inode)"); - if (kvm_read (server->machine.kd, - (unsigned long) vnode.v_mount, - &mount, sizeof (mount)) != sizeof (mount)) - glibtop_error_io_r (server, "kvm_read (mount)"); -#endif maps [i-1].inode = inode.i_number; maps [i-1].device = inode.i_dev; +#endif #endif } while (entry.next != first); --------------030806040301060503010609--