Documentation Home
> Analyzing Program Performance With Sun WorkShop
Analyzing Program Performance With Sun WorkShop
Book Information
Preface
Chapter 1 Performance Profiling and Analysis Tools
Sampling Analysis Tools
The Sampling Collector
The Sampling Analyzer
Loop Analysis Tools
LoopTool
LoopReport
Lock Analysis Tool
Traditional Profiling Tools
Chapter 2 The Sampling Analysis Tools
Understanding the Sampling Collector
Using the Sampling Collector
Summary Data
Execution Profile Data
Program Memory Usage: Address Space Data
Collecting Sampling Data
Controlling Profile Frequency
Marking Samples
Breakpoints
New Sample Command
Periodic Sampling
Understanding the Sampling Analyzer
Loading an Experiment
Selecting Data Types for Viewing
Data Types and Display Options
Selecting Display Options
The Overview Display
The Histogram Display
The Cumulative Display
The Address Space Display
Memory Categories
Address Space Display Layout
The Statistics Display
Reordering an Application
Comparing Runtime Experiment Samples
Printing Experiments
Exporting Experiment Data
Chapter 3 Loop Analysis Tools
Basic Concepts
Setting Up Your Environment
Creating a Loop Timing File
Other Compilation Options
Run The Program
Starting LoopTool
Loading a Timing File
Using LoopTool
Opening Files
Creating a Report on All Loops
Printing the LoopTool Graph
Choosing an Editor
Getting Hints and Editing Source Code
Starting LoopReport
Timing File
Fields in the Loop Report
Compiler Hints
0. No Hint Available
1. Loop contains procedure call
2. Compiler generated two versions of this loop
3. The variable(s) "list" cause a data dependency in this loop
4. Loop was significantly transformed during optimization
5. Loop may or may not hold enough work to be profitably parallelized
6. Loop was marked by user-inserted pragma, DOALL
7. Loop contains multiple exits
8. Loop contains I/O, or other function calls, that are not MT safe
9. Loop contains backward flow of control
10. Loop may have been distributed
11. Two or more loops may have been fused
12. Two or more loops may have been interchanged
How Optimization Affects Loops
Inlining
Loop Transformations--Unrolling, Jamming, Splitting, and Transposing
Parallel Loops Nested Inside Serial Loops
Chapter 4 Traditional Profiling Tools
Basic Concepts
Using prof to Generate a Program Profile
Sample prof Output
Using gprof to Generate a Call Graph Profile
Using tcov for Statement-Level Analysis
Compiling for tcov
Creating tcov Profiled Shared Libraries
Locking Files
Errors Reported by tcov Runtime
tcov Enhanced--Statement-level Analysis
Compiling for tcov Enhanced
Creating Profiled Shared Libraries
Locking Files
tcov Directories and Environment Variables
Overriding the Default Definitions
Absolute and Relative Pathnames
TCOVDIR and SUN_PROFDATA_DIR
For -xprofile=tcov
For the tcov Program
Chapter 5 Lock Analysis Tool
Basic Concepts
LockLint Overview
Collecting Information for LockLint
LockLint User Interface
How to Use LockLint
Managing LockLint's Environment
Temporary Files
Makefile Rules
Compiling Code
LockLint Subcommands
Starting and Exiting LockLint
Setting the Tool State
Checking an Application
Program Knowledge Management
Function Management
Variable Management
Lock Management
Analysis of Lock Usage
Post-analysis Queries
Limitations of LockLint
Source Code Annotations
Reasons to Use Source Code Annotations
The Annotations Scheme
Using LockLint NOTEs
NOTE and _NOTE
Where NOTE May Be Used
Where NOTE May Not Be Used
How Data Is Protected
Read-Only Variables
Allowing Unprotected Reads
Hierarchical Lock Relationships
Functions With Locking Side Effects
Single-Threaded Code
Unreachable Code
Lock Order
Variables Invisible to Other Threads
Assuming Variables Are Protected
Assertions Recognized by LockLint
Making Sure All Locks Are Released
Making Sure No Other Threads Are Running
Asserting Lock State
Appendix A LockLint Command Reference
Subcommand Summary
LockLint Naming Conventions
LockLint Subcommands
analyze
LockLint analyze Phases
assert
assert side effect
assert mutex|rwlock protects
assert mutex protects
assert rwlock protects
assert order
assert read only
assert rwlock covers
declare
declare mutex mutexdeclare rwlocks rwlock
declare func_ptr targets func
declare nonreturning func
declare one tag
declare readable var
declare root func
disallow
disallows
exit
files
funcptrs
funcs
funcs [-adehou] func ...
funcs [-adehilou]
funcs [-adehlou] [directly] called by func ...
funcs [-adehlou] [directly] calling func ...
funcs [-adehlou] [directly] reading var ...
funcs [-adehlou] [directly] writing var ...
funcs [-adehlou] [directly] accessing var ...
funcs [-adehlou] [directly] affecting lock ...
funcs [-adehlou] [directly] inverting lock ...
About directly
help
ignore
load
locks
locks [-co] lock ...
locks [-col]
locks [-col] [directly] affected by func ...
locks [-col] [directly] inverted by func ...
members
order
order [lock [lock]]
order summary
pointer calls
reallow
reallows
refresh
restore
save
saves
start
Start Examples
Using the default
Using a pre-written script
Starting up with a specific shell
sym
unassert
vars
vars [-aho] var ...
vars [-ahilo]
vars [-ahlo] protected by lock
vars [-ahlo] [directly] read by func ...
vars [-ahlo] [directly] written by func ...
vars [-ahlo] [directly] accessed by func ...
About directly
Lock Inversions
© 2010, Oracle Corporation and/or its affiliates