Codeanalyst User's Manual Codeanalyst User's Manual
Total Page:16
File Type:pdf, Size:1020Kb
CodeAnalyst User's Manual CodeAnalyst User's Manual Publication: 26833 Revision 1.2 Publication date : April 2012 Copyright © 2003-2012 Advanced Micro Devices, Inc. All rights reserved. Disclaimers The contents of this documentation are provided in connection with Advanced Micro Devices, Inc. ("AMD") products. AMD makes no representations or warranties with respect to the accuracy or completeness of the contents of this publication. The information contained herein may be of a preliminary or advance nature and is subject to change without notice. No license, whether express, implied, arising by estoppel or otherwise, to any intellectual property rights is granted by this publication. Except as set forth in AMD's Standard Terms and Conditions of Sale, AMD assumes no liability whatsoever and disclaims any express or implied warranty, relating to its products including, but not limited to, the implied warranty of merchantability, fitness for a particular purpose, or infringement of any intellectual property right. AMD's products are not designed, intended, authorized or warranted for use as components in systems intended for surgical implant into the body, or in other applications intended to support or sustain life, or in any other application in which the failure of AMD's product could create a situation where personal injury, death, or severe property or environmental damage may occur. AMD reserves the right to discontinue or make changes to its products at any time without notice. Trademarks AMD, the AMD Arrow logo, AMD Athlon, AMD Opteron, and combinations thereof, and 3DNow! are trademarks of Advanced Micro Devices, Inc. HyperTransport is a licensed trademark of the HyperTransport Technology Consortium. Linux is a registered trademark of Linus Torvalds. Microsoft, Windows, and Windows Vista are registered trademarks of Microsoft Corporation. MMX is a trademark of Intel Corporation. Other product names used in this publication are for identification purposes only and may be trademarks of their respective companies. Table of Contents 1. Introduction ................................................................................................................... 1 1.1. Overview ............................................................................................................ 1 1.1.1. Preparing an Application for Profiling ........................................................... 1 1.1.2. Compiling with the GNU GCC Compiler ....................................................... 1 2. Features ........................................................................................................................ 2 2.1. Overview of AMD CodeAnalyst ............................................................................. 2 2.1.1. Program Performance Tuning ....................................................................... 2 2.1.2. Types of Analysis ...................................................................................... 2 2.1.3. Flexible, System-Wide Data Collection .......................................................... 3 2.1.4. Summarized Results with Drill-down ............................................................. 3 2.1.5. Graphical User Interface .............................................................................. 3 2.1.6. Projects and Sessions .................................................................................. 3 2.1.7. Basic Steps for Analysis ............................................................................. 4 2.2. Exploring the Workspace and GUI .......................................................................... 4 2.2.1. Projects Panel ............................................................................................ 4 2.2.2. Status Bar ................................................................................................. 4 2.2.3. Toolbars ................................................................................................... 5 2.2.4. Floating and Docking Toolbar Groups ........................................................... 5 2.2.5. Menus, Tools, and Icons ............................................................................. 6 2.2.6. File Menu and File Icons ............................................................................ 6 2.2.7. Profile Menu and Toolbar Icon Group ........................................................... 7 2.2.8. Tools Menu and Icons ................................................................................ 8 2.2.9. Windows Menu ......................................................................................... 9 2.2.10. Help Menu ............................................................................................ 11 2.2.11. Data and Source Display .......................................................................... 12 2.2.12. Code Density Chart ................................................................................. 16 2.2.13. Session Settings ...................................................................................... 17 2.2.14. Edit Event Configuration ......................................................................... 17 2.2.15. View Management Dialog Box ................................................................. 18 2.2.16. Configuration Management Dialog Box ...................................................... 19 2.2.17. CodeAnalyst Options Dialog Box .............................................................. 20 2.2.18. Profiling Java Applications ....................................................................... 21 2.3. CodeAnalyst Options ........................................................................................... 21 2.3.1. General Tab ............................................................................................ 22 2.3.2. Directories Tab ........................................................................................ 25 2.4. Event Counter Multiplexing .................................................................................. 26 2.4.1. Example of Event Counter Multiplexing ....................................................... 26 2.5. Importing Profile Data into CodeAnalyst ................................................................. 27 2.5.1. Import Local Profiling ............................................................................... 29 2.5.2. Import Remote Profiling ............................................................................ 32 2.5.3. Import CodeAnalyst Session Directory ......................................................... 33 2.5.4. Import Opreport's XML Output Files ........................................................... 34 2.6. Exporting Profile Data from CodeAnalyst ............................................................... 34 2.7. Session Settings .................................................................................................. 37 2.7.1. Setting Templates ..................................................................................... 37 2.7.2. General Tab ............................................................................................ 37 2.7.3. Advance Tab ........................................................................................... 39 2.7.4. Note Tab ................................................................................................ 41 2.7.5. OProfiled Log .......................................................................................... 41 2.7.6. Changing the CPU Affinity ........................................................................ 42 2.7.7. Process Filter ........................................................................................... 46 iii CodeAnalyst User's Manual 2.8. CodeAnalyst and OProfile .................................................................................... 47 2.8.1. Profiling with OProfile Command-Line Utilities ............................................. 48 2.8.2. Importing and Viewing Profile Data ............................................................ 52 2.8.3. OProfile Daemon/Driver Monitoring Tool ..................................................... 52 3. Types of Analysis ......................................................................................................... 54 3.1. Types of Analysis ............................................................................................... 54 3.2. Time-Based Profiling Analysis .............................................................................. 54 3.2.1. How Time-Based Profiling Works ............................................................... 56 3.2.2. Sampling Period and Measurement Period .................................................... 56 3.2.3. Predefined Profile Configurations ................................................................ 57 3.3. Event-Based Profiling Analysis ............................................................................. 57 3.3.1. How Event-Based Profiling Works .............................................................. 59 3.3.2. Sampling Period and Measurement Period .................................................... 59 3.3.3. Event Multiplexing ................................................................................... 59 3.3.4. Predefined Profile Configurations ................................................................ 60 3.4. Instruction-Based Sampling Analysis .....................................................................