Profiling (computer programming): Difference between revisions

Content deleted Content added
m Use of profilers: -</code> +{{quotation}}
Statistical profilers: only flat profilers sample a program counter. In fact of those mentioned only gprof does.
Line 68:
 
===Statistical profilers===
Some profilers operate by [[Sampling (statistics)|sampling]]. A sampling profiler probes the target program's [[programcall counterstack]] at regular intervals using [[operating system]] [[interrupt]]s. Sampling profiles are typically less numerically accurate and specific, but allow the target program to run at near full speed.
 
The resulting data are not exact, but a statistical approximation. "The actual amount of error is usually more than one sampling period. In fact, if a value is n times the sampling period, the expected error in it is the square-root of n sampling periods." <ref>[http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html#SEC12 Statistical Inaccuracy of <tt>gprof</tt> Output]</ref>
Line 76:
Still, kernel code to handle the interrupts entails a minor loss of CPU cycles, diverted cache usage, and is unable to distinguish the various tasks occurring in uninterruptible kernel code (microsecond-range activity).
 
Dedicated hardware can go beyond this: ARM Cortex-M3 and some recent MIPS processors JTAG interface have a PCSAMPLE register, which samples the [[program counter]] in a truly undetectable manner, allowing non-intrusive collection of a flat profile.
 
Some of the most commonly used statistical profilers are [[AMD]] [[CodeAnalyst]], [[Apple Inc.]] [[Apple Developer Tools#Shark|Shark]] (OSX), [[oprofile]] (Linux){{citation needed|date=August 2012}}, [[Intel]] [[VTune]] and Parallel Amplifier (part of [[Intel Parallel Studio]]), [[Oracle Corporation|Oracle]] [[Performance Analyzer]].<ref>{{cite conference |last1=Schmidl |first1=Dirk |first2=Christian |last2=Terboven |first3=Dieter |last3=an Mey |first4=Matthias S. |last4=Müller |title=Suitability of Performance Tools for OpenMP Task-Parallel Programs |conference=Proc. 7th Int'l Workshop on Parallel Tools for High Performance Computing |year=2013 |pages=25–37 |url=https://books.google.com/books?id=-I64BAAAQBAJ&pg=PA27&lpg=PA27}}</ref>