Josef “Jeff” Sipek

September 24, 2009

PAPI - Getting at Hardware Performance Counters

Filed under: citi documentation programming — JeffPC @ 23:45

Recently, I wanted to figure out whether or not an application I was analyzing was memory bound or not. While on this quest, I was introduced to Performance Application Programming Interface (PAPI).

There is a rather good HOWTO that shows step-by-step instructions on getting it all running on Debian. The text below is more or less just a short version of that HOWTO, with my thoughts interspersed.

PAPI is a library that hooks into the hardware performance counters, and presents them in a uniform way. Installation is rather simple if you pay attention to the installation instructions.

  1. Get the kernel source
  2. Get the perfctr tarball
  3. Extract the sources, and run the update-kernel script. I really mean this, if you try to be clever and apply the patch by hand, you'll have a broken source tree. (The script runs patch to fixup some existing kernel files, and then it copies a whole bunch of other files into kernel tree.)
  4. Configure, build, install, and reboot into the new kernel
  5. You can modprobe perfctr and see spew in dmesg

That's it for perfctr. Now PAPI itself...

  1. Get & extract the source
  2. ./configure, make, make fulltest, make install-all

That's it for PAPI. The make fulltest will run the tests. Chances are that they will all either pass or all fail. If they fail, then something is wrong (probably with perfctr). If they pass, then you are all set.

There are some examples in the src/examples directory. Those should get you started with using PAPI. It takes about 100 lines of C to get an arbitrary counter going.

Some other time, I'll talk more about PAPI, and how I used it in my experiments.

June 6, 2009

Extracting RPMs and DEBs

Filed under: sysadmin documentation — JeffPC @ 18:14

Every so often I needed to extract a .deb package manually. Usually I ended up installing Midnight Commander, and used it to copy the contents out. This time around, I did some search, and found a straight forward description how to do it for .debs and .rpms.

RPM

rpm2cpio mypackage.rpm | cpio -vid

DEB

ar vx mypackage.deb
tar -xzvf data.tar.gz

or

ar p mypackage.deb data.tar.gz | tar zx

April 15, 2009

HOWTO: Installing CentOS 4.x under z/VM

Filed under: programming programming/mainframes documentation — JeffPC @ 02:33

I guess I should mention it here...

Almost 6 months ago, I wrote up another howto: Installing CentOS 4.x under z/VM (the first one being Installing Debian under Hercules).

September 13, 2007

IPL This!

Filed under: programming programming/mainframes documentation — JeffPC @ 03:52

I finally managed to find few minutes (well, about 2.5 hours) to write down and test my first howto. It is about...*drumroll*...Installing Debian under Hercules.

For those of you who don't know, Hercules is an emulator for the System/360, 370, 390, and zSeries IBM mainframes.

Have fun, and let me know if you have any suggestions how I could improve the howto.

Powered by a pile of c