04 Intel VTune Session 05
04 Intel VTune Session 05
Objectives
Ver. 1.0
Slide 1 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
VTune Performance is a powerful and easy-to-use software-analysis tool. It collects, analyses, and displays performance data for a wide variety of applications. It can be used to identify and locate the code snippets in your application that show the highest amount of activity over a specific period. It also displays how an application interacts with the OS or other software, such as drivers.
Ver. 1.0
Slide 2 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
Calculates the actual performance of the system over a period and for Provides a graphical view of the flow of various processor events an application and helps you identify Provides system-level performance critical functions and timing details in the information, such as resource application Provides tuning advice from an analysis consumption, during the execution of an of the performance data. The tuning application Helps the improve area of code that takes adviceidentify helps you performance of the maximum CPU time an application
Ver. 1.0
Slide 3 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
VTune Performance Analyzer provides flexible user interfaces. Using these interfaces, you can manage and organize various windows and analyze views, according to your requirements.
Ver. 1.0
Slide 4 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
Tuning browser The Tuning Browser window displays Menus Output Data view and window : Data toolbars ::views The :Output Menus display window and analysis toolbars displays data provide inmessages various easya list of the of a project. This window enables you to during formats. access data to contents the collection common and commands analysis. of the VTune view the result of activities. The Tuning Browser you window Performance Analyzer. Using these commands, can also enables you to use all the related to the access the information that the activities VTune Performance project. provides. Analyzer
Ver. 1.0
Slide 5 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
Just a minute
Which data view displays all the threads that run within a selected process? Which data view enables you to pinpoint problem areas in the code?
Answer:
Thread view Source view
Ver. 1.0
Slide 6 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
The different wizards available in VTune Performance Analyzer are displayed in the following table.
Name Quick Performance Analysis (QPA) wizard Complete setup wizard Description It enables you to quickly analyze your application's performance. This wizard enables you to create an activity with any combination of sampling, counter monitor, and call graph collectors. It enables you to create an activity and configure multiple collectors at the same time. The wizard prompts you to enter values only for the basic parameters and uses default values for others.
It enables you to create an activity and configure the counter monitor data collector. The wizard prompts you to enter values only for the basic parameters, and uses default values for others.
Ver. 1.0
Slide 7 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
The different wizards available in VTune Performance Analyzer are displayed in the following table.
Name Sampling wizard Description It enables you to create an activity and configure the sampling collector to profile any type of application. The wizard prompts you to enter values for the basic parameters and uses default values for others. It enables you to create an activity and configure the call graph data collector to profile any type of application. The wizard prompts you to enter values for the basic parameters and uses default values for others. It enables you to control all the steps of activity creation and configuration. You can add multiple data collectors and configure them. You can also add application/module profiles to an activity and associate them with any of the data collectors. Use the Advanced Activity Configuration option offers more flexibility in activity creation.
Ver. 1.0
Slide 8 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
Using Sampling
Sampling is the process of collecting a set of data for analysis and representing the analyzed data in statistical format. Sampling enables you to:
Hotspot is the section of code that takes a long time to Bottleneck is the area of code execute. that slows down the execution It consumes a large amount of of the application. processor time. All bottlenecks are hotspots but all hotspots are not bottlenecks.
Ver. 1.0
Slide 9 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
When you perform an activity by using time-based sampling, the VTune Performance Analyzer:
Executes the application you have launched Stops the processor at the sampling interval and collects samples of the specified application Stores sampling data in the buffer. When the buffer is full, it stops sampling. The VTune Performance Analyzer then writes the sampling data to the disk and resumes sampling Continues to collect sampling data until the specified application terminates or the specified sampling duration ends Analyzes the collected data, creates an activity result in the Tuning Browser window, and displays the total data collected for each module
Ver. 1.0
Slide 10 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
Event Based Sampling (EBS) is performed on the processor events. EBS enables you to determine which process, thread, module, function, or code line in the application is generating the largest number of processor events.
Ver. 1.0
Slide 11 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
Sampling over time view shows the threads running during data collection. It displays the samples collected with respect to time for a single event.
Ver. 1.0
Slide 12 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
You can use the Over Time view to gather the following information:
Context switching: Enables you to determine if there is excessive context switching Processor utilization: Enables you to identify which processors are idle at what times Temporal location of hotspots: Enables you to view the specific periods of time when a large number of events occurred Thread interaction: Enables you to view the number of threads in an application but not how they interact with each other
Ver. 1.0
Slide 13 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
Just a minute
Which wizard in sampling allows you to create an Activity and configure the sampling collector to profile any type of application?
Answer:
Sampling wizard
Ver. 1.0
Slide 14 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
Problem Statement:
John has created an application in Java which involves the use of a two-dimensional matrix. However, he finds that his application takes a long time to execute. Therefore, John decides to analyze the performance of the application using the event-based sampling (EBS) feature of VTune Performance Analyzer. Help John accomplish this task.
Ver. 1.0
Slide 15 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
Solution
To analyze the performance of the application using EBS, you need to perform the following tasks:
1. Configure EBS using the Sampling wizard. 2. Analyze sampling results.
Ver. 1.0
Slide 16 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
Summary
Slide 17 of 18
Installing Windows XP Professional Using Attended Installation Code Optimization and Performance Tuning Using Intel VTune
Summary (Contd.)
VTune Performance Analyzer provides flexible user interfaces to manage and organize different windows. Sampling is a process of collecting and testing a set of data for relevant information and presenting the analyzed data in statistical format. Sampling helps you:
Identify hotspots Identify bottlenecks
VTune Performance Analyzer provides two types of sampling mechanisms to collect data. They are: Time-based sampling (TBS): In TBS, the VTune Performance Analyzer collects samples of an activity at regular intervals of time. Event-based sampling (EBS): In EBS, the VTune Performance Analyzer collects samples of an activity at regular intervals of processor event.
Ver. 1.0
Slide 18 of 18