No need for every thread to have its own name, right?

(And can I say, wow, is every arch except i386 generous with the
debug output?)

Index: arch/alpha/alpha/interrupt.c
===================================================================
RCS file: /cvs/src/sys/arch/alpha/alpha/interrupt.c,v
retrieving revision 1.31
diff -u -p -r1.31 interrupt.c
--- arch/alpha/alpha/interrupt.c        15 Apr 2011 20:40:03 -0000      1.31
+++ arch/alpha/alpha/interrupt.c        4 Feb 2014 00:57:42 -0000
@@ -375,7 +375,7 @@ fatal:
        printf("    curproc = %p\n", curproc);
        if (curproc != NULL)
                printf("        pid = %d, comm = %s\n", curproc->p_pid,
-                   curproc->p_comm);
+                   curproc->p_p->ps_comm);
        printf("\n");
        panic("machine check");
 }
Index: arch/alpha/alpha/trap.c
===================================================================
RCS file: /cvs/src/sys/arch/alpha/alpha/trap.c,v
retrieving revision 1.65
diff -u -p -r1.65 trap.c
--- arch/alpha/alpha/trap.c     6 Jan 2014 20:27:44 -0000       1.65
+++ arch/alpha/alpha/trap.c     4 Feb 2014 00:57:42 -0000
@@ -209,7 +209,7 @@ printtrap(a0, a1, a2, entry, framep, isf
        printf("    curproc    = %p\n", curproc);
        if (curproc != NULL)
                printf("        pid = %d, comm = %s\n", curproc->p_pid,
-                      curproc->p_comm);
+                      curproc->p_p->ps_comm);
        printf("\n");
 }
 #endif /* DEBUG */
@@ -452,7 +452,7 @@ do_fault:
                        typ = SEGV_MAPERR;
                        if (rv == ENOMEM) {
                                printf("UVM: pid %u (%s), uid %u killed: "
-                                      "out of swap\n", p->p_pid, p->p_comm,
+                                      "out of swap\n", p->p_pid, 
p->p_p->ps_comm,
                                       p->p_cred && p->p_ucred ?
                                       p->p_ucred->cr_uid : -1);
                                i = SIGKILL;
@@ -968,7 +968,7 @@ unaligned_fixup(va, opcode, reg, p)
        if (doprint) {
                uprintf(
                "pid %u (%s): unaligned access: va=0x%lx pc=0x%lx ra=0x%lx op=",
-                   p->p_pid, p->p_comm, va,
+                   p->p_pid, p->p_p->ps_comm, va,
                    p->p_md.md_tf->tf_regs[FRAME_PC] - 4,
                    p->p_md.md_tf->tf_regs[FRAME_RA]);
                uprintf(selected_tab->type,opcode);
Index: arch/amd64/amd64/machdep.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/machdep.c,v
retrieving revision 1.173
diff -u -p -r1.173 machdep.c
--- arch/amd64/amd64/machdep.c  5 Jan 2014 20:23:56 -0000       1.173
+++ arch/amd64/amd64/machdep.c  4 Feb 2014 00:57:42 -0000
@@ -552,7 +552,7 @@ sendsig(sig_t catcher, int sig, int mask
 #ifdef DEBUG
        if ((sigdebug & SDB_FOLLOW) && (!sigpid || p->p_pid == sigpid))
                printf("sendsig: %s[%d] sig %d catcher %p\n",
-                   p->p_comm, p->p_pid, sig, catcher);
+                   p->p_p->ps_comm, p->p_pid, sig, catcher);
 #endif
 
        bcopy(tf, &ksc, sizeof(*tf));
Index: arch/amd64/amd64/trap.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/trap.c,v
retrieving revision 1.32
diff -u -p -r1.32 trap.c
--- arch/amd64/amd64/trap.c     31 Dec 2012 06:46:13 -0000      1.32
+++ arch/amd64/amd64/trap.c     4 Feb 2014 00:57:42 -0000
@@ -246,7 +246,7 @@ copyfault:
        case T_NMI|T_USER:
 #ifdef TRAP_SIGDEBUG
                printf("pid %d (%s): BUS at rip %lx addr %lx\n",
-                   p->p_pid, p->p_comm, frame->tf_rip, rcr2());
+                   p->p_pid, p->p_p->ps_comm, frame->tf_rip, rcr2());
                frame_dump(frame);
 #endif
                sv.sival_ptr = (void *)frame->tf_rip;
@@ -270,7 +270,7 @@ copyfault:
        case T_FPOPFLT|T_USER:          /* coprocessor operand fault */
 #ifdef TRAP_SIGDEBUG
                printf("pid %d (%s): ILL at rip %lx addr %lx\n",
-                   p->p_pid, p->p_comm, frame->tf_rip, rcr2());
+                   p->p_pid, p->p_p->ps_comm, frame->tf_rip, rcr2());
                frame_dump(frame);
 #endif
                sv.sival_ptr = (void *)frame->tf_rip;
@@ -404,7 +404,7 @@ faultcommon:
                }
                if (error == ENOMEM) {
                        printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
-                              p->p_pid, p->p_comm,
+                              p->p_pid, p->p_p->ps_comm,
                               p->p_cred && p->p_ucred ?
                               (int)p->p_ucred->cr_uid : -1);
                        sv.sival_ptr = (void *)fa;
@@ -412,7 +412,7 @@ faultcommon:
                } else {
 #ifdef TRAP_SIGDEBUG
                        printf("pid %d (%s): SEGV at rip %lx addr %lx\n",
-                           p->p_pid, p->p_comm, frame->tf_rip, fa);
+                           p->p_pid, p->p_p->ps_comm, frame->tf_rip, fa);
                        frame_dump(frame);
 #endif
                        sv.sival_ptr = (void *)fa;
