Josef “Jeff” Sipek

PAPI - Getting at Hardware Performance Counters

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.

Imperial man shoots himself in the head while teaching firearm safety

Really, really stupid idea: drinking and teaching gun safety: Imperial man shoots himself in the head while teaching firearm safety.

Note: One of the big safety rules is to never point a gun at people/things you don’t intend to shoot.

Statistical Analysis of OkCupid Users' messages

Hehe, very amusing blog post titled: Online Dating Advice: Exactly What To Say In A First Message. It’s actually made by the folks running OkCupid (I know one, and I suspect that he’s behind this.)

Update: The person I know, admited to doing the statistics. He did real statistics that the blog post didn’t really convey.

Think!

Alright, it ain’t rocket science. When you are trying to decide which filesystem to use, and you see a 7 year old article which talks about people having problems with the fs on Red Hat 7.x (running 2.4.18 kernels), are you going to assume that nothing changed? What if all the developers tell you that things changed? Are you still going to believe the slashdot article? Grrr… No one is forcing you to use this filesystem, so if you believe a 7-year old /. article, then go away and don’t waste the developers’ & others’ time.

Haskell Kernel Modules

Insanity! Someone has made it possible to write kernel modules in Haskell. (FYI, Haskell is a functional language with very strong typing.) Currently, they support only x86, but I wouldn’t be surprised if some other architectures got a port soonish.

IBM Fellows

Today was the second day of classes. During the first lecture for one of the courses I’m taking, the professor did a brief history of the field — starting in 1930’s, and ending in 1970’s. I couldn’t help but notice that he named about 10 people, out of which at least 3 were Wikipedia article: IBM fellows. *grin*

AGM @ Trinity

This past week, Trinity Church (previous post) hosted the AGM.

As a result, the NY Times wrote an article about the event and change ringing.

Neat, I just found out that the ringers at Trinity have a new website.

Star Trek: The Exhibition

Yesterday, with a group of other people, I went to the Star Trek Exhibition at the Detroit Science Center.

Unforunately, photography is not allowed so if you want to see what it sort of looked like, you’ll have to look at the official slideshow.

It was really nice to walk around the bridge of the Enterprise - N C C one seven O one; no bloody A, B, C, or D.

We got a group photo (paid one of course) of the whole bunch of us on the bridge, I might post it when I get a copy of it.

There were plenty of items from all the different series as well as movies - including phasers, tricorders, costumes, ship models, etc., etc.

They had a transporter room (TNG-style), as well as the Guardian (from TOS: The City on the Edge of Forever). We got a group photo with the Guardian as well, I might post it when I get a copy.

Afterwards, we went to see the latest movie in the IMAX they have there. I saw the movie once already (back in May, I think) which was good as some scenes were really hard to follow on such a large screen (e.g., the bar-fight scene).

Overall, it was fun, and if you happen to be near Detroit or Philadelphia you should go and see it before it’s over.

Powered by blahgd