Profiling Concurrent Programs Using Hardware Counters