From owner-freebsd-current@FreeBSD.ORG Sun Feb 3 11:21:12 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBE4116A41A for ; Sun, 3 Feb 2008 11:21:12 +0000 (UTC) (envelope-from marduk@portaone.com) Received: from bugor.portaone.com (bugor.portaone.com [65.61.203.147]) by mx1.freebsd.org (Postfix) with ESMTP id A2B5B13C442 for ; Sun, 3 Feb 2008 11:21:12 +0000 (UTC) (envelope-from marduk@portaone.com) Received: from drenching.nelson.volia.net ([77.123.135.222] helo=[192.168.178.18]) by bugor.portaone.com (8.11.3/8.11.3) with ESMTP id 1JLcuN-00032i-NM; Sun, 03 Feb 2008 03:21:12 -0800 Message-ID: <47A5A3BB.7010407@portaone.com> Date: Sun, 03 Feb 2008 13:21:31 +0200 From: Andrew Pogrebennyk User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: John Birrell References: <20080201093538.GA83169@what-creek.com> <18339.35979.765504.132672@grasshopper.cs.duke.edu> <20080201223719.GA88460@what-creek.com> <47A4700B.3000001@portaone.com> <20080202203632.GB96610@what-creek.com> In-Reply-To: <20080202203632.GB96610@what-creek.com> Content-Type: multipart/mixed; boundary="------------020105070402040509050909" Cc: freebsd-current@freebsd.org Subject: Re: DTrace/FreeBSD source snapshot X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2008 11:21:12 -0000 This is a multi-part message in MIME format. --------------020105070402040509050909 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit John Birrell wrote: > On Sat, Feb 02, 2008 at 03:28:43PM +0200, Andrew Pogrebennyk wrote: >> In these lines we are trying to case pointer to struct trapframe to >> pointer to u_char like: >> frame->tf_eip += dtrace_instr_size((u_char *) frame->tf_eip); >> What do i do to get it to work? > > Looks like I'm missing: > > #include Thanks. Attached patch summarizes what I've done so far on i386 for compilation to succeed. But one thing remains unresolved: cc1: warnings being treated as errors In file included from /usr/src/sys/modules/dtrace/dtrace/../../../contrib/opensolaris/uts/common/dtrace/dtrace.c:121: /usr/src/sys/modules/dtrace/dtrace/../../../cddl/dev/dtrace/dtrace_debug.c: In function 'dtrace_debug_lock': /usr/src/sys/modules/dtrace/dtrace/../../../cddl/dev/dtrace/dtrace_debug.c:73: warning: implicit declaration of function 'dtrace_cmpset_long' /usr/src/sys/modules/dtrace/dtrace/../../../cddl/dev/dtrace/dtrace_debug.c:73: warning: nested extern declaration of 'dtrace_cmpset_long' *** Error code 1 I see that in dtrace_debug.c definition of dtrace_cmpset_long() is enclosed in #if defined(__amd64__) and there is no such definition for i386. If I make gcc ignore errors, the kernel does not boot: it complains on unresolved symbol 'dtrace_cmpset_long'. -- Sincerely, Andrew Pogrebennyk --------------020105070402040509050909 Content-Type: text/x-patch; name="i386.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="i386.patch" --- sys/cddl/dev/dtrace/dtrace_ioctl.c.ORIG 2008-02-01 05:40:02.000000000 +0200 +++ sys/cddl/dev/dtrace/dtrace_ioctl.c 2008-02-01 19:37:03.000000000 +0200 @@ -291,7 +291,7 @@ mutex_exit(&dtrace_lock); - DTRACE_IOCTL_PRINTF("%s(%d): copyout buffer desc: size %zd drops %lu errors %lu\n",__func__,__LINE__,desc.dtbd_size,(u_long) desc.dtbd_drops,(u_long) desc.dtbd_errors); + DTRACE_IOCTL_PRINTF("%s(%d): copyout buffer desc: size %llu drops %lu errors %lu\n",__func__,__LINE__,desc.dtbd_size,(u_long) desc.dtbd_drops,(u_long) desc.dtbd_errors); /* * Finally, copy out the buffer description. --- sys/cddl/dev/dtrace/i386/dtrace_subr.c.ORIG 2008-01-05 23:57:24.000000000 +0200 +++ sys/cddl/dev/dtrace/i386/dtrace_subr.c 2008-02-02 23:40:25.000000000 +0200 @@ -35,6 +35,7 @@ #include #include #include +#include extern uintptr_t kernelbase; extern uintptr_t dtrace_in_probe_addr; @@ -418,7 +419,7 @@ /* Function to handle DTrace traps during probes. See i386/i386/trap.c */ int -dtrace_trap(struct trapframe *frame) +dtrace_trap(struct trapframe *frame, u_int type) { /* * A trap can occur while DTrace executes a probe. Before --------------020105070402040509050909--