Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jul 2012 09:38:19 +0000 (UTC)
From:      Gabor Pali <pgj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r238527 - in head: sys/kern sys/sys usr.bin/procstat
Message-ID:  <201207160938.q6G9cJOL025816@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pgj (ports committer)
Date: Mon Jul 16 09:38:19 2012
New Revision: 238527
URL: http://svn.freebsd.org/changeset/base/238527

Log:
  - Add support for displaying process stack memory regions.
  
  Approved by:	rwatson
  MFC after:	3 days

Modified:
  head/sys/kern/kern_proc.c
  head/sys/sys/user.h
  head/usr.bin/procstat/procstat.1
  head/usr.bin/procstat/procstat_vm.c

Modified: head/sys/kern/kern_proc.c
==============================================================================
--- head/sys/kern/kern_proc.c	Mon Jul 16 09:35:47 2012	(r238526)
+++ head/sys/kern/kern_proc.c	Mon Jul 16 09:38:19 2012	(r238527)
@@ -2189,6 +2189,10 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR
 			kve->kve_flags |= KVME_FLAG_NEEDS_COPY;
 		if (entry->eflags & MAP_ENTRY_NOCOREDUMP)
 			kve->kve_flags |= KVME_FLAG_NOCOREDUMP;
+		if (entry->eflags & MAP_ENTRY_GROWS_UP)
+			kve->kve_flags |= KVME_FLAG_GROWS_UP;
+		if (entry->eflags & MAP_ENTRY_GROWS_DOWN)
+			kve->kve_flags |= KVME_FLAG_GROWS_DOWN;
 
 		last_timestamp = map->timestamp;
 		vm_map_unlock_read(map);

Modified: head/sys/sys/user.h
==============================================================================
--- head/sys/sys/user.h	Mon Jul 16 09:35:47 2012	(r238526)
+++ head/sys/sys/user.h	Mon Jul 16 09:38:19 2012	(r238527)
@@ -413,6 +413,8 @@ struct kinfo_file {
 #define	KVME_FLAG_NEEDS_COPY	0x00000002
 #define	KVME_FLAG_NOCOREDUMP	0x00000004
 #define	KVME_FLAG_SUPER		0x00000008
+#define	KVME_FLAG_GROWS_UP	0x00000010
+#define	KVME_FLAG_GROWS_DOWN	0x00000020
 
 #if defined(__amd64__)
 #define	KINFO_OVMENTRY_SIZE	1168

Modified: head/usr.bin/procstat/procstat.1
==============================================================================
--- head/usr.bin/procstat/procstat.1	Mon Jul 16 09:35:47 2012	(r238526)
+++ head/usr.bin/procstat/procstat.1	Mon Jul 16 09:38:19 2012	(r238527)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 23, 2012
+.Dd July 11, 2012
 .Dt PROCSTAT 1
 .Os
 .Sh NAME
@@ -433,6 +433,10 @@ copy-on-write
 needs copy
 .It S
 one or more superpage mappings are used
+.It D
+grows down (top-down stack)
+.It U
+grows up (bottom-up stack)
 .El
 .Sh EXIT STATUS
 .Ex -std

Modified: head/usr.bin/procstat/procstat_vm.c
==============================================================================
--- head/usr.bin/procstat/procstat_vm.c	Mon Jul 16 09:35:47 2012	(r238526)
+++ head/usr.bin/procstat/procstat_vm.c	Mon Jul 16 09:38:19 2012	(r238527)
@@ -72,7 +72,9 @@ procstat_vm(struct kinfo_proc *kipp)
 		printf("%-1s", kve->kve_flags & KVME_FLAG_COW ? "C" : "-");
 		printf("%-1s", kve->kve_flags & KVME_FLAG_NEEDS_COPY ? "N" :
 		    "-");
-		printf("%-1s ", kve->kve_flags & KVME_FLAG_SUPER ? "S" : "-");
+		printf("%-1s", kve->kve_flags & KVME_FLAG_SUPER ? "S" : "-");
+		printf("%-1s ", kve->kve_flags & KVME_FLAG_GROWS_UP ? "U" :
+		    kve->kve_flags & KVME_FLAG_GROWS_DOWN ? "D" : "-");
 		switch (kve->kve_type) {
 		case KVME_TYPE_NONE:
 			str = "--";



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