Intel VTune

From TracingWiki

Jump to: navigation, search

Contents

[edit] VTune Performance Analyzer

VTune Snapshot

VTune Performance Analyzer is an application profiler for systems based on Intel processors. It supports all language compilers (C, C++, Fortran) that follow industry standards ( ELF, STABS and DWARF). Java and mixed Java are also supported. The Graphical User Interface is based on Eclipse. The VTune analyzer searches for symbol information in the binary file it launches. If it cannot find this information, Vtune disassembles the code and provides static analysis of the basic blocks in the code. VTune can collect information through two methods: sampling and profiling.

[edit] Sampling

VTune conducts non-intrusive sampling and doesn't instrument the binary code. Instead, at regular intervals, it interrupts the processor and collects samples of instruction addresses, one per interrupt. This procedure stops when the application ends or when the specified duration is over or when sampling is manually stopped using the ActivityController. VTune stores 32 bytes per sample in a user configurable sampling buffer. When the buffer is full, VTune suspends sampling temporarily to write the data to the disk. By default, the collected sampling information is stored in $HOME/.VTune directory. The sampling collector has different options that can be configured by the user such as the sampling interval, the sampling buffer size, the delay before sampling starts, the conditions to stop sampling (i.e. sampling time, maximum samples to collect, etc.) Event based sampling can be specified to identify low level performance problems such as cache misses and misdirected branches; By default, the Clockticks and Instructions Retired events are pre-selected. Different processors support different events. Vtune can determine the ones that are supported by the used processor (vtl -help -c sampling). Data collected can be filtered and visualized in three different views: process view, module view and hotspot view. Hotspots indicate sections of code within a module that took a long time to execute. The hotspot view can display hotspots of active functions or active source files in the module. The information can be filtered by process id, CPU number and module name.

[edit] Profiling

Call Graph profiling is used to determine the program flow and the critical path in the program. It counts how many times a function calls another function and determines the time spent in each of them. The Call graph uses the binary instrumentation technique to record timing and call sequence information. By default it instruments all Ring 3 modules used by the application and slowing down its execution. For Java and .NET applications, call graph uses Java Virtual Machine Profiling Interface (JVMPI) and .NET Profiling API to collect performance data. Vtune stores the collected data in a user configurable Call Graph buffer having a default size of 16384 KB. When the buffer is full, VTune suspends the profiling temporarily to write the data to the disk. There are 3 instrumentation levels for the modules that can be configured by the user:

  • "all-functions" instrumentation which is only possible if the selected module has debug information,
  • "exports" level which is used to instrument functions in the module's export table,
  • "minimal" level which instruments the module but does not collect data. It only reports calls from this “unimportant” module to other “important” modules.

For user executables, only all-function and minimal instrumentation levels are possible. Again, data can be visualized in different views such as the process view, thread view, module view, function view, view by call site and the critical path view. The critical path is the most time consuming call sequence. Some of the VTune Timing Information that can computed are the total time spent in a function, the self time (without the time spent in calls to other instrumented function), the time spent in a function (with or without its children) while the thread was suspended, etc.

[edit] References

Personal tools