diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 805ac93f09b7..be6ffff93a69 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -208,7 +208,7 @@ trap(struct trapframe *frame) if (ISPL(frame->tf_cs) == SEL_UPL) printf( "pid %ld (%s): trap %d with interrupts disabled\n", - (long)curproc->p_pid, curproc->p_comm, type); + (long)curproc->p_pid, curthread->td_name, type); else if (type != T_NMI && type != T_BPTFLT && type != T_TRCTRAP) { /* @@ -681,8 +681,8 @@ trap_fatal(frame, eva) printf("current process = "); if (curproc) { printf("%lu (%s)\n", - (u_long)curproc->p_pid, curproc->p_comm ? - curproc->p_comm : ""); + (u_long)curproc->p_pid, curthread->td_name ? + curthread->td_name : ""); } else { printf("Idle\n"); } diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 14f01d33162f..637dedb17b9d 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -227,7 +227,7 @@ trap(struct trapframe *frame) if (ISPL(frame->tf_cs) == SEL_UPL || (frame->tf_eflags & PSL_VM)) printf( "pid %ld (%s): trap %d with interrupts disabled\n", - (long)curproc->p_pid, curproc->p_comm, type); + (long)curproc->p_pid, curthread->td_name, type); else if (type != T_BPTFLT && type != T_TRCTRAP && frame->tf_eip != (int)cpu_switch_load_gs) { /* @@ -852,7 +852,7 @@ trap_fatal(frame, eva) printf("IOPL = %d\n", (frame->tf_eflags & PSL_IOPL) >> 12); printf("current process = "); if (curproc) { - printf("%lu (%s)\n", (u_long)curproc->p_pid, curproc->p_comm); + printf("%lu (%s)\n", (u_long)curproc->p_pid, curthread->td_name); } else { printf("Idle\n"); } diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 619be4c89521..947a51606495 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -1155,12 +1155,12 @@ __elfN(puthdr)(struct thread *td, void *dst, size_t *off, int numsegs) if (dst != NULL) { psinfo->pr_version = PRPSINFO_VERSION; psinfo->pr_psinfosz = sizeof(elf_prpsinfo_t); - strlcpy(psinfo->pr_fname, p->p_comm, sizeof(psinfo->pr_fname)); + strlcpy(psinfo->pr_fname, td->td_name, sizeof(psinfo->pr_fname)); /* * XXX - We don't fill in the command line arguments properly * yet. */ - strlcpy(psinfo->pr_psargs, p->p_comm, + strlcpy(psinfo->pr_psargs, td->td_name, sizeof(psinfo->pr_psargs)); } __elfN(putnote)(dst, off, "FreeBSD", NT_PRPSINFO, psinfo, diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index ab7ca8b41206..4c5a730218dc 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -764,7 +764,7 @@ fork_exit(callout, arg, frame) KASSERT(p->p_state == PRS_NORMAL, ("executing process is still new")); CTR4(KTR_PROC, "fork_exit: new thread %p (kse %p, pid %d, %s)", - td, td->td_sched, p->p_pid, p->p_comm); + td, td->td_sched, p->p_pid, td->td_name); sched_fork_exit(td); /* @@ -792,7 +792,7 @@ fork_exit(callout, arg, frame) */ if (p->p_flag & P_KTHREAD) { printf("Kernel thread \"%s\" (pid %d) exited prematurely.\n", - p->p_comm, p->p_pid); + td->td_name, p->p_pid); kproc_exit(0); } mtx_assert(&Giant, MA_NOTOWNED); diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 4e5a63c11b0a..96f3da4442f8 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -280,7 +280,7 @@ ktr_getrequest(int type) microtime(&req->ktr_header.ktr_time); req->ktr_header.ktr_pid = p->p_pid; req->ktr_header.ktr_tid = td->td_tid; - bcopy(p->p_comm, req->ktr_header.ktr_comm, MAXCOMLEN + 1); + bcopy(td->td_name, req->ktr_header.ktr_comm, MAXCOMLEN + 1); req->ktr_buffer = NULL; req->ktr_header.ktr_len = 0; } else { diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index ad797c1edca3..9d0249785314 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -179,7 +179,7 @@ _sleep(ident, lock, priority, wmesg, timo) sleepq_lock(ident); CTR5(KTR_PROC, "sleep: thread %ld (pid %ld, %s) on %s (%p)", - td->td_tid, p->p_pid, p->p_comm, wmesg, ident); + td->td_tid, p->p_pid, td->td_name, wmesg, ident); DROP_GIANT(); if (lock != NULL && !(class->lc_flags & LC_SLEEPABLE)) { @@ -272,7 +272,7 @@ msleep_spin(ident, mtx, wmesg, timo) sleepq_lock(ident); CTR5(KTR_PROC, "msleep_spin: thread %ld (pid %ld, %s) on %s (%p)", - td->td_tid, p->p_pid, p->p_comm, wmesg, ident); + td->td_tid, p->p_pid, td->td_name, wmesg, ident); DROP_GIANT(); mtx_assert(mtx, MA_OWNED | MA_NOTRECURSED); @@ -415,7 +415,7 @@ mi_switch(int flags, struct thread *newtd) PCPU_INC(cnt.v_swtch); PCPU_SET(switchticks, ticks); CTR4(KTR_PROC, "mi_switch: old thread %ld (kse %p, pid %ld, %s)", - td->td_tid, td->td_sched, p->p_pid, p->p_comm); + td->td_tid, td->td_sched, p->p_pid, td->td_name); #if (KTR_COMPILE & KTR_SCHED) != 0 if (TD_IS_IDLETHREAD(td)) CTR3(KTR_SCHED, "mi_switch: %p(%s) prio %d idle", @@ -444,7 +444,7 @@ mi_switch(int flags, struct thread *newtd) td, td->td_name, td->td_priority); CTR4(KTR_PROC, "mi_switch: new thread %ld (kse %p, pid %ld, %s)", - td->td_tid, td->td_sched, p->p_pid, p->p_comm); + td->td_tid, td->td_sched, p->p_pid, td->td_name); /* * If the last thread was exiting, finish cleaning it up. diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index bf6dec27164a..e1a27a5ae4c9 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -393,7 +393,7 @@ thread_exit(void) PROC_LOCK_ASSERT(p, MA_OWNED); KASSERT(p != NULL, ("thread exiting without a process")); CTR3(KTR_PROC, "thread_exit: thread %p (pid %ld, %s)", td, - (long)p->p_pid, p->p_comm); + (long)p->p_pid, td->td_name); KASSERT(TAILQ_EMPTY(&td->td_sigqueue.sq_list), ("signal pending")); #ifdef AUDIT diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index 8642d144b1c2..edf93707d6bf 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -382,7 +382,7 @@ sleepq_catch_signals(void *wchan) mtx_assert(&sc->sc_lock, MA_OWNED); MPASS(wchan != NULL); CTR3(KTR_PROC, "sleepq catching signals: thread %p (pid %ld, %s)", - (void *)td, (long)p->p_pid, p->p_comm); + (void *)td, (long)p->p_pid, td->td_name); mtx_unlock_spin(&sc->sc_lock); diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 2a45e7d10980..355faf2dec40 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -79,7 +79,7 @@ userret(struct thread *td, struct trapframe *frame) struct proc *p = td->td_proc; CTR3(KTR_SYSC, "userret: thread %p (pid %d, %s)", td, p->p_pid, - p->p_comm); + td->td_name); #ifdef DIAGNOSTIC /* Check that we called signotify() enough. */ PROC_LOCK(p); diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index c46bf94294a5..a24a188415e2 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -2016,7 +2016,7 @@ DB_SHOW_COMMAND(alllocks, db_witness_list_all) if (!witness_thread_has_locks(td)) continue; db_printf("Process %d (%s) thread %p (%d)\n", p->p_pid, - p->p_comm, td, td->td_tid); + td->td_name, td, td->td_tid); witness_list(td); } } diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c index 2418044d066c..b691a65b8129 100644 --- a/sys/powerpc/aim/trap.c +++ b/sys/powerpc/aim/trap.c @@ -156,7 +156,7 @@ trap(struct trapframe *frame) sig = 0; user = frame->srr1 & PSL_PR; - CTR3(KTR_TRAP, "trap: %s type=%s (%s)", p->p_comm, + CTR3(KTR_TRAP, "trap: %s type=%s (%s)", td->td_name, trapname(type), user ? "user" : "kernel"); if (user) { @@ -401,7 +401,7 @@ syscall(struct trapframe *frame) } else error = 0; - CTR5(KTR_SYSC, "syscall: p=%s %s(%x %x %x)", p->p_comm, + CTR5(KTR_SYSC, "syscall: p=%s %s(%x %x %x)", td->td_name, syscallnames[code], frame->fixreg[FIRSTARG], frame->fixreg[FIRSTARG+1], @@ -426,7 +426,7 @@ syscall(struct trapframe *frame) error = (*callp->sy_call)(td, params); AUDIT_SYSCALL_EXIT(error, td); - CTR3(KTR_SYSC, "syscall: p=%s %s ret=%x", p->p_comm, + CTR3(KTR_SYSC, "syscall: p=%s %s ret=%x", td->td_name, syscallnames[code], td->td_retval[0]); } switch (error) { diff --git a/sys/powerpc/powerpc/trap.c b/sys/powerpc/powerpc/trap.c index 2418044d066c..b691a65b8129 100644 --- a/sys/powerpc/powerpc/trap.c +++ b/sys/powerpc/powerpc/trap.c @@ -156,7 +156,7 @@ trap(struct trapframe *frame) sig = 0; user = frame->srr1 & PSL_PR; - CTR3(KTR_TRAP, "trap: %s type=%s (%s)", p->p_comm, + CTR3(KTR_TRAP, "trap: %s type=%s (%s)", td->td_name, trapname(type), user ? "user" : "kernel"); if (user) { @@ -401,7 +401,7 @@ syscall(struct trapframe *frame) } else error = 0; - CTR5(KTR_SYSC, "syscall: p=%s %s(%x %x %x)", p->p_comm, + CTR5(KTR_SYSC, "syscall: p=%s %s(%x %x %x)", td->td_name, syscallnames[code], frame->fixreg[FIRSTARG], frame->fixreg[FIRSTARG+1], @@ -426,7 +426,7 @@ syscall(struct trapframe *frame) error = (*callp->sy_call)(td, params); AUDIT_SYSCALL_EXIT(error, td); - CTR3(KTR_SYSC, "syscall: p=%s %s ret=%x", p->p_comm, + CTR3(KTR_SYSC, "syscall: p=%s %s ret=%x", td->td_name, syscallnames[code], td->td_retval[0]); } switch (error) {