Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Aug 2012 19:12:54 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r239875 - in stable/8/sys: kern vm
Message-ID:  <201208291912.q7TJCspT099121@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Aug 29 19:12:53 2012
New Revision: 239875
URL: http://svn.freebsd.org/changeset/base/239875

Log:
  MFC 238000,239584:
  Honor db_pager_quit in 'show malloc', 'show uma', and 'show witness'.

Modified:
  stable/8/sys/kern/kern_malloc.c
  stable/8/sys/kern/subr_witness.c
  stable/8/sys/vm/uma_core.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/compat/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)
  stable/8/sys/dev/sound/   (props changed)
  stable/8/sys/dev/sound/pci/   (props changed)
  stable/8/sys/dev/virtio/   (props changed)
  stable/8/sys/kern/   (props changed)
  stable/8/sys/sys/   (props changed)
  stable/8/sys/vm/   (props changed)

Modified: stable/8/sys/kern/kern_malloc.c
==============================================================================
--- stable/8/sys/kern/kern_malloc.c	Wed Aug 29 19:12:33 2012	(r239874)
+++ stable/8/sys/kern/kern_malloc.c	Wed Aug 29 19:12:53 2012	(r239875)
@@ -924,6 +924,8 @@ DB_SHOW_COMMAND(malloc, db_show_malloc)
 		db_printf("%18s %12ju %12juK %12ju\n",
 		    mtp->ks_shortdesc, allocs - frees,
 		    (alloced - freed + 1023) / 1024, allocs);
+		if (db_pager_quit)
+			break;
 	}
 }
 #endif

Modified: stable/8/sys/kern/subr_witness.c
==============================================================================
--- stable/8/sys/kern/subr_witness.c	Wed Aug 29 19:12:33 2012	(r239874)
+++ stable/8/sys/kern/subr_witness.c	Wed Aug 29 19:12:53 2012	(r239875)
@@ -929,6 +929,8 @@ witness_ddb_display_descendants(int(*prn
 	indent++;
 	WITNESS_INDEX_ASSERT(w->w_index);
 	for (i = 1; i <= w_max_used_index; i++) {
+		if (db_pager_quit)
+			return;
 		if (w_rmatrix[w->w_index][i] & WITNESS_PARENT)
 			witness_ddb_display_descendants(prnt, &w_data[i],
 			    indent);
@@ -947,6 +949,8 @@ witness_ddb_display_list(int(*prnt)(cons
 
 		/* This lock has no anscestors - display its descendants. */
 		witness_ddb_display_descendants(prnt, w, 0);
+		if (db_pager_quit)
+			return;
 	}
 }
 	
@@ -968,12 +972,16 @@ witness_ddb_display(int(*prnt)(const cha
 	 */
 	prnt("Sleep locks:\n");
 	witness_ddb_display_list(prnt, &w_sleep);
+	if (db_pager_quit)
+		return;
 	
 	/*
 	 * Now do spin locks which have been acquired at least once.
 	 */
 	prnt("\nSpin locks:\n");
 	witness_ddb_display_list(prnt, &w_spin);
+	if (db_pager_quit)
+		return;
 	
 	/*
 	 * Finally, any locks which have not been acquired yet.
@@ -984,6 +992,8 @@ witness_ddb_display(int(*prnt)(const cha
 			continue;
 		prnt("%s (type: %s, depth: %d)\n", w->w_name,
 		    w->w_class->lc_name, w->w_ddb_level);
+		if (db_pager_quit)
+			return;
 	}
 }
 #endif /* DDB */
@@ -2370,6 +2380,8 @@ DB_SHOW_ALL_COMMAND(locks, db_witness_li
 			db_printf("Process %d (%s) thread %p (%d)\n", p->p_pid,
 			    p->p_comm, td, td->td_tid);
 			witness_ddb_list(td);
+			if (db_pager_quit)
+				return;
 		}
 	}
 }

Modified: stable/8/sys/vm/uma_core.c
==============================================================================
--- stable/8/sys/vm/uma_core.c	Wed Aug 29 19:12:33 2012	(r239874)
+++ stable/8/sys/vm/uma_core.c	Wed Aug 29 19:12:53 2012	(r239875)
@@ -3367,6 +3367,8 @@ DB_SHOW_COMMAND(uma, db_show_uma)
 			    (uintmax_t)kz->uk_size,
 			    (intmax_t)(allocs - frees), cachefree,
 			    (uintmax_t)allocs);
+			if (db_pager_quit)
+				return;
 		}
 	}
 }



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