Performance Refactoring of Instrumentation, Measurement, and Analysis Technologies for Petascale Computing: The PRIMA Project