From owner-freebsd-current@FreeBSD.ORG Mon Mar 17 04:13:03 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 887C4106564A for ; Mon, 17 Mar 2008 04:13:03 +0000 (UTC) (envelope-from jkoshy.freebsd@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by mx1.freebsd.org (Postfix) with ESMTP id 256E98FC17 for ; Mon, 17 Mar 2008 04:13:02 +0000 (UTC) (envelope-from jkoshy.freebsd@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so4541738fgg.35 for ; Sun, 16 Mar 2008 21:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:to:cc:subject:in-reply-to:references:user-agent:mime-version:content-type:from:date:sender; bh=34pKYJg0NLHfGWN/4N4v3OxI3PR43uGKrfjcEl8Hlws=; b=WGlbHrW3p9s6f2LcrdoNbZLhO5VJxVJp5+stMuePpRNHW1zzSh9eWxRZ0+tivfWAjm13xCMlfprYDEFBsiLkTWGD0UVKBh2mmF2ahWpfb2pqIK7O/TYmJ9CJn7zholGkdxh62kdhv8NdwuXtzfwKuyi0u0fW+NK2dpkFUvP2tlc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:to:cc:subject:in-reply-to:references:user-agent:mime-version:content-type:from:date:sender; b=HyO/cLWGKbSp/1uYZbANYjWv5gR0hlRAie1cDJd5yI136EquhL49Ay+gt+PrxKeAK/i6xsF3e+TsBwtmj+6yTS/PpvvljGsMh3TCXrigAY58fAKu/7KvS0sRaRYF23hnC8y9nW8fXT1I6WJJeN+NghFk6FtDuOhI8/LF3NetJTk= Received: by 10.82.118.2 with SMTP id q2mr35240772buc.27.1205725733563; Sun, 16 Mar 2008 20:48:53 -0700 (PDT) Received: from moria.unixconsulting.co.in ( [203.145.156.9]) by mx.google.com with ESMTPS id b17sm9029255fka.4.2008.03.16.20.47.08 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Mar 2008 20:48:52 -0700 (PDT) Message-ID: <867ig2pr5j.wl%koshy@unixconsulting.co.in> To: "Adrian Chadd" In-Reply-To: References: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.7 Emacs/21.3 (amd64--freebsd) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII From: Joseph Koshy Date: Mon, 17 Mar 2008 03:38:35 -0000 Sender: Joseph Koshy Cc: jkoshy@freebsd.org, current@freebsd.org Subject: Re: issues with hwpmc and athlon XP 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: Mon, 17 Mar 2008 04:13:03 -0000 > It seems that at least my revision of the Athlon XP has 48 bit > performance counters (AMD Athlon Processor x86 Code Optimisation > Guide, page 235 (Performance-Monitoring Counters: Overview) and the > top 16 bits read back 0x0000. Good catch. > Since the code is taking the 2's compliment of the stored PMC value > (which is so the value is incremented to 0xffffffffffffffff and wraps > over, generating an NMI - mentioned on page 240), negating the value > gives humerous results: Thank you for the bug report and for the analysis in kern/121660. It so happens that the Athlon XP machine I purchased had one of those BIOSes that do not enable the local APIC. So I couldn't get those PMCs to deliver an interrupt and wasn't able to test sampling on this processor. That was frustrating, especially since Linux 2.4 and later can override the BIOS and use the LAPIC; we can't. Onto debugging this bug: my first question is: does system sampling (i.e.. pmcstat -S) work OK on this CPU? > (Oh and whilst I'm at it; maybe some documentation relating to your > pmc debugging features would be nice. :) Uhhh. Well, its just scaffolding around printf(9) and is fairly commented in hwpmc_mod.c. You've already figured out most of the stuff anyhow :). Ask me in private mail if you want any more detail. I don't know where else to document it; surely its not something worth adding to the hwpmc.4 manual page :). Regards, Koshy