Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 Feb 2008 13:21:31 +0200
From:      Andrew Pogrebennyk <marduk@portaone.com>
To:        John Birrell <jb@what-creek.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: DTrace/FreeBSD source snapshot
Message-ID:  <47A5A3BB.7010407@portaone.com>
In-Reply-To: <20080202203632.GB96610@what-creek.com>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <machine/frame.h>

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 <sys/kmem.h>
 #include <sys/dtrace_impl.h>
 #include <sys/dtrace_bsd.h>
+#include <machine/frame.h>
 
 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47A5A3BB.7010407>