Index: arch/arm/arm/fault.c
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/fault.c,v
retrieving revision 1.14
diff -u -p -r1.14 fault.c
--- arch/arm/arm/fault.c        10 Sep 2013 12:35:25 -0000      1.14
+++ arch/arm/arm/fault.c        4 Feb 2014 00:57:42 -0000
@@ -416,7 +416,7 @@ data_abort_handler(trapframe_t *tf)
        sv.sival_ptr = (u_int32_t *)far;
        if (error == ENOMEM) {
                printf("UVM: pid %d (%s), uid %d killed: "
-                   "out of swap\n", p->p_pid, p->p_comm,
+                   "out of swap\n", p->p_pid, p->p_p->ps_comm,
                    (p->p_cred && p->p_ucred) ?
                     p->p_ucred->cr_uid : -1);
                sd.signo = SIGKILL;
@@ -705,7 +705,7 @@ prefetch_abort_handler(trapframe_t *tf)
        sv.sival_ptr = (u_int32_t *)far;
        if (error == ENOMEM) {
                printf("UVM: pid %d (%s), uid %d killed: "
-                   "out of swap\n", p->p_pid, p->p_comm,
+                   "out of swap\n", p->p_pid, p->p_p->ps_comm,
                    (p->p_cred && p->p_ucred) ?
                     p->p_ucred->cr_uid : -1);
                trapsignal(p, SIGKILL, 0, SEGV_MAPERR, sv);
Index: arch/arm/xscale/pxa2x0_mmc.c
===================================================================
RCS file: /cvs/src/sys/arch/arm/xscale/pxa2x0_mmc.c,v
retrieving revision 1.11
diff -u -p -r1.11 pxa2x0_mmc.c
--- arch/arm/xscale/pxa2x0_mmc.c        22 Aug 2012 13:37:04 -0000      1.11
+++ arch/arm/xscale/pxa2x0_mmc.c        4 Feb 2014 00:57:43 -0000
@@ -349,7 +349,7 @@ pxammc_exec_command(sdmmc_chipset_handle
        DPRINTF(1,("%s: cmd %u arg=%#x data=%#x dlen=%d flags=%#x "
            "proc=\"%s\"\n", sc->sc_dev.dv_xname, cmd->c_opcode,
            cmd->c_arg, cmd->c_data, cmd->c_datalen, cmd->c_flags,
-           curproc ? curproc->p_comm : ""));
+           curproc ? curproc->p_p->ps_comm : ""));
 
        s = splsdmmc();
 
Index: arch/armv7/imx/imxesdhc.c
===================================================================
RCS file: /cvs/src/sys/arch/armv7/imx/imxesdhc.c,v
retrieving revision 1.4
diff -u -p -r1.4 imxesdhc.c
--- arch/armv7/imx/imxesdhc.c   6 Nov 2013 19:03:07 -0000       1.4
+++ arch/armv7/imx/imxesdhc.c   4 Feb 2014 00:57:43 -0000
@@ -654,7 +654,7 @@ imxesdhc_start_command(struct imxesdhc_s
        DPRINTF(1,("%s: start cmd %u arg=%#x data=%#x dlen=%d flags=%#x "
            "proc=\"%s\"\n", HDEVNAME(sc), cmd->c_opcode, cmd->c_arg,
            cmd->c_data, cmd->c_datalen, cmd->c_flags, curproc ?
-           curproc->p_comm : ""));
+           curproc->p_p->ps_comm : ""));
 
        /*
         * The maximum block length for commands should be the minimum
Index: arch/armv7/omap/ommmc.c
===================================================================
RCS file: /cvs/src/sys/arch/armv7/omap/ommmc.c,v
retrieving revision 1.12
diff -u -p -r1.12 ommmc.c
--- arch/armv7/omap/ommmc.c     4 Dec 2013 12:31:14 -0000       1.12
+++ arch/armv7/omap/ommmc.c     4 Feb 2014 00:57:43 -0000
@@ -823,7 +823,7 @@ ommmc_start_command(struct ommmc_softc *
        DPRINTF(1,("%s: start cmd %u arg=%#x data=%#x dlen=%d flags=%#x "
            "proc=\"%s\"\n", DEVNAME(sc), cmd->c_opcode, cmd->c_arg,
            cmd->c_data, cmd->c_datalen, cmd->c_flags, curproc ?
-           curproc->p_comm : ""));
+           curproc->p_p->ps_comm : ""));
 
        /*
         * The maximum block length for commands should be the minimum
Index: arch/hp300/hp300/trap.c
===================================================================
RCS file: /cvs/src/sys/arch/hp300/hp300/trap.c,v
retrieving revision 1.63
diff -u -p -r1.63 trap.c
--- arch/hp300/hp300/trap.c     2 Nov 2013 13:49:22 -0000       1.63
+++ arch/hp300/hp300/trap.c     4 Feb 2014 00:57:43 -0000
@@ -348,7 +348,7 @@ dopanic:
        case T_FPEMULD|T_USER:  /* unimplemented FP data type */
                /* XXX need to FSAVE */
                printf("pid %d(%s): unimplemented FP %s at %x (EA %x)\n",
-                      p->p_pid, p->p_comm,
+                      p->p_pid, p->p_p->ps_comm,
                       frame.f_format == 2 ? "instruction" : "data type",
                       frame.f_pc, frame.f_fmt2.f_iaddr);
                /* XXX need to FRESTORE */
@@ -667,7 +667,7 @@ writeback(struct frame *fp)
                        fa = f->f_fa & ~0xF;
 #ifdef DEBUG
                        if (mmudebug & MDB_WBFAILED)
-                               printf(wberrstr, p->p_pid, p->p_comm,
+                               printf(wberrstr, p->p_pid, p->p_p->ps_comm,
                                       "MOVE16", fp->f_pc, f->f_fa,
                                       f->f_fa & ~0xF, f->f_pd0);
 #endif
@@ -728,7 +728,7 @@ writeback(struct frame *fp)
                        fa = f->f_wb1a;
 #ifdef DEBUG
                        if (mmudebug & MDB_WBFAILED)
-                               printf(wberrstr, p->p_pid, p->p_comm,
+                               printf(wberrstr, p->p_pid, p->p_p->ps_comm,
                                       "#1", fp->f_pc, f->f_fa,
                                       f->f_wb1a, f->f_wb1d);
 #endif
@@ -781,7 +781,7 @@ writeback(struct frame *fp)
                        fa = f->f_wb2a;
 #ifdef DEBUG
                        if (mmudebug & MDB_WBFAILED) {
-                               printf(wberrstr, p->p_pid, p->p_comm,
+                               printf(wberrstr, p->p_pid, p->p_p->ps_comm,
                                       "#2", fp->f_pc, f->f_fa,
                                       f->f_wb2a, f->f_wb2d);
                                dumpssw(f->f_ssw);
@@ -834,7 +834,7 @@ writeback(struct frame *fp)
                        fa = f->f_wb3a;
 #ifdef DEBUG
                        if (mmudebug & MDB_WBFAILED)
-                               printf(wberrstr, p->p_pid, p->p_comm,
+                               printf(wberrstr, p->p_pid, p->p_p->ps_comm,
                                       "#3", fp->f_pc, f->f_fa,
                                       f->f_wb3a, f->f_wb3d);
 #endif
Index: arch/hppa/hppa/machdep.c
===================================================================
RCS file: /cvs/src/sys/arch/hppa/hppa/machdep.c,v
retrieving revision 1.213
diff -u -p -r1.213 machdep.c
--- arch/hppa/hppa/machdep.c    23 Nov 2013 07:20:52 -0000      1.213
+++ arch/hppa/hppa/machdep.c    4 Feb 2014 00:57:43 -0000
@@ -1222,7 +1222,7 @@ sendsig(sig_t catcher, int sig, int mask
 #ifdef DEBUG
        if ((sigdebug & SDB_FOLLOW) && (!sigpid || p->p_pid == sigpid))
                printf("sendsig: %s[%d] sig %d catcher %p\n",
-                   p->p_comm, p->p_pid, sig, catcher);
+                   p->p_p->ps_comm, p->p_pid, sig, catcher);
 #endif
 
        /* Save the FPU context first. */
Index: arch/hppa64/hppa64/machdep.c
===================================================================
RCS file: /cvs/src/sys/arch/hppa64/hppa64/machdep.c,v
retrieving revision 1.53
diff -u -p -r1.53 machdep.c
--- arch/hppa64/hppa64/machdep.c        23 Nov 2013 07:20:52 -0000      1.53
+++ arch/hppa64/hppa64/machdep.c        4 Feb 2014 00:57:43 -0000
@@ -850,7 +850,7 @@ sendsig(sig_t catcher, int sig, int mask
 #ifdef DEBUG
        if ((sigdebug & SDB_FOLLOW) && (!sigpid || p->p_pid == sigpid))
                printf("sendsig: %s[%d] sig %d catcher %p\n",
-                   p->p_comm, p->p_pid, sig, catcher);
+                   p->p_p->ps_comm, p->p_pid, sig, catcher);
 #endif
 
        /* Save the FPU context first. */
Index: arch/mips64/mips64/fp_emulate.c
===================================================================
RCS file: /cvs/src/sys/arch/mips64/mips64/fp_emulate.c,v
retrieving revision 1.8
diff -u -p -r1.8 fp_emulate.c
--- arch/mips64/mips64/fp_emulate.c     3 Oct 2012 11:18:23 -0000       1.8
+++ arch/mips64/mips64/fp_emulate.c     4 Feb 2014 00:57:43 -0000
@@ -192,11 +192,11 @@ MipsFPTrap(struct trap_frame *tf)
 #ifdef DEBUG
 #ifdef DDB
        printf("%s: unimplemented FPU completion, fsr 0x%08x\n%p: ",
-           p->p_comm, fsr, pc);
+           p->p_p->ps_comm, fsr, pc);
        dbmd_print_insn(insn, pc, printf);
 #else
        printf("%s: unimplemented FPU completion, insn 0x%08x fsr 0x%08x\n",
-           p->p_comm, insn, fsr);
+           p->p_p->ps_comm, insn, fsr);
 #endif
 #endif
 
Index: arch/mips64/mips64/pmap.c
===================================================================
RCS file: /cvs/src/sys/arch/mips64/mips64/pmap.c,v
retrieving revision 1.67
diff -u -p -r1.67 pmap.c
--- arch/mips64/mips64/pmap.c   8 Jan 2014 17:12:18 -0000       1.67
+++ arch/mips64/mips64/pmap.c   4 Feb 2014 00:57:43 -0000
@@ -1507,13 +1507,13 @@ pmap_alloc_tlbpid(struct proc *p)
        if (curproc) {
                DPRINTF(PDB_FOLLOW|PDB_TLBPID, 
                        ("pmap_alloc_tlbpid: curproc %d '%s' ",
-                               curproc->p_pid, curproc->p_comm));
+                               curproc->p_pid, curproc->p_p->ps_comm));
        } else {
                DPRINTF(PDB_FOLLOW|PDB_TLBPID, 
                        ("pmap_alloc_tlbpid: curproc <none> "));
        }
        DPRINTF(PDB_FOLLOW|PDB_TLBPID, ("segtab %p tlbpid %u pid %d '%s'\n",
-                       pmap->pm_segtab, id, p->p_pid, p->p_comm));
+                       pmap->pm_segtab, id, p->p_pid, p->p_p->ps_comm));
 
        return (id);
 }
