From owner-svn-src-stable-8@FreeBSD.ORG Tue Oct 26 00:21:31 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BB3B106564A; Tue, 26 Oct 2010 00:21:31 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E49B8FC1A; Tue, 26 Oct 2010 00:21:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9Q0LVgc081773; Tue, 26 Oct 2010 00:21:31 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9Q0LVf9081768; Tue, 26 Oct 2010 00:21:31 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010260021.o9Q0LVf9081768@svn.freebsd.org> From: Attilio Rao Date: Tue, 26 Oct 2010 00:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214364 - in stable/8: bin/ps sys/kern sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2010 00:21:31 -0000 Author: attilio Date: Tue Oct 26 00:21:31 2010 New Revision: 214364 URL: http://svn.freebsd.org/changeset/base/214364 Log: MFC r213536 by emaste: Make a thread's address available via the kern proc sysctl, just like the process address. Modified: stable/8/bin/ps/keyword.c stable/8/bin/ps/ps.1 stable/8/sys/kern/kern_proc.c stable/8/sys/sys/user.h Directory Properties: stable/8/bin/ps/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/bin/ps/keyword.c ============================================================================== --- stable/8/bin/ps/keyword.c Tue Oct 26 00:07:58 2010 (r214363) +++ stable/8/bin/ps/keyword.c Tue Oct 26 00:21:31 2010 (r214364) @@ -186,6 +186,8 @@ static VAR var[] = { UINT, UIDFMT, 0}, {"svuid", "SVUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_svuid), UINT, UIDFMT, 0}, + {"tdaddr", "TDADDR", NULL, 0, kvar, NULL, sizeof(void *) * 2, + KOFF(ki_tdaddr), KPTR, "lx", 0}, {"tdev", "TDEV", NULL, 0, tdev, NULL, 5, 0, CHAR, NULL, 0}, {"tdnam", "TDNAM", NULL, LJUST, tdnam, NULL, COMMLEN, 0, CHAR, NULL, 0}, {"time", "TIME", NULL, USER, cputime, NULL, 9, 0, CHAR, NULL, 0}, Modified: stable/8/bin/ps/ps.1 ============================================================================== --- stable/8/bin/ps/ps.1 Tue Oct 26 00:07:58 2010 (r214363) +++ stable/8/bin/ps/ps.1 Tue Oct 26 00:21:31 2010 (r214364) @@ -586,6 +586,8 @@ symbolic process state (alias saved gid from a setgid executable .It Cm svuid saved UID from a setuid executable +.It Cm tdaddr +thread address .It Cm tdev control terminal device number .It Cm time Modified: stable/8/sys/kern/kern_proc.c ============================================================================== --- stable/8/sys/kern/kern_proc.c Tue Oct 26 00:07:58 2010 (r214363) +++ stable/8/sys/kern/kern_proc.c Tue Oct 26 00:21:31 2010 (r214364) @@ -847,6 +847,7 @@ fill_kinfo_thread(struct thread *td, str struct proc *p; p = td->td_proc; + kp->ki_tdaddr = td; PROC_LOCK_ASSERT(p, MA_OWNED); thread_lock(td); Modified: stable/8/sys/sys/user.h ============================================================================== --- stable/8/sys/sys/user.h Tue Oct 26 00:07:58 2010 (r214363) +++ stable/8/sys/sys/user.h Tue Oct 26 00:21:31 2010 (r214364) @@ -85,7 +85,7 @@ */ #define KI_NSPARE_INT 9 #define KI_NSPARE_LONG 12 -#define KI_NSPARE_PTR 7 +#define KI_NSPARE_PTR 6 #ifndef _KERNEL #ifndef KINFO_PROC_SIZE @@ -188,6 +188,7 @@ struct kinfo_proc { struct pcb *ki_pcb; /* kernel virtual addr of pcb */ void *ki_kstack; /* kernel virtual addr of stack */ void *ki_udata; /* User convenience pointer */ + struct thread *ki_tdaddr; /* address of thread */ /* * When adding new variables, take space for pointers from the * front of ki_spareptrs, and longs from the end of ki_sparelongs.