From owner-svn-src-all@FreeBSD.ORG Fri Feb 11 19:48:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFE4D106566B; Fri, 11 Feb 2011 19:48:56 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 503858FC0C; Fri, 11 Feb 2011 19:48:55 +0000 (UTC) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 69FD2CAC7B; Fri, 11 Feb 2011 22:48:53 +0300 (MSK) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 300151258; Fri, 11 Feb 2011 22:48:50 +0300 Received: from dchagin.static.corbina.ru (localhost [127.0.0.1]) by dchagin.static.corbina.ru (8.14.4/8.14.4) with ESMTP id p1BJmoHu010140; Fri, 11 Feb 2011 22:48:50 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.ru) Received: (from dchagin@localhost) by dchagin.static.corbina.ru (8.14.4/8.14.4/Submit) id p1BJmjE3010139; Fri, 11 Feb 2011 22:48:45 +0300 (MSK) (envelope-from dchagin) Date: Fri, 11 Feb 2011 22:48:45 +0300 From: Chagin Dmitry To: Rui Paulo Message-ID: <20110211194845.GA10131@dchagin.static.corbina.ru> References: <201008250910.o7P9AWsv005437@svn.freebsd.org> <20110210161325.GA29246@dchagin.static.corbina.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tThc/1wpZn/ma/RB" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo Subject: Re: svn commit: r211804 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Feb 2011 19:48:57 -0000 --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 10, 2011 at 10:06:29AM -0800, Rui Paulo wrote: >=20 > On Feb 10, 2011, at 8:13 AM, Chagin Dmitry wrote: >=20 > > On Wed, Aug 25, 2010 at 09:10:32AM +0000, Rui Paulo wrote: > >> Author: rpaulo > >> Date: Wed Aug 25 09:10:32 2010 > >> New Revision: 211804 > >> URL: http://svn.freebsd.org/changeset/base/211804 > >>=20 > >> Log: > >> Call the necessary DTrace function pointers when we have different ki= nds > >> of traps. > >>=20 > >> Sponsored by: The FreeBSD Foundation > >>=20 > >> Modified: > >> head/sys/amd64/amd64/trap.c > >> head/sys/i386/i386/trap.c > >>=20 > >> Modified: head/sys/amd64/amd64/trap.c > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >> --- head/sys/amd64/amd64/trap.c Wed Aug 25 08:49:21 2010 (r211803) > >> +++ head/sys/amd64/amd64/trap.c Wed Aug 25 09:10:32 2010 (r211804) > >> @@ -109,6 +109,13 @@ dtrace_doubletrap_func_t dtrace_doubletr > >> * implementation opaque.=20 > >> */ > >> systrace_probe_func_t systrace_probe_func; > >> + > >> +/* > >> + * These hooks are necessary for the pid, usdt and fasttrap providers. > >> + */ > >> +dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; > >> +dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; > >> +dtrace_return_probe_ptr_t dtrace_return_probe_ptr; > >> #endif > >>=20 > >> extern void trap(struct trapframe *frame); > >> @@ -239,6 +246,55 @@ trap(struct trapframe *frame) > >> if (dtrace_trap_func !=3D NULL) > >> if ((*dtrace_trap_func)(frame, type)) > >> goto out; > >> + if (type =3D=3D T_DTRACE_PROBE || type =3D=3D T_DTRACE_RET || > >> + type =3D=3D T_BPTFLT) { > >> + struct reg regs; > >> + > >> + regs.r_r15 =3D frame->tf_r15; > >> + regs.r_r14 =3D frame->tf_r14; > >> + regs.r_r13 =3D frame->tf_r13; > >> + regs.r_r12 =3D frame->tf_r12; > >> + regs.r_r11 =3D frame->tf_r11; > >> + regs.r_r10 =3D frame->tf_r10; > >> + regs.r_r9 =3D frame->tf_r9; > >> + regs.r_r8 =3D frame->tf_r8; > >> + regs.r_rdi =3D frame->tf_rdi; > >> + regs.r_rsi =3D frame->tf_rsi; > >> + regs.r_rbp =3D frame->tf_rbp; > >> + regs.r_rbx =3D frame->tf_rbx; > >> + regs.r_rdx =3D frame->tf_rdx; > >> + regs.r_rcx =3D frame->tf_rcx; > >> + regs.r_rax =3D frame->tf_rax; > >> + regs.r_rip =3D frame->tf_rip; > >> + regs.r_cs =3D frame->tf_cs; > >> + regs.r_rflags =3D frame->tf_rflags; > >> + regs.r_rsp =3D frame->tf_rsp; > >> + regs.r_ss =3D frame->tf_ss; > >> + if (frame->tf_flags & TF_HASSEGS) { > >> + regs.r_ds =3D frame->tf_ds; > >> + regs.r_es =3D frame->tf_es; > >> + regs.r_fs =3D frame->tf_fs; > >> + regs.r_gs =3D frame->tf_gs; > >> + } else { > >> + regs.r_ds =3D 0; > >> + regs.r_es =3D 0; > >> + regs.r_fs =3D 0; > >> + regs.r_gs =3D 0; > >=20 > >=20 > > hi, maybe use fill_regs() would more appropriate here? >=20 > No, fill_regs() takes a thread as an argument. I all I had was a frame. >=20 ah, can u test http://people.freebsd.org/~dchagin/fillregs.patch, please? thnx :) --=20 Have fun! chd --tThc/1wpZn/ma/RB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAk1VkpwACgkQ0t2Tb3OO/O0VwQCfeY6QKAdESMnqkcDAwyBktCmg 6K8An2olKIVEIm9POlUF/qj6JdQSajOw =g/SO -----END PGP SIGNATURE----- --tThc/1wpZn/ma/RB--