Re: calculation of execution time of assembly code in a realtime program with large number of tasks
- From: "Ignacio G.T." <igtorque.remove@xxxxxxxxxxxxxxx>
- Date: Thu, 04 Jan 2007 15:33:39 +0100
Arlet escribió:
John B wrote:If you use a Pentium target, you can use the internal processor's cycle counter, which can be accesed with a pair of protected instructions. I used it when debugging a subtle concurrency problem years ago, and was very handy.
On 04/01/2007 karthikbg wrote:
Hi,Calling 'printf()' at the start and end of 20 lines of assembler is
I have some 20 lines of code in assembly .
I have various tasks running. How to calculate the total time of
execution of the code in assembly alone in Vxworks ?
Since any task might get invoked due to various reasons ,
Is putting one printf that prints the current time at the start of
assmbly and another printf at the end of assmbly code that prints the
current time the only way for caculating the assmbly code execution
time ?
Any other ideas.
Thx in advans,
Karthik Balaguru
meaningless. The execution time of the library code will far exceed
that of the assembler. Use the old method of counting processor cycles
and adding them up. You'll be surprised at how easy it is. If you don't
have access to a pencil and paper then an abacus is quite useful.
I agree. To get the time for longer/more complicated pieces of code,
you can toggle an IO pin at the beginning and end, and use a scope to
measure the time. If the time isn't constant, a digital scope with
infinite persistence is very handy, while trying to exercise all
possible execution paths.
For a software solution, make sure you have an accurate hardware timer,
and take a timestamp at beginning and end, then subtract the values,
and report (through printf, or any other suitable method). Use the same
method to time an empty piece of code to measure the timestamping
overhead.
.
- References:
- calculation of execution time of assembly code in a realtime program with large number of tasks
- From: karthikbg
- Re: calculation of execution time of assembly code in a realtime program with large number of tasks
- From: John B
- Re: calculation of execution time of assembly code in a realtime program with large number of tasks
- From: Arlet
- calculation of execution time of assembly code in a realtime program with large number of tasks
- Prev by Date: Re: Time spent on component search vs. real work?
- Next by Date: Re: Optimizations for embedded systems
- Previous by thread: Re: calculation of execution time of assembly code in a realtime program with large number of tasks
- Next by thread: Re: calculation of execution time of assembly code in a realtime program with large number of tasks
- Index(es):
Relevant Pages
|