Welcome to graduate2professional.blogspot.com

Sunday, June 24, 2012

What does a Profiler do?

Profiler:
You can analyze the application execution on the target device or Emulator using the Profiler tool.
 The Profiler calculates the application method call count and execution time, and determines the code fragments that take the maximum time to execute.


Recording of summary information during execution
Inclusive, exclusive time, # calls, hardware statistics,
– Reflects performance behavior of program entities
• Functions, loops, basic blocks
• User-defined “semantic” entities
– Very good for low-cost performance assessment
– Helps to expose performance bottlenecks and hotspots


– Implemented through
• Sampling: periodic OS interrupts or hardware counter traps
• Instrumentation: direct insertion of measurement code


This information further helps you to optimize your application code by identifying the bottlenecks in the code blocks.


To use this function, compile the source with debugging enabled so that the source is put into the executable:
gcc example1.c -g -pg -o example1 -O2 –lc
Re-run the application as before:
./example1 50000
Your gprof command is now:
gprof example1 gmon.out -A

No comments:

Post a Comment