Si le compilateur le permet, utiliser le profiling
-p
Generate extra code to write profile information suitable for the analysis program prof.
-pg
Generate extra code to write profile information suitable for the analysis program gprof.
-a
Generate extra code to write profile information for basic blocks, which will record the number of times each basic block is executed. This data could be analyzed by a program like tcov. Note, however, that the format of the data is not what tcov expects. Eventually GNU gprof should be extended to process this data.
-ax
Generate extra code to read basic block profiling parameters from file `bb.in' and write profiling results to file `bb.out'. `bb.in' contains a list of functions. Whenever a function on the list is entered, profiling is turned on. When the outmost function is left, profiling is turned off. If a function name is prefixed with `-' the function is excluded from profiling. If a function name is not unique it can be disambiguated by writing `/path/filename.d:functionname'. `bb.out' will list some available filenames. Four function names have a special meaning: `__bb_jumps__' will cause jump frequencies to be written to `bb.out'. `__bb_trace__' will cause the sequence of basic blocks to be piped into `gzip' and written to file `bbtrace.gz'. `__bb_hidecall__' will cause call instructions to be excluded from the trace. `__bb_showret__' will cause return instructions to be included in the trace.