Index: arch/mips64/mips64/trap.c
===================================================================
RCS file: /cvs/src/sys/arch/mips64/mips64/trap.c,v
retrieving revision 1.88
diff -u -p -r1.88 trap.c
--- arch/mips64/mips64/trap.c   3 Oct 2012 11:18:23 -0000       1.88
+++ arch/mips64/mips64/trap.c   4 Feb 2014 00:57:43 -0000
@@ -605,7 +605,7 @@ fault_common:
 #ifdef DEBUG
                                printf("trap: %s (%d): breakpoint at %p "
                                    "(insn %08x)\n",
-                                   p->p_comm, p->p_pid,
+                                   p->p_p->ps_comm, p->p_pid,
                                    p->p_md.md_ss_addr, p->p_md.md_ss_instr);
 #endif
 
@@ -1085,7 +1085,7 @@ process_sstep(struct proc *p, int sstep)
                        if (rc != 0)
                                printf("WARNING: %s (%d): can't restore "
                                    "instruction at %p: %08x\n",
-                                   p->p_comm, p->p_pid,
+                                   p->p_p->ps_comm, p->p_pid,
                                    p->p_md.md_ss_addr, p->p_md.md_ss_instr);
 #endif
                        p->p_md.md_ss_addr = 0;
@@ -1110,7 +1110,7 @@ process_sstep(struct proc *p, int sstep)
        if (p->p_md.md_ss_addr != 0) {
                printf("WARNING: %s (%d): breakpoint request "
                    "at %p, already set at %p\n",
-                   p->p_comm, p->p_pid, va, p->p_md.md_ss_addr);
+                   p->p_p->ps_comm, p->p_pid, va, p->p_md.md_ss_addr);
                return EFAULT;
        }
 #endif
@@ -1129,7 +1129,7 @@ process_sstep(struct proc *p, int sstep)
 
 #ifdef DEBUG
        printf("%s (%d): breakpoint set at %p: %08x (pc %p %08x)\n",
-               p->p_comm, p->p_pid,
+               p->p_p->ps_comm, p->p_pid,
                p->p_md.md_ss_addr, p->p_md.md_ss_instr, locr0->pc, curinstr);
 #endif
        return 0;
Index: arch/mvme68k/mvme68k/trap.c
===================================================================
RCS file: /cvs/src/sys/arch/mvme68k/mvme68k/trap.c,v
retrieving revision 1.78
diff -u -p -r1.78 trap.c
--- arch/mvme68k/mvme68k/trap.c 2 Nov 2013 13:49:22 -0000       1.78
+++ arch/mvme68k/mvme68k/trap.c 4 Feb 2014 00:57:43 -0000
@@ -278,7 +278,7 @@ copyfault:
        case T_FPEMULD|T_USER:  /* unimplemented FP data type */
                /* XXX need to FSAVE */
                printf("pid %d(%s): unimplemented FP %s at %x (EA %x)\n",
-                                p->p_pid, p->p_comm,
+                                p->p_pid, p->p_p->ps_comm,
                                 frame.f_format == 2 ? "instruction" : "data 
type",
                                 frame.f_pc, frame.f_fmt2.f_iaddr);
                /* XXX need to FRESTORE */
@@ -593,7 +593,7 @@ writeback(struct frame *fp)
                        fa = f->f_fa & ~0xF;
 #ifdef DEBUG
                        if (mmudebug & MDB_WBFAILED)
