Hello everyone, Merry Christmas. I need some advice, I have the following code:
int main() { int k=5000000; int p; int sum=0; for (p=0;p<k;p++) { sum+=p; } return 0; }
When I collect it, I get
main: pushl %ebp movl %esp, %ebp subl $16, %esp movl $5000000, -4(%ebp) movl $0, -12(%ebp) movl $0, -8(%ebp) jmp .L2 .L3: movl -8(%ebp), %eax addl %eax, -12(%ebp) addl $1, -8(%ebp) .L2: movl -8(%ebp), %eax cmpl -4(%ebp), %eax jl .L3 movl $0, %eax leave ret
If I run it through gprof, I get that the main execution is complete, which is quite obvious! However, I want to take another step and find out if there is more L2 or L3. here it is obvious that L3 performed the most. is there still some kind of profiler, emulator, which can give me this data for all the code?
source share