Profiling Cloud Applications with Hardware Performance Counters