cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bensaad.adel
Observer
Observer
5,847 Views
Registered: ‎11-09-2009

measuring the EXECUTION time of the software program !!!!

Jump to solution

i want to measure the EXECUTION time of my software ?

i'm working with the Spartan-3 XC3S200... and EDK 10.1

my system uses only an UARTLITE peripheral to communicate with RS-232 and an MCH EMC peripheral to use the SRAM of my borad.

 

i take a look on the "system.log" file ... i don't found anithing special...

after more research, i found that i need to include a timing device (XPS_TIMER, etc.) in my bitstream, and then use it to time the execution of my program!!!

 

Does anyone have an idea or recommendation to take out the execution time of a program???

Please help with any suggestion, solution or direction !!!
 

Adel.

0 Kudos
1 Solution

Accepted Solutions
bensaad.adel
Observer
Observer
7,435 Views
Registered: ‎11-09-2009

thanks a lot Deepa,

 

i don't have tried profiling before!

but after reading this tutorial, all is more clear now !!!

http://www.xilinx.com/support/documentation/sw_manuals/xilinx11/edk_prof.pdf

 

for those interested in Profiling, it works like this :

 

  • To obtain histogram data, the program is periodically interrupted to obtain a sample

of its program counter location. This user-defined interval is usually measured in
milliseconds. The program counter location helps identify which function was being
executed at that particular sample. Taking multiple samples over a long interval of a
few seconds helps identify which functions execute for the longest time in the
program.

  • To obtain the call graph information, the compiler annotates every function call to

store the caller and callee information in a data structure.

 

The steps involved in profiling are as follows:
1. Compile and link the program for profiling by adding the -pg switch to the gcc
compiler command line.
2. Run the program to generate profile data.
3. Process the profile data obtained from gprof.

 

but The following restrictions apply when profiling in EDK:


• Profiling does not measure the time spent in interrupt handlers because interrupt
handlers typically disable further interrupts from occurring. Therefore, it is
impossible for profiling interrupts to occur when the program is executing an
interrupt handler.
• Profiling can only be done with the standalone platform; it cannot be done in the
presence of an OS. This is because the profiling libraries are only available in the
standalone BSP.
• Recursive functions are not supported.
• If the timer is directly connected to the processor (for example, when there is no
interrupt controller), the software application requires additional setup to support
profiling.
• The call graph for functions inside C and Math libraries (libc and libm) are not
generated because these libraries are not compiled with the -pg compiler profiling
option.
• Ensure that memory used for collecting profile data is not used by any other function
in the application.
• If you are using a custom linker script for PowerPC®, it must include a .vectors
section. This is because profiling is based on interrupts, and using interrupts requires
a .vectors section.
• Profiling cannot be done while debugging. Enable profiling only when selecting the
Run configuration in SDK 

View solution in original post

0 Kudos
2 Replies
deepamj
Adventurer
Adventurer
5,831 Views
Registered: ‎08-19-2009

hi adel

 

have u tried profiling?

 

EDK Profiling User Guide-A Guide to Profiling in EDK-UG448 EDK 11.2  explains the steps

Deepa
bensaad.adel
Observer
Observer
7,436 Views
Registered: ‎11-09-2009

thanks a lot Deepa,

 

i don't have tried profiling before!

but after reading this tutorial, all is more clear now !!!

http://www.xilinx.com/support/documentation/sw_manuals/xilinx11/edk_prof.pdf

 

for those interested in Profiling, it works like this :

 

  • To obtain histogram data, the program is periodically interrupted to obtain a sample

of its program counter location. This user-defined interval is usually measured in
milliseconds. The program counter location helps identify which function was being
executed at that particular sample. Taking multiple samples over a long interval of a
few seconds helps identify which functions execute for the longest time in the
program.

  • To obtain the call graph information, the compiler annotates every function call to

store the caller and callee information in a data structure.

 

The steps involved in profiling are as follows:
1. Compile and link the program for profiling by adding the -pg switch to the gcc
compiler command line.
2. Run the program to generate profile data.
3. Process the profile data obtained from gprof.

 

but The following restrictions apply when profiling in EDK:


• Profiling does not measure the time spent in interrupt handlers because interrupt
handlers typically disable further interrupts from occurring. Therefore, it is
impossible for profiling interrupts to occur when the program is executing an
interrupt handler.
• Profiling can only be done with the standalone platform; it cannot be done in the
presence of an OS. This is because the profiling libraries are only available in the
standalone BSP.
• Recursive functions are not supported.
• If the timer is directly connected to the processor (for example, when there is no
interrupt controller), the software application requires additional setup to support
profiling.
• The call graph for functions inside C and Math libraries (libc and libm) are not
generated because these libraries are not compiled with the -pg compiler profiling
option.
• Ensure that memory used for collecting profile data is not used by any other function
in the application.
• If you are using a custom linker script for PowerPC®, it must include a .vectors
section. This is because profiling is based on interrupts, and using interrupts requires
a .vectors section.
• Profiling cannot be done while debugging. Enable profiling only when selecting the
Run configuration in SDK 

View solution in original post

0 Kudos