Updated for Python 1.5, including my experiences with Purify on
Solaris 2.6 and with a threaded interpreter. I also included my name and email address.
This commit is contained in:
parent
f326134e5c
commit
93374539ad
|
@ -1,32 +1,29 @@
|
|||
Purify (tm) and Quantify (tm) are commercial software quality
|
||||
assurance tools available from Pure Atria Corporation
|
||||
<http://www.pureatria.com/>. Purify is essentially a memory access
|
||||
assurance tools available from Rational Software Corporation
|
||||
<http://www.rational.com/>. Purify is essentially a memory access
|
||||
verifier and leak detector; Quantify is a C level profiler. The rest
|
||||
of this file assumes you generally know how to use Purify and
|
||||
Quantify, and that you have installed valid licenses for these
|
||||
products. If you don't have them installed, you can ignore the
|
||||
products. If you haven't installed such licenses, you can ignore the
|
||||
following since it won't help you a bit!
|
||||
|
||||
You can easily build a Purify or Quantify instrumented version of the
|
||||
Python interpreter by passing the LINKCC variable to the make command
|
||||
Python interpreter by passing the PURIFY variable to the make command
|
||||
at the top of the Python tree:
|
||||
|
||||
make LINKCC='purify gcc'
|
||||
make PURIFY=purify
|
||||
|
||||
This assumes that the `purify' program is on your $PATH, and that you
|
||||
are using gcc as your C compiler. Note that you can't Purify and
|
||||
Quantify the interpreter (or any program) at the same time.
|
||||
This assumes that the `purify' program is on your $PATH. Note that
|
||||
you cannot both Purify and Quantify the Python interpreter (or any
|
||||
program for that matter) at the same time. If you want to build a
|
||||
Quantify'd interpreter, do this:
|
||||
|
||||
Now, just run the interpreter as you normally would. If you're
|
||||
running it in place (i.e. not installed), you may find it helpful to
|
||||
set your PYTHONPATH environment variable. E.g., in Bourne Shell, on a
|
||||
Solaris 2.x machine:
|
||||
|
||||
% PYTHONPATH=./Lib:./Lib/sunos5:./Lib/tkinter:./Modules ./python
|
||||
make PURIFY=quantify
|
||||
|
||||
When running the regression test (make test), I have found it useful
|
||||
to set my PURIFYOPTIONS environment variable using the following shell
|
||||
function. Check out the Purify documentation for details:
|
||||
to set my PURIFYOPTIONS environment variable using the following
|
||||
(bash) shell function. Check out the Purify documentation for
|
||||
details:
|
||||
|
||||
p() {
|
||||
chainlen='-chain-length=12'
|
||||
|
@ -41,9 +38,11 @@ Note that you may want to crank -chain-length up even further. A
|
|||
value of 20 should get you the entire stack up into the Python C code
|
||||
in all situations.
|
||||
|
||||
With the regression test, you'll probably get a gabillion UMR errors,
|
||||
and a few MLK errors. I think most of these can be safely suppressed
|
||||
by putting the following in your .purify file:
|
||||
With the regression test on a fatly configured interpreter
|
||||
(i.e. including as many modules as possible in your Modules/Setup
|
||||
file), you'll probably get a gabillion UMR errors, and a few MLK
|
||||
errors. I think most of these can be safely suppressed by putting the
|
||||
following in your .purify file:
|
||||
|
||||
suppress umr ...; "socketmodule.c"
|
||||
suppress umr ...; time_strftime
|
||||
|
@ -53,9 +52,9 @@ by putting the following in your .purify file:
|
|||
suppress umr ...; "nismodule.c"
|
||||
suppress umr ...; "pwdmodule.c"
|
||||
|
||||
This will still leave you (currently) with a few UMR and MLK reports.
|
||||
For now, don't worry about them. We'll be evaluating these as time
|
||||
goes on, and correcting them as appropriate.
|
||||
This will still leave you with just a few UMR, mostly in the readline
|
||||
library, which you can safely ignore. A lot of work has gone into
|
||||
Python 1.5 to plug as many leaks as possible.
|
||||
|
||||
Using Purify or Quantify in this way will give you coarse grained
|
||||
reports on the whole Python interpreter. You can actually get more
|
||||
|
@ -70,3 +69,13 @@ Using this module, you can actually profile or leak test a small
|
|||
section of code, instead of the whole interpreter. Using this in
|
||||
conjuction with pdb.py, dbx, or the profiler.py module really gives
|
||||
you quite a bit of introspective power.
|
||||
|
||||
Naturally there are a couple of caveats. This has only been tested
|
||||
with Purify 4.0.1 and Quantify 2.1-beta on Solaris 2.5. Purify 4.0.1
|
||||
does not work with Solaris 2.6, but Purify 4.1 which reportedly will,
|
||||
is currently in beta test. There are funky problems when Purify'ing a
|
||||
Python interpreter build with threads. I've had a lot of problems
|
||||
getting this to work, so I generally don't build with threads when I'm
|
||||
Purify'ing. If you get this to work, let us know!
|
||||
|
||||
-Barry Warsaw <bwarsaw@cnri.reston.va.us>
|
||||
|
|
Loading…
Reference in New Issue