Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Feb 2012 13:27:36 -0500
From:      Ryan Stone <rysto32@gmail.com>
To:        Ivan Voras <ivoras@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Tracking memory, PCI(-E) bus usage?
Message-ID:  <CAFMmRNwbvChac9cv2dXftuLXQxy%2BE63KZ1vMQSXqMqizyRowTw@mail.gmail.com>
In-Reply-To: <ji8cbl$54m$1@dough.gmane.org>
References:  <ji8cbl$54m$1@dough.gmane.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMmRNwbvChac9cv2dXftuLXQxy%2BE63KZ1vMQSXqMqizyRowTw>