-                               printf(wberrstr, p->p_pid, p->p_comm,
+                               printf(wberrstr, p->p_pid, p->p_p->ps_comm,
                                                 "MOVE16", fp->f_pc, f->f_fa,
                                                 f->f_fa & ~0xF, f->f_pd0);
 #endif
@@ -654,7 +654,7 @@ writeback(struct frame *fp)
                        fa = f->f_wb1a;
 #ifdef DEBUG
                        if (mmudebug & MDB_WBFAILED)
-                               printf(wberrstr, p->p_pid, p->p_comm,
+                               printf(wberrstr, p->p_pid, p->p_p->ps_comm,
                                                 "#1", fp->f_pc, f->f_fa,
                                                 f->f_wb1a, f->f_wb1d);
 #endif
@@ -707,7 +707,7 @@ writeback(struct frame *fp)
                        fa = f->f_wb2a;
 #ifdef DEBUG
                        if (mmudebug & MDB_WBFAILED) {
-                               printf(wberrstr, p->p_pid, p->p_comm,
+                               printf(wberrstr, p->p_pid, p->p_p->ps_comm,
                                                 "#2", fp->f_pc, f->f_fa,
                                                 f->f_wb2a, f->f_wb2d);
                                dumpssw(f->f_ssw);
@@ -760,7 +760,7 @@ writeback(struct frame *fp)
                        fa = f->f_wb3a;
 #ifdef DEBUG
                        if (mmudebug & MDB_WBFAILED)
-                               printf(wberrstr, p->p_pid, p->p_comm,
+                               printf(wberrstr, p->p_pid, p->p_p->ps_comm,
                                                 "#3", fp->f_pc, f->f_fa,
                                                 f->f_wb3a, f->f_wb3d);
 #endif
Index: arch/mvme88k/dev/angelfire.c
===================================================================
RCS file: /cvs/src/sys/arch/mvme88k/dev/angelfire.c,v
retrieving revision 1.1
diff -u -p -r1.1 angelfire.c
--- arch/mvme88k/dev/angelfire.c        17 May 2013 22:51:59 -0000      1.1
+++ arch/mvme88k/dev/angelfire.c        4 Feb 2014 00:57:43 -0000
@@ -162,7 +162,7 @@ angelfireparerr(void *eframe)
        if (frame->tf_epsr & PSR_MODE)
                printf("kernel parity error, PC = %p\n", pc);
        else
-               printf("%s: parity error, PC = %p\n", curproc->p_comm, pc);
+               printf("%s: parity error, PC = %p\n", curproc->p_p->ps_comm, 
pc);
 
        return 1;
 }
Index: arch/sh/sh/db_interface.c
===================================================================
RCS file: /cvs/src/sys/arch/sh/sh/db_interface.c,v
retrieving revision 1.4
diff -u -p -r1.4 db_interface.c
--- arch/sh/sh/db_interface.c   20 Jan 2014 21:19:28 -0000      1.4
+++ arch/sh/sh/db_interface.c   4 Feb 2014 00:57:43 -0000
@@ -377,7 +377,7 @@ __db_procname_by_asid(int asid)
                        if (p->p_vmspace != NULL)
                                break;
                if (p != NULL && p->p_vmspace->vm_map.pmap->pm_asid == asid)
-                       return (p->p_comm);
+                       return (p->p_p->ps_comm);
        }
 
        return (notfound);
@@ -643,7 +643,7 @@ db_stackcheck_cmd(db_expr_t addr, int ha
                    pcb->pcb_sf.sf_r7_bank, i, i * 100 / MAX_STACK,
                    (vaddr_t)pcb + PAGE_SIZE, j, j * 100 / MAX_FRAME,
                    j / sizeof(struct trapframe),
-                   p->p_comm);
+                   p->p_p->ps_comm);
        }
 #undef MAX_STACK
 #undef MAX_FRAME
Index: arch/sh/sh/trap.c
===================================================================
RCS file: /cvs/src/sys/arch/sh/sh/trap.c,v
retrieving revision 1.21
diff -u -p -r1.21 trap.c
--- arch/sh/sh/trap.c   31 Dec 2012 06:46:14 -0000      1.21
+++ arch/sh/sh/trap.c   4 Feb 2014 00:57:43 -0000
@@ -433,7 +433,7 @@ tlb_exception(struct proc *p, struct tra
                sv.sival_ptr = (void *)va;
                if (err == ENOMEM) {
                        printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
-                           p->p_pid, p->p_comm,
+                           p->p_pid, p->p_p->ps_comm,
                            p->p_cred && p->p_ucred ?
                                (int)p->p_ucred->cr_uid : -1);
                        trapsignal(p, SIGKILL, tf->tf_expevt, SEGV_MAPERR, sv);
Index: arch/solbourne/solbourne/machdep.c
===================================================================
RCS file: /cvs/src/sys/arch/solbourne/solbourne/machdep.c,v
retrieving revision 1.27
diff -u -p -r1.27 machdep.c
--- arch/solbourne/solbourne/machdep.c  20 Nov 2013 23:57:07 -0000      1.27
+++ arch/solbourne/solbourne/machdep.c  4 Feb 2014 00:57:43 -0000
@@ -385,7 +385,7 @@ sendsig(catcher, sig, mask, code, type, 
 #ifdef DEBUG
        if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
                printf("sendsig: %s[%d] sig %d newusp %p scp %p\n",
-                   p->p_comm, p->p_pid, sig, fp, &fp->sf_sc);
+                   p->p_p->ps_comm, p->p_pid, sig, fp, &fp->sf_sc);
 #endif
        /*
         * Now set up the signal frame.  We build it in kernel space
@@ -441,7 +441,7 @@ sendsig(catcher, sig, mask, code, type, 
 #ifdef DEBUG
        if (sigdebug & SDB_FOLLOW)
                printf("sendsig: %s[%d] sig %d scp %p\n",
-                      p->p_comm, p->p_pid, sig, &fp->sf_sc);
+                      p->p_p->ps_comm, p->p_pid, sig, &fp->sf_sc);
 #endif
        /*
         * Arrange to continue execution at the code copied out in exec().
@@ -488,7 +488,7 @@ sys_sigreturn(p, v, retval)
 #ifdef DEBUG
        if (sigdebug & SDB_FOLLOW)
                printf("sigreturn: %s[%d], sigcntxp %p\n",
-                   p->p_comm, p->p_pid, SCARG(uap, sigcntxp));
+                   p->p_p->ps_comm, p->p_pid, SCARG(uap, sigcntxp));
 #endif
        if ((error = copyin(SCARG(uap, sigcntxp), &ksc, sizeof(ksc))) != 0)
                return (error);
Index: arch/solbourne/solbourne/trap.c
===================================================================
RCS file: /cvs/src/sys/arch/solbourne/solbourne/trap.c,v
retrieving revision 1.17
diff -u -p -r1.17 trap.c
--- arch/solbourne/solbourne/trap.c     31 Dec 2012 06:46:14 -0000      1.17
+++ arch/solbourne/solbourne/trap.c     4 Feb 2014 00:57:44 -0000
@@ -301,7 +301,7 @@ trap(type, psr, pc, tf)
                /* the following message is gratuitous */
                /* ... but leave it in until we find anything */
                printf("%s[%d]: unimplemented software trap 0x%x\n",
-                       p->p_comm, p->p_pid, type);
+                       p->p_p->ps_comm, p->p_pid, type);
                trapsignal(p, SIGILL, type, ILL_ILLOPC, sv);
                break;
 
@@ -388,7 +388,7 @@ trap(type, psr, pc, tf)
 #ifdef DEBUG
                if (rwindow_debug)
                        printf("%s[%d]: rwindow: pcb<-stack: 0x%x\n",
-                               p->p_comm, p->p_pid, tf->tf_out[6]);
+                               p->p_p->ps_comm, p->p_pid, tf->tf_out[6]);
 #endif
                if (read_rw(tf->tf_out[6], &pcb->pcb_rw[0]))
                        sigexit(p, SIGILL);
@@ -410,7 +410,7 @@ trap(type, psr, pc, tf)
 #ifdef DEBUG
                if (rwindow_debug)
                        printf("%s[%d]: rwindow: T_WINUF 0: pcb<-stack: 0x%x\n",
-                               p->p_comm, p->p_pid, tf->tf_out[6]);
+                               p->p_p->ps_comm, p->p_pid, tf->tf_out[6]);
 #endif
                write_user_windows();
                if (rwindow_save(p) || read_rw(tf->tf_out[6], &pcb->pcb_rw[0]))
