From owner-freebsd-current@FreeBSD.ORG Thu Feb 23 15:43:04 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 362BC16A420; Thu, 23 Feb 2006 15:43:04 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id BED5443D48; Thu, 23 Feb 2006 15:43:03 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.13.4/8.13.4) with ESMTP id k1NFh2JX020091 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Feb 2006 10:43:02 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id k1NFgugu096283; Thu, 23 Feb 2006 10:42:56 -0500 (EST) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17405.55296.628193.915218@grasshopper.cs.duke.edu> Date: Thu, 23 Feb 2006 10:42:56 -0500 (EST) To: Robert Watson In-Reply-To: <20060223153135.C9642@fledge.watson.org> References: <20060223143856.O9642@fledge.watson.org> <17405.53911.686306.362353@grasshopper.cs.duke.edu> <20060223153135.C9642@fledge.watson.org> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Cc: current@FreeBSD.org Subject: Re: The sixty second pmc howto 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, 23 Feb 2006 15:43:04 -0000 Robert Watson writes: > > On Thu, 23 Feb 2006, Andrew Gallatin wrote: > > > Robert Watson writes: > > > > > (2) Run "pmcstat -S instructions -O /tmp/sample.out" to start sampling of > > > instruction retirement events, saving the results to /tmp/sample.out. > > > > Dumb question, but what does "instructions" really mean? The number of > > instructions, the time spent executing them, ? > > pmcstat magically translates 'instructions' into 'p4-instr-retired', which > might well refer to what happens to an instruction when it is believed to have > successfully executed. Presumably this happens once you know it hasn't been > mispredicted, etc, but I'm sure someone can give a better and more detailed > answer. Let's say it takes 1000 cycles to issue a memory load because of a cache miss, and 1 cycle to increment something already in a register. Let's also say that your program does each operation the same number of times. Does the 'instructions' count each operation identically so both operations appear to cost the same, or is it sampled from some clock interrupt, so that the memory load (correctly) shows up 1000 times more often? For what its worth, I tend to use k8-bu-cpu-clk-unhalted because my gut feeling is that it probably gives the latter behaviour. Drew