From owner-freebsd-current@FreeBSD.ORG Thu May 25 19:53:49 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 56F0816BDF1 for ; Thu, 25 May 2006 19:53:49 +0000 (UTC) (envelope-from jb@what-creek.com) Received: from what-creek.com (what-creek.com [66.111.37.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id E97DF43D6D for ; Thu, 25 May 2006 19:53:48 +0000 (GMT) (envelope-from jb@what-creek.com) Received: by what-creek.com (Postfix, from userid 102) id 77FCD78C1D; Thu, 25 May 2006 19:53:47 +0000 (GMT) Date: Thu, 25 May 2006 19:53:46 +0000 From: John Birrell To: Peter Jeremy Message-ID: <20060525195346.GA25270@what-creek.com> References: <20060525065510.GA20475@what-creek.com> <20060525082633.GA724@turion.vk2pj.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060525082633.GA724@turion.vk2pj.dyndns.org> User-Agent: Mutt/1.4.2.1i Cc: current@freebsd.org Subject: Re: DTrace for FreeBSD - Status Update 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: Thu, 25 May 2006 19:54:02 -0000 On Thu, May 25, 2006 at 06:26:33PM +1000, Peter Jeremy wrote: > I'd like to help but not sure if I have the time. Do you have more > detail on what is needed? Most of the stuff is listed in my to-do list. On the build side, the CTF tools are threaded and I am building them as bootstrap tools because they are required to add the CTF data to objects and programs during a buildworld. Sun's code requires a couple of extra non-standard functions in libpthread. I've added those, but doing so creates an upgrade issue which could be solved either by building libpthread in the bootstrap phase of buildworld (yuk) or by creating stubs with weak symbols in the CTF library to resolve the missing functions during the upgrade. The CTF tools themselves complain about some things in buildworld which result in things not being added to the CTF data. This is pretty simple to debug, but it is time consuming. > BTW, how much of DTrace is MD and what CPU architectures are supported? Most of DTrace is machine independent. Sun's code supports Sparc, i386 and amd68, so it's 64-bit clean and supports both endians. Internally DTrace uses what is known as DTrace Intermediate Format (DIF) which is an interpreted instruction set based on RISC-like instructions. All that code is machine independent and thus easy to get working on other architectures. The place were DTrace is really, really machine dependent is in the trap handling code. DTrace has what it calls 'safe' loads where it goes to read from a memory address which a flag set to stop a panic if a trap occurs during the message access. Also, the Function Boundary Tracing (fbt) provider hooks itself into the code at runtime by replacing certain instructions with an invalid opcode so that it deliberately causes a trap which it then catches to do it's magic. At least that's how it works on i386/amd64. On Sparc it's done differently -- I haven't looked into that yet because I don't have access to a Sparc machine (and to port code that affects trap handling, I really need the machine next to me so that I can crash it frequently 8->). -- John Birrell