@@ -418,7 +418,7 @@ trap(type, psr, pc, tf)
 #ifdef DEBUG
                if (rwindow_debug)
                        printf("%s[%d]: rwindow: T_WINUF 1: pcb<-stack: 0x%x\n",
-                               p->p_comm, p->p_pid, pcb->pcb_rw[0].rw_in[6]);
+                               p->p_p->ps_comm, p->p_pid, 
pcb->pcb_rw[0].rw_in[6]);
 #endif
                if (read_rw(pcb->pcb_rw[0].rw_in[6], &pcb->pcb_rw[1]))
                        sigexit(p, SIGILL);
@@ -542,7 +542,7 @@ rwindow_save(p)
                return (0);
 #ifdef DEBUG
        if (rwindow_debug)
-               printf("%s[%d]: rwindow: pcb->stack:", p->p_comm, p->p_pid);
+               printf("%s[%d]: rwindow: pcb->stack:", p->p_p->ps_comm, 
p->p_pid);
 #endif
        do {
 #ifdef DEBUG
Index: arch/sparc/fpu/fpu.c
===================================================================
RCS file: /cvs/src/sys/arch/sparc/fpu/fpu.c,v
retrieving revision 1.13
diff -u -p -r1.13 fpu.c
--- arch/sparc/fpu/fpu.c        26 Nov 2013 20:33:14 -0000      1.13
+++ arch/sparc/fpu/fpu.c        4 Feb 2014 00:57:44 -0000
@@ -143,8 +143,8 @@ fpu_cleanup(p, fs)
 
        case FSR_TT_HWERR:
                log(LOG_ERR, "fpu hardware error (%s[%d])\n",
-                   p->p_comm, p->p_pid);
-               uprintf("%s[%d]: fpu hardware error\n", p->p_comm, p->p_pid);
+                   p->p_p->ps_comm, p->p_pid);
+               uprintf("%s[%d]: fpu hardware error\n", p->p_p->ps_comm, 
p->p_pid);
                trapsignal(p, SIGFPE, -1, FPE_FLTINV, sv);      /* ??? */
                goto out;
 
Index: arch/sparc/sparc/machdep.c
===================================================================
RCS file: /cvs/src/sys/arch/sparc/sparc/machdep.c,v
retrieving revision 1.147
diff -u -p -r1.147 machdep.c
--- arch/sparc/sparc/machdep.c  28 Sep 2013 12:40:32 -0000      1.147
+++ arch/sparc/sparc/machdep.c  4 Feb 2014 00:57:44 -0000
@@ -394,7 +394,7 @@ sendsig(catcher, sig, mask, code, type, 
 #ifdef DEBUG
        if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
                printf("sendsig: %s[%d] sig %d newusp %p scp %p\n",
-                   p->p_comm, p->p_pid, sig, fp, &fp->sf_sc);
+                   p->p_p->ps_comm, p->p_pid, sig, fp, &fp->sf_sc);
 #endif
        /*
         * Now set up the signal frame.  We build it in kernel space
@@ -450,7 +450,7 @@ sendsig(catcher, sig, mask, code, type, 
 #ifdef DEBUG
        if (sigdebug & SDB_FOLLOW)
                printf("sendsig: %s[%d] sig %d scp %p\n",
-                      p->p_comm, p->p_pid, sig, &fp->sf_sc);
+                      p->p_p->ps_comm, p->p_pid, sig, &fp->sf_sc);
 #endif
        /*
         * Arrange to continue execution at the code copied out in exec().
@@ -497,7 +497,7 @@ sys_sigreturn(p, v, retval)
 #ifdef DEBUG
        if (sigdebug & SDB_FOLLOW)
                printf("sigreturn: %s[%d], sigcntxp %p\n",
-                   p->p_comm, p->p_pid, SCARG(uap, sigcntxp));
+                   p->p_p->ps_comm, p->p_pid, SCARG(uap, sigcntxp));
 #endif
        if ((error = copyin(SCARG(uap, sigcntxp), &ksc, sizeof(ksc))) != 0)
                return (error);
Index: arch/sparc/sparc/trap.c
===================================================================
RCS file: /cvs/src/sys/arch/sparc/sparc/trap.c,v
retrieving revision 1.63
diff -u -p -r1.63 trap.c
--- arch/sparc/sparc/trap.c     3 Jun 2013 18:46:02 -0000       1.63
+++ arch/sparc/sparc/trap.c     4 Feb 2014 00:57:44 -0000
@@ -294,7 +294,7 @@ trap(type, psr, pc, tf)
                /* the following message is gratuitous */
                /* ... but leave it in until we find anything */
                printf("%s[%d]: unimplemented software trap 0x%x\n",
-                       p->p_comm, p->p_pid, type);
+                       p->p_p->ps_comm, p->p_pid, type);
                trapsignal(p, SIGILL, type, ILL_ILLOPC, sv);
                break;
 
@@ -381,7 +381,7 @@ trap(type, psr, pc, tf)
 #ifdef DEBUG
                if (rwindow_debug)
                        printf("%s[%d]: rwindow: pcb<-stack: 0x%x\n",
-                               p->p_comm, p->p_pid, tf->tf_out[6]);
+                               p->p_p->ps_comm, p->p_pid, tf->tf_out[6]);
 #endif
                if (read_rw(tf->tf_out[6], &pcb->pcb_rw[0]))
                        sigexit(p, SIGILL);
@@ -403,7 +403,7 @@ trap(type, psr, pc, tf)
 #ifdef DEBUG
                if (rwindow_debug)
                        printf("%s[%d]: rwindow: T_WINUF 0: pcb<-stack: 0x%x\n",
-                               p->p_comm, p->p_pid, tf->tf_out[6]);
+                               p->p_p->ps_comm, p->p_pid, tf->tf_out[6]);
 #endif
                write_user_windows();
                if (rwindow_save(p) || read_rw(tf->tf_out[6], &pcb->pcb_rw[0]))
@@ -411,7 +411,7 @@ trap(type, psr, pc, tf)
 #ifdef DEBUG
                if (rwindow_debug)
                        printf("%s[%d]: rwindow: T_WINUF 1: pcb<-stack: 0x%x\n",
-                               p->p_comm, p->p_pid, pcb->pcb_rw[0].rw_in[6]);
+                               p->p_p->ps_comm, p->p_pid, 
pcb->pcb_rw[0].rw_in[6]);
 #endif
                if (read_rw(pcb->pcb_rw[0].rw_in[6], &pcb->pcb_rw[1]))
                        sigexit(p, SIGILL);
@@ -527,7 +527,7 @@ rwindow_save(p)
                return (0);
 #ifdef DEBUG
        if (rwindow_debug)
