Upload
lewis-jenkins
View
212
Download
0
Embed Size (px)
Citation preview
®
IBM Software Group
© 2006 IBM Corporation
PurifyPlus on Linux / Unix
Vinay Kumar H S
IBM Software Group | Rational software
Agenda
Introduction
Installation
Components
Usage
IBM Software Group | Rational software
Introduction
Memory debugging: pinpoints hard to find memory errors such as uninitialized
memory access, buffer overflow, and improper freeing of memory
Memory leak detection : identifies memory blocks that no longer have a valid
pointer
Performance profiling: highlights application performance bottlenecks and
improves application understanding with a graphical representation of function
calls
Code coverage: identifies untested code with line-level precision
IBM Software Group | Rational software
Installation
PurifyPlus Installer
- http://www-01.ibm.com/support/docview.wss?&uid=swg21315781
- Need Passport Advantage (PA) Credentials
- Company Primary contact , Technical Contact will have the information
PurifyPlus Licenses
- Need PurifyPlusUNIX Licenses
- Floating , Nodelocked, Named User
IBM Software Group | Rational software
Installation
Setup the License Server
Run rs_install to install the tool
Run Post_Install script
Source the file- purifyplus_setup.sh to set the path
IBM Software Group | Rational software
Purify Usage
Test the sample provided with the installation
Instrumentation could be done in either way
- purify cc -g hello_world.c
- purify cc -g hello_world.o ( cc -c -g hello_world.c)
In make files, as above just append purify at link line
Purify command cannot be used to generate .so or .a
IBM Software Group | Rational software
Purify Usage
purify cc –g hello_world.c
purify –log-file=./sample.log cc –g hello_world.c
purify –view-file=./sampleview.pv cc –g hello_world.c
purify –view sampleview.pv
IBM Software Group | Rational software
Purify Usage
Can suppress messages
Can specify where to suppress the message making the report more meaning full
Can use JIT or the purified output with Debugger
Many Run time , Build Time options exist
IBM Software Group | Rational software
Purify Usage
Purify maintains a table to track the status of each byte of memory used by
your program.
The table contains two bits that represent each byte of memory.
The first bit records whether the corresponding byte has been allocated
The second bit records whether the memory has been initialized.
IBM Software Group | Rational software
Purify Usage
Purify uses these two bits to describe four states of memory:
Red, Yellow, Green, and Blue
Illegal to read, write, or free red and blue memory
Yellow could be written or freed but should not be read
Green could be Read or Written
IBM Software Group | Rational software
IBM Software Group | Rational software
PureCoverage Usage
Helps Identify Untested Code
purecov cc -g hello_world.c
Provides Line Level and Function level Coverage information
Provides option to view annotated source with coverage information
IBM Software Group | Rational software
Pure coverage
Can make Adjustments to get the practical data analysis
Provides option to view the result file on Windows
-view-file-format = both
- .pcv
-view-file-format = windows
- .cfy
IBM Software Group | Rational software
Pure Coverage
Purecoverage script reports
- Coverage Summary Report
- Low Coverage Reports
- Differences Report
http://www.ibm.com/developerworks/rational/library/edge/08/oct08/srivastava_mcvey/index.html
Provides merge option to merge the results
purecov -merge=result.pcv -force-merge a.pcv b.pcv
IBM Software Group | Rational software
Quantify
Quantify Provides the time measure required for the execution of Application,its module, its functions
Quantify uses Object Code Insertion (OCI)technology to count the instructions your program executes and to compute how many cycles they require to execute.
Quantify instruments and reports performance data for all the code in your program, including system and third-party libraries, shared libraries, and statically linked modules.
Quantify times system calls – Wall clock time ( System time)
Since Quantify counts cycles, it gives you accurate data at any scale.
IBM Software Group | Rational software
Quantify Usage
quantify cc -g hello_world.c
Analysis could be done using various kind of information
Function List Window
Function Detail Window
Call Graph Window
Annotated Source Window
IBM Software Group | Rational software
Qunatify Usage
Function List provides the list of function which has its share in the overall time
Function List can be sorted
Function List can be restricted
IBM Software Group | Rational software
Quantify Usage
Call graph provides different functions on the graph with varying line thickness
The thickness of the line is directly proportional to the time taken by that function to execute
Provides an option to focus on specific functions , descendants
IBM Software Group | Rational software
Quantify Usage
The Function Detail window presents detailed performance data for a single function, its contribution to the overall execution of the program
Function + Descendant value could also be calculated
Quantify can display recorded performance data in cycles (the number of
machine cycles) and in microseconds, milliseconds, or seconds
Various scaling levels are possible .00 , .000
IBM Software Group | Rational software
Quantify Usage
The Annotated source window provides the Line wise performance data
The Annotated Source window is available only for files that you
compile using the -g debugging option
Annotations show how function+descendants time was distributed over
its source lines
IBM Software Group | Rational software
Demo
IBM Software Group | Rational software
Questions?
IBM Software Group | Rational software
Thank You !!!