From owner-svn-ports-head@freebsd.org Thu Mar 4 16:14:45 2021 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 864C4550A25; Thu, 4 Mar 2021 16:14:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrwtY3TQfz4VRr; Thu, 4 Mar 2021 16:14:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A98B20509; Thu, 4 Mar 2021 16:14:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 124GEjN0070925; Thu, 4 Mar 2021 16:14:45 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 124GEjE0070924; Thu, 4 Mar 2021 16:14:45 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202103041614.124GEjE0070924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 4 Mar 2021 16:14:45 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r567321 - head/devel/libgtop/files X-SVN-Group: ports-head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/devel/libgtop/files X-SVN-Commit-Revision: 567321 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 16:14:45 -0000 Author: cy Date: Thu Mar 4 16:14:44 2021 New Revision: 567321 URL: https://svnweb.freebsd.org/changeset/ports/567321 Log: devel/libgtop: Fix build on 14-CURRENT post 2bfd8992c7c7 sys/inode.h now implicitly includes sys/buf.h which which itself has dependencies requiring repositioning of inode.h. This patch also references the inode itself instead of relying on the VTOI macro thereby removing the need to define the _KERNEL macro when including sys/inode.h. PR: 253928, 253870 Submitted by: nyan _ myuji.xyz Reported by: cy, madpilot Reviewed by: cy MFH: 2021Q1 Differential Revision: https://reviews.freebsd.org/D29050 Modified: head/devel/libgtop/files/patch-sysdeps_freebsd_procmap.c (contents, props changed) Modified: head/devel/libgtop/files/patch-sysdeps_freebsd_procmap.c ============================================================================== --- head/devel/libgtop/files/patch-sysdeps_freebsd_procmap.c Thu Mar 4 15:49:12 2021 (r567320) +++ head/devel/libgtop/files/patch-sysdeps_freebsd_procmap.c Thu Mar 4 16:14:44 2021 (r567321) @@ -1,15 +1,24 @@ ---- sysdeps/freebsd/procmap.c.orig 2017-08-07 22:43:41 UTC +--- sysdeps/freebsd/procmap.c.orig 2019-02-04 20:15:22 UTC +++ sysdeps/freebsd/procmap.c -@@ -52,6 +52,8 @@ +@@ -51,14 +51,15 @@ + #define _KERNEL #include #include - #include +-#include +#include +#include #include #if (__FreeBSD_version >= 600006) || defined(__FreeBSD_kernel__) #include -@@ -95,12 +97,14 @@ _glibtop_sysdeps_freebsd_dev_inode (glibtop *server, s + #endif + #undef _KERNEL ++#include + +- + #if (__FreeBSD_version >= 1101001) + #define _KERNEL + #include +@@ -95,12 +96,14 @@ _glibtop_sysdeps_freebsd_dev_inode (glibtop *server, s struct cdev_priv priv; #if __FreeBSD_version < 800039 struct cdev si; @@ -25,7 +34,16 @@ (char *) &tagptr, sizeof (tagptr)) != sizeof (tagptr) || kvm_read (server->machine->kd, (gulong) tagptr, (char *) tagstr, sizeof (tagstr)) != sizeof (tagstr)) -@@ -231,6 +235,32 @@ _glibtop_init_proc_map_p (glibtop *server) +@@ -120,7 +123,7 @@ _glibtop_sysdeps_freebsd_dev_inode (glibtop *server, s + return; + } + +- if (kvm_read (server->machine->kd, (gulong) VTOI(vn), (char *) &inode, ++ if (kvm_read (server->machine->kd, (gulong) ((struct inode *)(vn)->v_data), (char *) &inode, + sizeof (inode)) != sizeof (inode)) + { + glibtop_warn_io_r (server, "kvm_read (inode)"); +@@ -231,6 +234,32 @@ _glibtop_init_proc_map_p (glibtop *server) server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; } @@ -58,7 +76,7 @@ /* Provides detailed information about a process. */ glibtop_map_entry * -@@ -238,13 +268,12 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ +@@ -238,13 +267,12 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ pid_t pid) { struct kinfo_proc *pinfo; @@ -74,7 +92,7 @@ memset (buf, 0, sizeof (glibtop_proc_map)); -@@ -273,16 +302,6 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ +@@ -273,16 +301,6 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ return NULL; } @@ -91,7 +109,7 @@ /* Walk through the `vm_map_entry' list ... */ /* I tested this a few times with `mmap'; as soon as you write -@@ -292,21 +311,17 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ +@@ -292,21 +310,17 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ maps = g_array_sized_new(FALSE, FALSE, sizeof(glibtop_map_entry), vmspace.vm_map.nentries); @@ -120,7 +138,7 @@ if (entry.eflags & (MAP_ENTRY_IS_SUB_MAP)) continue; -@@ -377,7 +392,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ +@@ -377,7 +391,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ if (entry.protection & VM_PROT_EXECUTE) mentry->perm |= GLIBTOP_MAP_PERM_EXECUTE;