Profiling (computer programming): Difference between revisions

Content deleted Content added
Instrumentation: merge two sections
Instrumenting profilers: this section merged into next
Line 73:
 
Some of the most commonly used statistical profilers are [[AMD]] [[CodeAnalyst]], [[Apple Inc.]] [[Apple_Developer_Tools#Shark|Shark]] (OSX), [[oprofile]] (Linux){{cn|date=August 2012}}, [[Intel]] [[VTune]] and Parallel Amplifier (part of [[Intel Parallel Studio]]).
 
===Instrumenting profilers===
Some profilers '''instrument''' the target program with additional instructions to collect the required information.
 
[[Instrumenting]] the program can cause changes in the performance of the program, potentially causing inaccurate results and [[heisenbug]]s. Instrumenting will always have some impact on the program execution, typically always slowing it. However, instrumentation can be very specific and be carefully controlled to have a minimal impact. The impact on a particular program depends on the placement of instrumentation points and the mechanism used to capture the trace. Hardware support for trace capture means that on some targets, instrumentation can be on just one [[machine instruction]]. The impact of instrumentation can often be deducted (i.e. eliminated by subtraction) from the results.
 
gprof is an example of a profiler that uses both instrumentation and sampling. Instrumentation is used to gather caller information and the actual timing values are obtained by statistical sampling.
 
===Instrumentation ===