-               printf("%s[%d]: rwindow: pcb->stack:", p->p_comm, p->p_pid);
+               printf("%s[%d]: rwindow: pcb->stack:", p->p_p->ps_comm, 
p->p_pid);
 #endif
        do {
 #ifdef DEBUG
Index: arch/sparc64/fpu/fpu.c
===================================================================
RCS file: /cvs/src/sys/arch/sparc64/fpu/fpu.c,v
retrieving revision 1.18
diff -u -p -r1.18 fpu.c
--- arch/sparc64/fpu/fpu.c      26 Nov 2013 20:33:15 -0000      1.18
+++ arch/sparc64/fpu/fpu.c      4 Feb 2014 00:57:44 -0000
@@ -237,8 +237,8 @@ fpu_cleanup(p, fs)
 
        case FSR_TT_HWERR:
                log(LOG_ERR, "fpu hardware error (%s[%d])\n",
-                   p->p_comm, p->p_pid);
-               uprintf("%s[%d]: fpu hardware error\n", p->p_comm, p->p_pid);
+                   p->p_p->ps_comm, p->p_pid);
+               uprintf("%s[%d]: fpu hardware error\n", p->p_p->ps_comm, 
p->p_pid);
                KERNEL_LOCK();
                trapsignal(p, SIGFPE, -1, FPE_FLTINV, sv);      /* ??? */
                KERNEL_UNLOCK();
Index: arch/sparc64/sparc64/machdep.c
===================================================================
RCS file: /cvs/src/sys/arch/sparc64/sparc64/machdep.c,v
retrieving revision 1.149
diff -u -p -r1.149 machdep.c
--- arch/sparc64/sparc64/machdep.c      1 Nov 2013 17:36:19 -0000       1.149
+++ arch/sparc64/sparc64/machdep.c      4 Feb 2014 00:57:44 -0000
@@ -502,7 +502,7 @@ sendsig(catcher, sig, mask, code, type, 
 #ifdef DEBUG
        if (sigdebug & SDB_FOLLOW) {
                printf("sendsig: %s[%d] sig %d scp %p\n",
-                      p->p_comm, p->p_pid, sig, &fp->sf_sc);
+                      p->p_p->ps_comm, p->p_pid, sig, &fp->sf_sc);
        }
 #endif
 
