How do I 003f




How do I? - GNU gprof














Next: Incompatibilities,
Previous: Inaccuracy,
Up: Top



7 Answers to Common Questions


How can I get more exact information about hot spots in my program?
Looking at the per-line call counts only tells part of the story.
Because gprof can only report call times and counts by function,
the best way to get finer-grained information on where the program
is spending its time is to re-factor large functions into sequences
of calls to smaller ones. Beware however that this can introduce
artificial hot spots since compiling with -pg adds a significant
overhead to function calls. An alternative solution is to use a
non-intrusive profiler, e.g. oprofile.

How do I find which lines in my program were executed the most times?
Use the gcov program.

How do I find which lines in my program called a particular function?
Use gprof -l and lookup the function in the call graph.
The callers will be broken down by function and line number.

How do I analyze a program that runs for less than a second?
Try using a shell script like this one:

for i in `seq 1 100`; do
fastprog
mv gmon.out gmon.out.$i
done

gprof -s fastprog gmon.out.*

gprof fastprog gmon.sum

If your program is completely deterministic, all the call counts
will be simple multiples of 100 (i.e., a function called once in
each run will appear with a call count of 100).







Wyszukiwarka

Podobne podstrony:
how do i set up wds using mikrotik
Byme How do consumers evaluate risk in financial products
Tips Wine Cellar Equipment How Do You Choose
roxette how do you do
(survival text) How do you Live without Electricity
how do you come school
H BlockX How Do You?el
how to do mb sd c4 self test
Matki do pracy, aby opłacić urzędników i… nianie
You Can Do It How to Photograph Water Drops PopPhoto June 2006
Nawigacja jako GPS do laptopa How to(1)
How to Do Viking Chain Knitting
Boardgame how often do you
Do It Yourself How To Make Hash Oil
SPSS how to do
lesson plan how to do it

więcej podobnych podstron