If I run my program under perf
on linux, it will easily give me the total count of instructions executed. Is it possible to somehow (maybe also with perf
but that’s not a requirement) get a count of instructions executed, broken down by instruction? e.g. it might look like this (but with presumably many more instructions and much higher numbers)
8 cmp
4 mov
3 jne
2 xor
2 shr
2 ret
2 jb
2 jae
1 movzx
1 jmp
1 inc
1 cmovb
1 add
my motivation is to diff the outputs for two versions of a program as one angle of analyzing performance differences.
1