svn commit: r239874 - in stable/9/sys: kern vm

John Baldwin jhb at FreeBSD.org
Wed Aug 29 19:12:34 UTC 2012


Author: jhb
Date: Wed Aug 29 19:12:33 2012
New Revision: 239874
URL: http://svn.freebsd.org/changeset/base/239874

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

Modified:
  stable/9/sys/kern/kern_malloc.c
  stable/9/sys/kern/subr_witness.c
  stable/9/sys/vm/uma_core.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/isp/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/kern/kern_malloc.c
==============================================================================
--- stable/9/sys/kern/kern_malloc.c	Wed Aug 29 18:58:03 2012	(r239873)
+++ stable/9/sys/kern/kern_malloc.c	Wed Aug 29 19:12:33 2012	(r239874)
@@ -963,6 +963,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;
 	}
 }
 
@@ -992,6 +994,8 @@ DB_SHOW_COMMAND(multizone_matches, db_sh
 		if (mtip->mti_zone != subzone)
 			continue;
 		db_printf("%s\n", mtp->ks_shortdesc);
+		if (db_pager_quit)
+			break;
 	}
 }
 #endif /* MALLOC_DEBUG_MAXZONES > 1 */

Modified: stable/9/sys/kern/subr_witness.c
==============================================================================
--- stable/9/sys/kern/subr_witness.c	Wed Aug 29 18:58:03 2012	(r239873)
+++ stable/9/sys/kern/subr_witness.c	Wed Aug 29 19:12:33 2012	(r239874)
@@ -943,6 +943,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);
@@ -961,6 +963,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;
 	}
 }
 	
@@ -982,12 +986,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.
@@ -998,6 +1006,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 */
@@ -2393,6 +2403,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/9/sys/vm/uma_core.c
==============================================================================
--- stable/9/sys/vm/uma_core.c	Wed Aug 29 18:58:03 2012	(r239873)
+++ stable/9/sys/vm/uma_core.c	Wed Aug 29 19:12:33 2012	(r239874)
@@ -3345,6 +3345,8 @@ DB_SHOW_COMMAND(uma, db_show_uma)
 			    (uintmax_t)kz->uk_size,
 			    (intmax_t)(allocs - frees), cachefree,
 			    (uintmax_t)allocs, sleeps);
+			if (db_pager_quit)
+				return;
 		}
 	}
 }


More information about the svn-src-stable-9 mailing list