diff options
author | jhb <jhb@FreeBSD.org> | 2001-04-17 02:41:41 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-04-17 02:41:41 +0000 |
commit | da16744cc00469c15e844bbcbd2065cf16e7106d (patch) | |
tree | fa555c8630b2610a394db9bb4e6a74721e0fe1a5 | |
parent | 58889ae5bb8ce5d32f9e6234ff21f8d89c2f54a8 (diff) | |
download | FreeBSD-src-da16744cc00469c15e844bbcbd2065cf16e7106d.zip FreeBSD-src-da16744cc00469c15e844bbcbd2065cf16e7106d.tar.gz |
- Stop other CPU's in the SMP case when we enter ddb.
- Add a new ddb command: 'show pcpu' similar to the i386 command added
recently. By default it displays the current CPU's info, but an optional
argument can specify the logical ID of a specific CPU to examine.
-rw-r--r-- | sys/alpha/alpha/db_interface.c | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/sys/alpha/alpha/db_interface.c b/sys/alpha/alpha/db_interface.c index 304e353..d6b1297 100644 --- a/sys/alpha/alpha/db_interface.c +++ b/sys/alpha/alpha/db_interface.c @@ -193,11 +193,15 @@ kdb_trap(a0, a1, a2, entry, regs) s = critical_enter(); -#if 0 +#ifdef SMP +#ifdef DIAGNOSTIC db_printf("stopping %x\n", PCPU_GET(other_cpus)); +#endif stop_cpus(PCPU_GET(other_cpus)); +#ifdef DIAGNOSTIC db_printf("stopped_cpus=%x\n", stopped_cpus); #endif +#endif db_active++; @@ -210,7 +214,7 @@ kdb_trap(a0, a1, a2, entry, regs) db_active--; -#if 0 +#ifdef SMP restart_cpus(stopped_cpus); #endif @@ -565,3 +569,49 @@ db_branch_taken(ins, pc, regs) return (newpc); } + +DB_SHOW_COMMAND(pcpu, db_show_pcpu) +{ + struct globaldata *gd; + int id; + + if (have_addr) + id = ((addr >> 4) % 16) * 10 + (addr % 16); + else + id = PCPU_GET(cpuid); + SLIST_FOREACH(gd, &cpuhead, gd_allcpu) { + if (gd->gd_cpuid == id) + break; + } + if (gd == NULL) + db_printf("CPU %d not found\n", id); + else { + db_printf("cpuid = %d\n", gd->gd_cpuid); + db_printf("ipis = %lx\n", gd->gd_pending_ipis); + db_printf("next ASN = %d\n", gd->gd_next_asn); + db_printf("curproc = "); + if (gd->gd_curproc != NULL) + db_printf("%p: pid %d \"%s\"\n", gd->gd_curproc, + gd->gd_curproc->p_pid, gd->gd_curproc->p_comm); + else + db_printf("none\n"); + db_printf("curpcb = %p\n", gd->gd_curpcb); + db_printf("fpcurproc = "); + if (gd->gd_fpcurproc != NULL) + db_printf("%p: pid %d \"%s\"\n", gd->gd_fpcurproc, + gd->gd_fpcurproc->p_pid, gd->gd_fpcurproc->p_comm); + else + db_printf("none\n"); + db_printf("idleproc = "); + if (gd->gd_idleproc != NULL) + db_printf("%p: pid %d \"%s\"\n", gd->gd_idleproc, + gd->gd_idleproc->p_pid, gd->gd_idleproc->p_comm); + else + db_printf("none\n"); + +#ifdef WITNESS + db_printf("spin locks held:\n"); + witness_list_locks(&gd->gd_spinlocks); +#endif + } +} |