From owner-freebsd-current@FreeBSD.ORG Fri May 26 20:03:28 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 0DA1616A8CD for ; Fri, 26 May 2006 20:03:28 +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 528FF43D62 for ; Fri, 26 May 2006 20:03:24 +0000 (GMT) (envelope-from jb@what-creek.com) Received: by what-creek.com (Postfix, from userid 102) id 2618C78C1D; Fri, 26 May 2006 20:03:23 +0000 (GMT) Date: Fri, 26 May 2006 20:03:22 +0000 From: John Birrell To: Joseph Koshy Message-ID: <20060526200322.GC34554@what-creek.com> References: <20060525065510.GA20475@what-creek.com> <84dead720605260818t7460cd6dp5de7311a1b5edc28@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84dead720605260818t7460cd6dp5de7311a1b5edc28@mail.gmail.com> 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: Fri, 26 May 2006 20:03:36 -0000 On Fri, May 26, 2006 at 08:48:21PM +0530, Joseph Koshy wrote: > >But, I have a naive question. Should this be integrated in > >some way with the hwpmc work of Joseph Koshy since I think it > >could be useful for DTRace to get information from the CPU as > >well. > > Disclaimer: I've only just started reading about DTrace. > > There appear to be two ways to integrate hwpmc and DTrace: > > - Augment the D virtual machine with a primitive that can > read PMC values (e.g.- using RDPMC or RDMSR instructions > on x86 CPUs). Make this primitive available > to scripts for allocating and reading from PMCs (say > a "pmcread()" builtin function). > > This approach would work well with counting mode PMCs > (both process and system-mode counting PMCs) and would > allow PMCs to be read at arbitrary points of time. > > We'll need a way of allocating system-wide & process-mode > PMCs; this could be done in userland (in dtrace(8)). > > - hwpmc(4) can be augmented to be a 'DTrace provider' > allowing D scripts to be run, say when a PC sample is > recorded. Before modifying the virtual machine in FreeBSD's DTrace port, it would be best to discuss this in the "DTrace Community" The Sun guys will guide us on which way they think is appropriate. -- John Birrell