Answer the question
In order to leave comments, you need to log in
How to measure the number of operations performed by the processor during the execution of a certain program with a given algorithm under linux?
Good afternoon, dear ones!
The essence of the problem is this, I developed a program on a powerful desktop computer, everything flies and is generally good. You need to run the same on the microcomputer. To do this, you need to understand what computing power I need on board this microcomputer.
Surely there is some solution that does something like this:
cpu_prof ./mySuperProgram
total cpu operation: 100500
total time: 100ms
Answer the question
In order to leave comments, you need to log in
How to measure the number of operations performed by the processor during the execution of a certain program with a given algorithm under linux?
$ perf stat ls
...
Performance counter stats for 'ls':
2.287765 task-clock # 0.666 CPUs utilized
36 context-switches # 0.016 M/sec
0 cpu-migrations # 0.000 K/sec
283 page-faults # 0.124 M/sec
3,555,075 cycles # 1.554 GHz [67.11%]
2,620,681 stalled-cycles-frontend # 73.72% frontend cycles idle [78.12%]
2,041,963 stalled-cycles-backend # 57.44% backend cycles idle
1,807,743 instructions # 0.51 insns per cycle
# 1.45 stalled cycles per insn
356,700 branches # 155.916 M/sec
14,920 branch-misses # 4.18% of all branches [58.70%]
0.003432740 seconds time elapsed
What is a microcomputer?
You need to understand that if the architecture is the same there, and the binary is the same but just less powerful, then there is generally no difference in MIPS, with the exception of the cost of the operating system.
If the architecture is different, then the binary will be different.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question