Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Mar 2021 16:14:45 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r567321 - head/devel/libgtop/files
Message-ID:  <202103041614.124GEjE0070924@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <sys/mount.h>
  #include <ufs/ufs/quota.h>
- #include <ufs/ufs/inode.h>
+-#include <ufs/ufs/inode.h>
 +#include <ufs/ufs/extattr.h>
 +#include <ufs/ufs/ufsmount.h>
  #include <fs/devfs/devfs.h>
  #if (__FreeBSD_version >= 600006) || defined(__FreeBSD_kernel__)
  #include <fs/devfs/devfs_int.h>
-@@ -95,12 +97,14 @@ _glibtop_sysdeps_freebsd_dev_inode (glibtop *server, s
+ #endif
+ #undef _KERNEL
++#include <ufs/ufs/inode.h>
+ 
+-
+ #if (__FreeBSD_version >= 1101001)
+ #define _KERNEL
+ #include <ufs/ufs/extattr.h>
+@@ -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;
  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103041614.124GEjE0070924>