What factors cause variations in user space instruction counts for the same executable run multiple times on the same machine?
Issue
- What factors cause variations in user space instruction counts
perf stat instructions:ufor the same executable run multiple times on the same machine?
# cat testcase.c
#include <stdio.h>
int main(int argc, char* argv[])
{
int i;
for (i = 0; i < 100000000; ++i);
return 0;
}
# for i in {1..10}; do setarch $(uname -m) perf stat -e instructions:u ./testcase; done |& grep instructions
300,075,779 instructions:u # 0.00 insns per cycle
300,075,781 instructions:u # 0.00 insns per cycle
300,075,780 instructions:u # 0.00 insns per cycle
300,075,775 instructions:u # 0.00 insns per cycle
300,075,778 instructions:u # 0.00 insns per cycle
300,075,779 instructions:u # 0.00 insns per cycle
300,075,779 instructions:u # 0.00 insns per cycle
300,075,778 instructions:u # 0.00 insns per cycle
300,075,780 instructions:u # 0.00 insns per cycle
300,075,781 instructions:u # 0.00 insns per cycle
Environment
- Red Hat Enterprise Linux
- perf
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
