---

Linux.com: Hardware Performance Monitoring For The Masses

Do you or does anyone you know suffer from bloated, slow
code? When you are sleeping, do you dream of the day when you’ll be
able to get your hands on one of those logic analyzers so that some
real performance benchmarking can be done on your programs? Well,
cheer up, because if you own a Pentium Pro or better, you’ve got
performance monitoring hardware just waiting to be fired
up.

“I was working on a project for my school (UAH) a while back and
I had the need to do performance monitoring on some software that I
was writing. While logic analyzers and the such may be more readily
available to some, I was not as fortunate. I had to find a hardware
solution for my problem. After talking with some folks at school, I
found out something that I did not know. Intel has been putting
performance monitoring registers on their processors since the good
Pentium Pro.”

“There are two 40-bit performance monitoring registers, meaning
that only two specific things can be monitored at once. The list of
things that can be monitored with these registers would be too long
to list in this article, but to give you a couple examples: data
memory references, and the number of instructions retired, are
among the many varied things that can be counted. To make use of
these performance monitoring registers in Linux, some people over
at UTK have written the Performance API (PAPI).”

Complete
Story

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis