From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 24 18:27:38 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 338D7106566C; Fri, 24 Feb 2012 18:27:38 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 98F498FC16; Fri, 24 Feb 2012 18:27:37 +0000 (UTC) Received: by wibhn14 with SMTP id hn14so2445250wib.13 for ; Fri, 24 Feb 2012 10:27:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=pokfPHEr9zknM6CJVJNmpHNliyVa7Gbniw/P9UVHdMs=; b=x9sOPA1/7hffZQj2NUwVM1IU+WuKzOSrstXAn7WQC4YK/GzRBFkmFw0HT9hVymLgQ5 zx+FwBDeuRRqwIZS2auxweJm2I7txE2MeUsLFPS4cScs1fcFoPLcaE9ressxtgOKnWdX fanE1ZOUfu4LfUo6zgMxcm3FNLvCsM2rqFHvc= MIME-Version: 1.0 Received: by 10.180.80.35 with SMTP id o3mr6134932wix.5.1330108056520; Fri, 24 Feb 2012 10:27:36 -0800 (PST) Received: by 10.180.75.41 with HTTP; Fri, 24 Feb 2012 10:27:36 -0800 (PST) In-Reply-To: References: Date: Fri, 24 Feb 2012 13:27:36 -0500 Message-ID: From: Ryan Stone To: Ivan Voras Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: Tracking memory, PCI(-E) bus usage? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2012 18:27:38 -0000 I can't help you with PCI bandwidth usage(and personally I'd be very interested in being able to measure that), but I do know that Nehalem-based Intel Core i7s (and presumably more recent Intel CPUs) export PMCs for measuring memory bandwidth utilization. The PMCs for the Core i7 are: QMC_BUSY.WRITE.CH0 QMC_BUSY.READ.CH0 QMC_BUSY.WRITE.CH1 QMC_BUSY.READ.CH1 QMC_BUSY.WRITE.CH2 QMC_BUSY.READ.CH2 You can divide these by UCLOCK to get the percent utilization. If you hate doing math by hand I've written a simple curses-based utility for measuring PMC statistics like this: https://code.google.com/p/perfdb/ It outputs stats like this: Memory Channel Utilization: (hotkey m) GQ_Write_Nonempty: 0.11 GQ_To_L3_Busy: 0.00 GQ_To_QPI_Busy: 0.00 GQ_To_Core_Busy: 0.00 Chan0_Util_Write: 0.01 Chan0_Util_Read: 0.03 Chan1_Util_Write: 0.00 Chan1_Util_Read: 0.03 Chan2_Util_Write: 0.00 Chan2_Util_Read: 0.00 It's still very much a work in progress and there's zero documentation for it(hint: the left and right arrow keys are used to cycle between pages of stats, and the q key quits) but I thought that I'd mention it.