This is an old revision of the document!
Perf's stat tool has an option that can measure the cost of SMIs (–smi-cost (–no-metric-only)) if the necessary MSRs exist on the CPU. This option can be used to determine the average number of cycles per SMI which were spent handling the SMIs that occurred during the measurement period. This Perf option is available as of the 4.13 linux kernel and will only work on recent Intel x86 processors.
On Debian, Perf can be installed using the package manager via the linux-perf package.
Because of how the average SMI duration is calculated, it is important to make sure that the CPU never goes idle while Perf is taking measurements.
Give an example of a command that uses it?
Discuss different ways to present the results? –no-metric-only versus percentage
If the average number of cycles per SMI is above a few microseconds, then SMI handling could be taking more time than it should.
Because the tool only provides the average time taken to resolve SMIs during a certain period, the results should be interpreted carefully.