Index: arch/sparc64/sparc64/trap.c
===================================================================
RCS file: /cvs/src/sys/arch/sparc64/sparc64/trap.c,v
retrieving revision 1.78
diff -u -p -r1.78 trap.c
--- arch/sparc64/sparc64/trap.c 2 Apr 2013 13:24:57 -0000       1.78
+++ arch/sparc64/sparc64/trap.c 4 Feb 2014 00:57:44 -0000
@@ -887,7 +887,7 @@ kfault:
 
                if (rv == ENOMEM) {
                        printf("UVM: pid %d (%s), uid %u killed: out of swap\n",
-                              p->p_pid, p->p_comm,
+                              p->p_pid, p->p_p->ps_comm,
                               p->p_cred && p->p_ucred ?
                               p->p_ucred->cr_uid : -1);
                        trapsignal(p, SIGKILL, access_type, SEGV_MAPERR, sv);
Index: arch/vax/vax/trap.c
===================================================================
RCS file: /cvs/src/sys/arch/vax/vax/trap.c,v
retrieving revision 1.48
diff -u -p -r1.48 trap.c
--- arch/vax/vax/trap.c 24 Nov 2013 22:08:25 -0000      1.48
+++ arch/vax/vax/trap.c 4 Feb 2014 00:57:44 -0000
@@ -201,7 +201,7 @@ if(faultdebug)printf("trap accflt type %
                        if (rv == ENOMEM) {
                                printf("UVM: pid %d (%s), uid %u killed: "
                                       "out of swap\n",
-                                      p->p_pid, p->p_comm,
+                                      p->p_pid, p->p_p->ps_comm,
                                       p->p_cred && p->p_ucred ?
                                       p->p_ucred->cr_uid : -1);
                                sig = SIGKILL;
Index: compat/linux/linux_misc.c
===================================================================
RCS file: /cvs/src/sys/compat/linux/linux_misc.c,v
retrieving revision 1.85
diff -u -p -r1.85 linux_misc.c
--- compat/linux/linux_misc.c   23 Jan 2014 04:11:46 -0000      1.85
+++ compat/linux/linux_misc.c   4 Feb 2014 00:57:44 -0000
@@ -1688,7 +1688,7 @@ linux_sys_prctl(struct proc *p, void *v,
                 * do this here in the copyin, so that we don't need to
                 * check on copyout.
                 */
-               max_size = MIN(sizeof(comm), sizeof(p->p_comm));
+               max_size = MIN(sizeof(comm), sizeof(p->p_p->ps_comm));
                error = copyinstr((void *)SCARG(uap, arg2), comm,
                    max_size, NULL);
 
@@ -1706,10 +1706,10 @@ linux_sys_prctl(struct proc *p, void *v,
                }
                if (error)
                        return (error);
-               strlcpy(p->p_comm, comm, sizeof(p->p_comm));
+               strlcpy(p->p_p->ps_comm, comm, sizeof(p->p_p->ps_comm));
                break;
        case LINUX_PR_GET_NAME:
-               strlcpy(comm, p->p_comm, sizeof(comm));
+               strlcpy(comm, p->p_p->ps_comm, sizeof(comm));
                error = copyout(comm, (void *)SCARG(uap, arg2),
                    strlen(comm) + 1);
                break;
Index: miscfs/procfs/procfs_cmdline.c
===================================================================
RCS file: /cvs/src/sys/miscfs/procfs/procfs_cmdline.c,v
retrieving revision 1.10
diff -u -p -r1.10 procfs_cmdline.c
--- miscfs/procfs/procfs_cmdline.c      10 Mar 2012 05:54:28 -0000      1.10
+++ miscfs/procfs/procfs_cmdline.c      4 Feb 2014 00:57:44 -0000
@@ -79,7 +79,7 @@ procfs_docmdline(struct proc *curp, stru
         * ps(1) would display.
         */
        if (P_ZOMBIE(p) || (p->p_flag & P_SYSTEM) != 0) {
-                len = snprintf(arg, PAGE_SIZE, "(%s)", p->p_comm);
+                len = snprintf(arg, PAGE_SIZE, "(%s)", p->p_p->ps_comm);
                 if (uio->uio_offset >= (off_t)len)
                         error = 0;
                 else
Index: miscfs/procfs/procfs_status.c
===================================================================
RCS file: /cvs/src/sys/miscfs/procfs/procfs_status.c,v
retrieving revision 1.15
diff -u -p -r1.15 procfs_status.c
--- miscfs/procfs/procfs_status.c       1 Oct 2013 20:15:56 -0000       1.15
+++ miscfs/procfs/procfs_status.c       4 Feb 2014 00:57:44 -0000
@@ -83,7 +83,7 @@ procfs_stat_gen(struct proc *p, char *s,
        if (s)
                bzero(s, l);
 
-       bcopy(p->p_comm, ps, MAXCOMLEN-1);
+       bcopy(p->p_p->ps_comm, ps, MAXCOMLEN-1);
        ps[MAXCOMLEN] = '\0';
        COUNTORCAT(s, l, ps, n);
 
Index: kern/exec_elf.c
===================================================================
RCS file: /cvs/src/sys/kern/exec_elf.c,v
retrieving revision 1.94
diff -u -p -r1.94 exec_elf.c
--- kern/exec_elf.c     21 Jan 2014 01:48:44 -0000      1.94
+++ kern/exec_elf.c     4 Feb 2014 00:57:44 -0000
@@ -1177,7 +1177,7 @@ ELFNAMEEND(coredump_notes)(struct proc *
                cpi.cpi_egid = p->p_ucred->cr_gid;
                cpi.cpi_svgid = p->p_cred->p_svgid;
 
-               (void)strlcpy(cpi.cpi_name, p->p_comm, sizeof(cpi.cpi_name));
+               strlcpy(cpi.cpi_name, p->p_p->ps_comm, sizeof(cpi.cpi_name));
 
                nhdr.namesz = sizeof("OpenBSD");
                nhdr.descsz = sizeof(cpi);
Index: kern/init_main.c
===================================================================
RCS file: /cvs/src/sys/kern/init_main.c,v
retrieving revision 1.203
diff -u -p -r1.203 init_main.c
--- kern/init_main.c    20 Jan 2014 21:19:27 -0000      1.203
+++ kern/init_main.c    4 Feb 2014 00:57:44 -0000
@@ -286,7 +286,7 @@ main(void *framep)
        p->p_stat = SONPROC;
        pr->ps_nice = NZERO;
        p->p_emul = &emul_native;
-       bcopy("swapper", p->p_comm, sizeof ("swapper"));
+       strlcpy(p->p_p->ps_comm, "swapper", sizeof(p->p_p->ps_comm));
 
        /* Init timeouts. */
        timeout_set(&p->p_sleep_to, endtsleep, p);
Index: kern/kern_acct.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_acct.c,v
retrieving revision 1.27
diff -u -p -r1.27 kern_acct.c
--- kern/kern_acct.c    3 Jun 2013 16:55:22 -0000       1.27
+++ kern/kern_acct.c    4 Feb 2014 00:57:44 -0000
@@ -176,7 +176,7 @@ acct_process(struct proc *p)
         */
 
        /* (1) The name of the command that ran */
-       bcopy(p->p_comm, acct.ac_comm, sizeof acct.ac_comm);
+       bcopy(p->p_p->ps_comm, acct.ac_comm, sizeof acct.ac_comm);
 
        /* (2) The amount of user and system time that was used */
        calctsru(&pr->ps_tu, &ut, &st, NULL);
Index: kern/kern_exec.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_exec.c,v
retrieving revision 1.137
diff -u -p -r1.137 kern_exec.c
--- kern/kern_exec.c    21 Jan 2014 01:48:44 -0000      1.137
+++ kern/kern_exec.c    4 Feb 2014 00:57:44 -0000
@@ -472,9 +472,9 @@ sys_execve(struct proc *p, void *v, regi
        TCB_SET(p, NULL);       /* reset the TCB address */
 
        /* set command name & other accounting info */
-       memset(p->p_comm, 0, sizeof(p->p_comm));
+       memset(p->p_p->ps_comm, 0, sizeof(p->p_p->ps_comm));
        len = min(nid.ni_cnd.cn_namelen, MAXCOMLEN);
-       bcopy(nid.ni_cnd.cn_nameptr, p->p_comm, len);
+       bcopy(nid.ni_cnd.cn_nameptr, p->p_p->ps_comm, len);
        pr->ps_acflag &= ~AFORK;
 
        /* record proc's vnode, for use by procfs and others */
Index: kern/kern_kthread.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_kthread.c,v
retrieving revision 1.33
diff -u -p -r1.33 kern_kthread.c
--- kern/kern_kthread.c 18 Nov 2013 20:21:51 -0000      1.33
+++ kern/kern_kthread.c 4 Feb 2014 00:57:44 -0000
@@ -77,7 +77,7 @@ kthread_create(void (*func)(void *), voi
        atomic_setbits_int(&p->p_flag, P_SYSTEM);
 
        /* Name it as specified. */
-       strlcpy(p->p_comm, name, sizeof p->p_comm);
+       strlcpy(p->p_p->ps_comm, name, sizeof(p->p_p->ps_comm));
 
        /* All done! */
        if (newpp != NULL)
@@ -100,7 +100,7 @@ kthread_exit(int ecode)
         */
        if (ecode != 0)
                printf("WARNING: thread `%s' (%d) exits with status %d\n",
-                   curproc->p_comm, curproc->p_pid, ecode);
+                   curproc->p_p->ps_comm, curproc->p_pid, ecode);
 
        exit1(curproc, W_EXITCODE(ecode, 0), EXIT_NORMAL);
 
Index: kern/kern_ktrace.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_ktrace.c,v
retrieving revision 1.63
diff -u -p -r1.63 kern_ktrace.c
--- kern/kern_ktrace.c  21 Jan 2014 01:48:44 -0000      1.63
+++ kern/kern_ktrace.c  4 Feb 2014 00:57:44 -0000
@@ -125,7 +125,7 @@ ktrinitheader(struct ktr_header *kth, st
        nanotime(&kth->ktr_time);
        kth->ktr_pid = p->p_p->ps_pid;
        kth->ktr_tid = p->p_pid + THREAD_PID_OFFSET;
-       bcopy(p->p_comm, kth->ktr_comm, MAXCOMLEN);
+       bcopy(p->p_p->ps_comm, kth->ktr_comm, MAXCOMLEN);
 }
 
 void
Index: kern/kern_proc.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_proc.c,v
retrieving revision 1.55
diff -u -p -r1.55 kern_proc.c
--- kern/kern_proc.c    20 Jan 2014 21:19:28 -0000      1.55
+++ kern/kern_proc.c    4 Feb 2014 00:57:44 -0000
@@ -397,7 +397,7 @@ proc_printit(struct proc *p, const char 
        else
                pst = pstat[(int)p->p_stat - 1];
 
-       (*pr)("PROC (%s) pid=%d stat=%s\n", p->p_comm, p->p_pid, pst);
+       (*pr)("PROC (%s) pid=%d stat=%s\n", p->p_p->ps_comm, p->p_pid, pst);
        (*pr)("    flags process=%b proc=%b\n",
            p->p_p->ps_flags, PS_BITS, p->p_flag, P_BITS);
        (*pr)("    pri=%u, usrpri=%u, nice=%d\n",
@@ -469,7 +469,7 @@ db_show_all_procs(db_expr_t addr, int ha
 
                                case 'a':
                                        db_printf("%-10.10s  %18p  %18p  
%18p\n",
-                                           p->p_comm, p, p->p_addr, 
p->p_vmspace);
+                                           p->p_p->ps_comm, p, p->p_addr, 
p->p_vmspace);
                                        break;
 
                                case 'n':
@@ -480,11 +480,11 @@ db_show_all_procs(db_expr_t addr, int ha
                                            pr->ps_cred->p_ruid, p->p_stat,
                                            p->p_flag | pr->ps_flags,
                                            (p->p_wchan && p->p_wmesg) ?
-                                               p->p_wmesg : "", p->p_comm);
+                                               p->p_wmesg : "", 
p->p_p->ps_comm);
                                        break;
 
                                case 'w':
-                                       db_printf("%-16s  %-8s  %18p  %s\n", 
p->p_comm,
+                                       db_printf("%-16s  %-8s  %18p  %s\n", 
p->p_p->ps_comm,
                                            p->p_emul->e_name, p->p_wchan,
                                            (p->p_wchan && p->p_wmesg) ? 
                                                p->p_wmesg : "");
Index: kern/kern_sched.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_sched.c,v
retrieving revision 1.30
diff -u -p -r1.30 kern_sched.c
--- kern/kern_sched.c   6 Jun 2013 13:09:37 -0000       1.30
+++ kern/kern_sched.c   4 Feb 2014 00:57:44 -0000
@@ -116,8 +116,8 @@ sched_kthreads_create(void *v)
        atomic_setbits_int(&spc->spc_idleproc->p_flag, P_SYSTEM);
 
        /* Name it as specified. */
-       snprintf(spc->spc_idleproc->p_comm, sizeof(spc->spc_idleproc->p_comm),
-           "idle%d", num);
+       snprintf(spc->spc_idleproc->p_p->ps_comm,
+           sizeof(spc->spc_idleproc->p_p->ps_comm), "idle%d", num);
 
        num++;
 }
Index: kern/kern_sig.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_sig.c,v
retrieving revision 1.157
diff -u -p -r1.157 kern_sig.c
--- kern/kern_sig.c     21 Jan 2014 01:48:44 -0000      1.157
+++ kern/kern_sig.c     4 Feb 2014 00:57:44 -0000
@@ -1451,7 +1451,7 @@ coredump(struct proc *p)
            p->p_rlimit[RLIMIT_CORE].rlim_cur)
                return (EFBIG);
 
-       len = snprintf(name, sizeof(name), "%s%s.core", dir, p->p_comm);
+       len = snprintf(name, sizeof(name), "%s%s.core", dir, p->p_p->ps_comm);
        if (len >= sizeof(name))
                return (EACCES);
 
@@ -1522,7 +1522,7 @@ coredump_trad(struct proc *p, void *cook
        int error;
 
        core.c_midmag = 0;
-       strlcpy(core.c_name, p->p_comm, sizeof(core.c_name));
+       strlcpy(core.c_name, p->p_p->ps_comm, sizeof(core.c_name));
        core.c_nseg = 0;
        core.c_signo = p->p_sisig;
        core.c_ucode = p->p_sitrapno;
@@ -1572,7 +1572,7 @@ coredump_write(void *cookie, enum uio_se
                if (error) {
                        printf("pid %d (%s): %s write of %lu@%p"
                            " at %lld failed: %d\n",
-                           io->io_proc->p_pid, io->io_proc->p_comm,
+                           io->io_proc->p_pid, io->io_proc->p_p->ps_comm,
                            segflg == UIO_USERSPACE ? "user" : "system",
                            len, data, (long long)io->io_offset, error);
                        return (error);
Index: kern/kern_sysctl.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_sysctl.c,v
retrieving revision 1.244
diff -u -p -r1.244 kern_sysctl.c
--- kern/kern_sysctl.c  21 Jan 2014 01:48:44 -0000      1.244
+++ kern/kern_sysctl.c  4 Feb 2014 00:57:45 -0000
@@ -1171,7 +1171,7 @@ fill_file(struct kinfo_file *kf, struct 
                kf->p_uid = pp->p_ucred->cr_uid;
                kf->p_gid = pp->p_ucred->cr_gid;
                kf->p_tid = pp->p_pid + THREAD_PID_OFFSET;
-               strlcpy(kf->p_comm, pp->p_comm, sizeof(kf->p_comm));
+               strlcpy(kf->p_comm, pp->p_p->ps_comm, sizeof(kf->p_comm));
        }
        if (fdp != NULL)
                kf->fd_ofileflags = fdp->fd_ofileflags[fd];
Index: kern/kern_xxx.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_xxx.c,v
retrieving revision 1.23
diff -u -p -r1.23 kern_xxx.c
--- kern/kern_xxx.c     7 Aug 2012 05:16:54 -0000       1.23
+++ kern/kern_xxx.c     4 Feb 2014 00:57:45 -0000
@@ -98,7 +98,7 @@ scdebug_call(struct proc *p, register_t 
             sy->sy_call == sys_nosys))
                return;
                
-       printf("proc %d (%s): %s num ", p->p_pid, p->p_comm, em->e_name);
+       printf("proc %d (%s): %s num ", p->p_pid, p->p_p->ps_comm, em->e_name);
        if (code < 0 || code >= em->e_nsysent)
                printf("OUT OF RANGE (%d)", code);
        else {
@@ -131,7 +131,7 @@ scdebug_ret(struct proc *p, register_t c
            sy->sy_call == sys_nosys))
                return;
                
-       printf("proc %d (%s): %s num ", p->p_pid, p->p_comm, em->e_name);
+       printf("proc %d (%s): %s num ", p->p_pid, p->p_p->ps_comm, em->e_name);
        if (code < 0 || code >= em->e_nsysent)
                printf("OUT OF RANGE (%d)", code);
        else
Index: kern/tty.c
===================================================================
RCS file: /cvs/src/sys/kern/tty.c,v
retrieving revision 1.104
diff -u -p -r1.104 tty.c
--- kern/tty.c  16 Dec 2013 18:46:39 -0000      1.104
+++ kern/tty.c  4 Feb 2014 00:57:45 -0000
@@ -2161,7 +2161,7 @@ ttyinfo(struct tty *tp)
 
                ttyprintf(tp,
                    " cmd: %s %d [%s] %lld.%02ldu %lld.%02lds %d%% %ldk\n",
-                   pick->p_comm, pick->p_pid,
+                   pick->p_p->ps_comm, pick->p_pid,
                    pick->p_stat == SONPROC ? "running" :
                    pick->p_stat == SRUN ? "runnable" :
                    pick->p_wmesg ? pick->p_wmesg : "iowait",
Index: sys/proc.h
===================================================================
RCS file: /cvs/src/sys/sys/proc.h,v
retrieving revision 1.175
diff -u -p -r1.175 proc.h
--- sys/proc.h  4 Feb 2014 00:33:43 -0000       1.175
+++ sys/proc.h  4 Feb 2014 00:57:45 -0000
@@ -205,6 +205,8 @@ struct process {
                u_int   pr_scale;       /* pc scaling */
        } ps_prof;
 
+       char    ps_comm[MAXCOMLEN+1];
+
        u_short ps_acflag;              /* Accounting flags. */
 
 /* End area that is copied on creation. */
@@ -317,7 +319,7 @@ struct proc {
 
        u_char  p_priority;     /* Process priority. */
        u_char  p_usrpri;       /* User-priority based on p_cpu and ps_nice. */
-       char    p_comm[MAXCOMLEN+1];
+       char    p_pad2[2];
 
 #ifndef        __HAVE_MD_TCB
        void    *p_tcb;         /* user-space thread-control-block address */
Index: sys/sysctl.h
===================================================================
RCS file: /cvs/src/sys/sys/sysctl.h,v
retrieving revision 1.139
diff -u -p -r1.139 sysctl.h
--- sys/sysctl.h        22 Oct 2013 16:40:26 -0000      1.139
+++ sys/sysctl.h        4 Feb 2014 00:57:45 -0000
@@ -534,7 +534,7 @@ do {                                                        
                \
        /* XXX depends on e_name being an array and not a pointer */    \
        copy_str((kp)->p_emul, (char *)(p)->p_emul +                    \
            offsetof(struct emul, e_name), sizeof((kp)->p_emul));       \
-       strlcpy((kp)->p_comm, (p)->p_comm, sizeof((kp)->p_comm));       \
+       strlcpy((kp)->p_comm, (p)->p_p->ps_comm, sizeof((kp)->p_comm)); \
        strlcpy((kp)->p_login, (sess)->s_login,                 \
            MIN(sizeof((kp)->p_login), sizeof((sess)->s_login)));       \
                                                                        \

Reply via email to