svn commit: r196132 - head/sys/kern

Bjoern A. Zeeb bz at FreeBSD.org
Wed Aug 12 12:06:40 UTC 2009


Author: bz
Date: Wed Aug 12 12:06:16 2009
New Revision: 196132
URL: http://svn.freebsd.org/changeset/base/196132

Log:
  Add ddb show dpcpu_off command to ease dpcpu memory debugging.
  While show pcpu prints pc_dynamic this also prints the original
  memory address as well as the maths.
  
  Once dpcpu goes NUMA this is considered to help debugging as well.
  
  Reviewed by:	rwatson
  Approved by:	re

Modified:
  head/sys/kern/subr_pcpu.c

Modified: head/sys/kern/subr_pcpu.c
==============================================================================
--- head/sys/kern/subr_pcpu.c	Wed Aug 12 12:05:07 2009	(r196131)
+++ head/sys/kern/subr_pcpu.c	Wed Aug 12 12:06:16 2009	(r196132)
@@ -313,6 +313,18 @@ sysctl_dpcpu_int(SYSCTL_HANDLER_ARGS)
 }
 
 #ifdef DDB
+DB_SHOW_COMMAND(dpcpu_off, db_show_dpcpu_off)
+{
+	int id;
+
+	for (id = 0; id <= mp_maxid; id++) {
+		if (CPU_ABSENT(id))
+			continue;
+		db_printf("dpcpu_off[%2d] = 0x%jx (+ DPCPU_START = %p)\n",
+		    id, (uintmax_t)dpcpu_off[id],
+		    (void *)(uintptr_t)(dpcpu_off[id] + DPCPU_START));
+	}
+}
 
 static void
 show_pcpu(struct pcpu *pc)


More information about the svn-src-all mailing list