From owner-svn-src-head@freebsd.org Mon Oct 5 21:36:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B47739B92B2; Mon, 5 Oct 2015 21:36:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9969A174; Mon, 5 Oct 2015 21:36:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t95Las9j013245; Mon, 5 Oct 2015 21:36:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t95Las90013244; Mon, 5 Oct 2015 21:36:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201510052136.t95Las90013244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 5 Oct 2015 21:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288902 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2015 21:36:54 -0000 Author: jhb Date: Mon Oct 5 21:36:53 2015 New Revision: 288902 URL: https://svnweb.freebsd.org/changeset/base/288902 Log: Include additional info in ptrace(2) KTR traces: - The new PC value and signal passed to PT_CONTINUE, PT_DETACH, PT_SYSCALL, and PT_TO_SC[EX]. - The system call code returned via PT_LWPINFO. MFC after: 1 week Modified: head/sys/kern/sys_process.c Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Mon Oct 5 21:29:17 2015 (r288901) +++ head/sys/kern/sys_process.c Mon Oct 5 21:36:53 2015 (r288902) @@ -928,25 +928,29 @@ kern_ptrace(struct thread *td, int req, switch (req) { case PT_TO_SCE: p->p_stops |= S_PT_SCE; - CTR2(KTR_PTRACE, - "PT_TO_SCE: pid %d, stops = %#x", p->p_pid, - p->p_stops); + CTR4(KTR_PTRACE, + "PT_TO_SCE: pid %d, stops = %#x, PC = %#lx, sig = %d", + p->p_pid, p->p_stops, + (u_long)(uintfptr_t)addr, data); break; case PT_TO_SCX: p->p_stops |= S_PT_SCX; - CTR2(KTR_PTRACE, - "PT_TO_SCX: pid %d, stops = %#x", p->p_pid, - p->p_stops); + CTR4(KTR_PTRACE, + "PT_TO_SCX: pid %d, stops = %#x, PC = %#lx, sig = %d", + p->p_pid, p->p_stops, + (u_long)(uintfptr_t)addr, data); break; case PT_SYSCALL: p->p_stops |= S_PT_SCE | S_PT_SCX; - CTR2(KTR_PTRACE, - "PT_SYSCALL: pid %d, stops = %#x", p->p_pid, - p->p_stops); + CTR4(KTR_PTRACE, + "PT_SYSCALL: pid %d, stops = %#x, PC = %#lx, sig = %d", + p->p_pid, p->p_stops, + (u_long)(uintfptr_t)addr, data); break; case PT_CONTINUE: - CTR1(KTR_PTRACE, - "PT_CONTINUE: pid %d", p->p_pid); + CTR3(KTR_PTRACE, + "PT_CONTINUE: pid %d, PC = %#lx, sig = %d", + p->p_pid, (u_long)(uintfptr_t)addr, data); break; } break; @@ -969,11 +973,12 @@ kern_ptrace(struct thread *td, int req, proc_reparent(p, pp); if (pp == initproc) p->p_sigparent = SIGCHLD; - CTR2(KTR_PTRACE, - "PT_DETACH: pid %d reparented to pid %d", - p->p_pid, pp->p_pid); + CTR3(KTR_PTRACE, + "PT_DETACH: pid %d reparented to pid %d, sig %d", + p->p_pid, pp->p_pid, data); } else - CTR1(KTR_PTRACE, "PT_DETACH: pid %d", p->p_pid); + CTR2(KTR_PTRACE, "PT_DETACH: pid %d, sig %d", + p->p_pid, data); p->p_oppid = 0; p->p_stops = 0; @@ -1226,10 +1231,10 @@ kern_ptrace(struct thread *td, int req, if (wrap32) ptrace_lwpinfo_to32(pl, pl32); #endif - CTR5(KTR_PTRACE, - "PT_LWPINFO: tid %d (pid %d) event %d flags %#x child pid %d", + CTR6(KTR_PTRACE, + "PT_LWPINFO: tid %d (pid %d) event %d flags %#x child pid %d syscall %d", td2->td_tid, p->p_pid, pl->pl_event, pl->pl_flags, - pl->pl_child_pid); + pl->pl_child_pid, pl->pl_syscall_code); break; case PT_GETNUMLWPS: