-pprovides information for prof, and -pgprovides information for gprof.
Let's look at the last one.
It explains how it worksgprof , but let me condense it here.
When routine B is compiled with -pg, some code is inserted at the entry point to the program that looks at which program calls it, for example A. Then it increments a counter saying A is called B.
, , .
-, .
-, , , , , .
, , 100 .
, , , 676 , , " " 6,76 , .
, , , , , , , .
" ".
, , , , , .. .
1982 , - , .