Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Mar 2012 02:23:15 +0000 (UTC)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232576 - head/sys/mips/mips
Message-ID:  <201203060223.q262NFEk015017@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jmallett
Date: Tue Mar  6 02:23:15 2012
New Revision: 232576
URL: http://svn.freebsd.org/changeset/base/232576

Log:
  In the trap messages that aid the primitive debugging environment of MIPS,
  include the tid as well, so it's easier to tell which thread of a process
  with multiple is responsible for a crash.

Modified:
  head/sys/mips/mips/trap.c

Modified: head/sys/mips/mips/trap.c
==============================================================================
--- head/sys/mips/mips/trap.c	Mon Mar  5 22:36:50 2012	(r232575)
+++ head/sys/mips/mips/trap.c	Tue Mar  6 02:23:15 2012	(r232576)
@@ -1312,15 +1312,19 @@ log_illegal_instruction(const char *msg,
 	pt_entry_t *ptep;
 	pd_entry_t *pdep;
 	unsigned int *addr;
-	struct proc *p = curproc;
+	struct thread *td;
+	struct proc *p;
 	register_t pc;
 
+	td = curthread;
+	p = td->td_proc;
+
 #ifdef SMP
 	printf("cpuid = %d\n", PCPU_GET(cpuid));
 #endif
 	pc = frame->pc + (DELAYBRANCH(frame->cause) ? 4 : 0);
-	log(LOG_ERR, "%s: pid %d (%s), uid %d: pc %#jx ra %#jx\n",
-	    msg, p->p_pid, p->p_comm,
+	log(LOG_ERR, "%s: pid %d tid %ld (%s), uid %d: pc %#jx ra %#jx\n",
+	    msg, p->p_pid, (long)td->td_tid, p->p_comm,
 	    p->p_ucred ? p->p_ucred->cr_uid : -1,
 	    (intmax_t)pc,
 	    (intmax_t)frame->ra);
@@ -1357,12 +1361,16 @@ log_bad_page_fault(char *msg, struct tra
 	pt_entry_t *ptep;
 	pd_entry_t *pdep;
 	unsigned int *addr;
-	struct proc *p = curproc;
+	struct thread *td;
+	struct proc *p;
 	char *read_or_write;
 	register_t pc;
 
 	trap_type &= ~T_USER;
 
+	td = curthread;
+	p = td->td_proc;
+
 #ifdef SMP
 	printf("cpuid = %d\n", PCPU_GET(cpuid));
 #endif
@@ -1381,8 +1389,8 @@ log_bad_page_fault(char *msg, struct tra
 	}
 
 	pc = frame->pc + (DELAYBRANCH(frame->cause) ? 4 : 0);
-	log(LOG_ERR, "%s: pid %d (%s), uid %d: pc %#jx got a %s fault at %#jx\n",
-	    msg, p->p_pid, p->p_comm,
+	log(LOG_ERR, "%s: pid %d tid %ld (%s), uid %d: pc %#jx got a %s fault at %#jx\n",
+	    msg, p->p_pid, (long)td->td_tid, p->p_comm,
 	    p->p_ucred ? p->p_ucred->cr_uid : -1,
 	    (intmax_t)pc,
 	    read_or_write,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203060223.q262NFEk015017>