From owner-svn-src-all@FreeBSD.ORG Thu Feb 10 19:06: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 5A1E0106564A; Thu, 10 Feb 2011 19:06:57 +0000 (UTC) (envelope-from rpaulo@me.com) Received: from asmtpout020.mac.com (asmtpout020.mac.com [17.148.16.95]) by mx1.freebsd.org (Postfix) with ESMTP id 3BFF78FC1B; Thu, 10 Feb 2011 19:06:57 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from rui-macbook-pro.apple.com (unknown [17.193.13.39]) by asmtp020.mac.com (Oracle Communications Messaging Exchange Server 7u4-20.01 64bit (built Nov 21 2010)) with ESMTPSA id <0LGE002GDYAUEC60@asmtp020.mac.com>; Thu, 10 Feb 2011 10:06:30 -0800 (PST) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2011-02-10_06:2011-02-10, 2011-02-10, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1012030000 definitions=main-1102100101 From: Rui Paulo In-reply-to: <20110210161325.GA29246@dchagin.static.corbina.ru> Date: Thu, 10 Feb 2011 10:06:29 -0800 Message-id: References: <201008250910.o7P9AWsv005437@svn.freebsd.org> <20110210161325.GA29246@dchagin.static.corbina.ru> To: Chagin Dmitry X-Mailer: Apple Mail (2.1082.1) 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: Thu, 10 Feb 2011 19:06:57 -0000 On Feb 10, 2011, at 8:13 AM, Chagin Dmitry wrote: > 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 >> >> Log: >> Call the necessary DTrace function pointers when we have different kinds >> of traps. >> >> Sponsored by: The FreeBSD Foundation >> >> Modified: >> head/sys/amd64/amd64/trap.c >> head/sys/i386/i386/trap.c >> >> Modified: head/sys/amd64/amd64/trap.c >> ============================================================================== >> --- 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. >> */ >> 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 >> >> extern void trap(struct trapframe *frame); >> @@ -239,6 +246,55 @@ trap(struct trapframe *frame) >> if (dtrace_trap_func != NULL) >> if ((*dtrace_trap_func)(frame, type)) >> goto out; >> + if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || >> + type == T_BPTFLT) { >> + struct reg regs; >> + >> + regs.r_r15 = frame->tf_r15; >> + regs.r_r14 = frame->tf_r14; >> + regs.r_r13 = frame->tf_r13; >> + regs.r_r12 = frame->tf_r12; >> + regs.r_r11 = frame->tf_r11; >> + regs.r_r10 = frame->tf_r10; >> + regs.r_r9 = frame->tf_r9; >> + regs.r_r8 = frame->tf_r8; >> + regs.r_rdi = frame->tf_rdi; >> + regs.r_rsi = frame->tf_rsi; >> + regs.r_rbp = frame->tf_rbp; >> + regs.r_rbx = frame->tf_rbx; >> + regs.r_rdx = frame->tf_rdx; >> + regs.r_rcx = frame->tf_rcx; >> + regs.r_rax = frame->tf_rax; >> + regs.r_rip = frame->tf_rip; >> + regs.r_cs = frame->tf_cs; >> + regs.r_rflags = frame->tf_rflags; >> + regs.r_rsp = frame->tf_rsp; >> + regs.r_ss = frame->tf_ss; >> + if (frame->tf_flags & TF_HASSEGS) { >> + regs.r_ds = frame->tf_ds; >> + regs.r_es = frame->tf_es; >> + regs.r_fs = frame->tf_fs; >> + regs.r_gs = frame->tf_gs; >> + } else { >> + regs.r_ds = 0; >> + regs.r_es = 0; >> + regs.r_fs = 0; >> + regs.r_gs = 0; > > > hi, maybe use fill_regs() would more appropriate here? No, fill_regs() takes a thread as an argument. I all I had was a frame. Regards, -- Rui Paulo