Hands-On High Performance Programming with Qt 5
上QQ阅读APP看书,第一时间看更新

External counters

To provide insight into low-level processor behavior, CPU manufacturers added some support for the measuring of performance directly on the chip. For example, Intel processors are equipped with dedicated hardware known as Performance Monitoring Units (PMUs). There's a dedicated PMU on each core, and optionally, an additional uncore PMU collecting data about resources shared between cores. The PMU exposes event counters that can be read by a kernel driver and exported to the user space. Specialized profilers such as Intel's VTune Amplifier XE read these counters periodically to obtain performance data while they are profiling an application. Operating systems also define performance counters and events, which can be used for the performance analysis of applications as well.