Experiences and Lessons Learned with a Portable Interface to Hardware Performance Counters