From b0afe6f044707e941c997570db03b56fea5a72b3 Mon Sep 17 00:00:00 2001 From: bz Date: Wed, 12 Aug 2009 12:06:16 +0000 Subject: 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 --- sys/kern/subr_pcpu.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sys/kern/subr_pcpu.c') diff --git a/sys/kern/subr_pcpu.c b/sys/kern/subr_pcpu.c index c0372b0..5610980 100644 --- a/sys/kern/subr_pcpu.c +++ b/sys/kern/subr_pcpu.c @@ -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) -- cgit v1.1