README 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. This is Guppy-PE version 0.1.10
  2. A Python Programming Environment.
  3. CONTENTS
  4. This distribution provides a root package, guppy, with the following
  5. subpackages:
  6. doc Documentation data files: *.html, *.jpg, and help support.
  7. etc Support modules. Contains especially the Glue protocol module.
  8. gsl The Guppy Specification Language implementation. This can
  9. be used to create documents and tests from a common source.
  10. heapy The heap analysis toolset. It can be used to find information
  11. about the objects in the heap and display the information
  12. in various ways.
  13. sets Bitsets and 'nodesets' implemented in C.
  14. The following files are not in packages but on the toplevel:
  15. gsl-mode-0.1.el Emacs mode for GSL
  16. specs/*.gsl Specifications
  17. specs/genguppydoc.py Regenerates the doc/*.html files from specs/*.gsl
  18. REQUIREMENTS
  19. You should have Python 2.3, 2.4, 2.5 or 2.6
  20. To build the system so you can use Heapy, you should have what is
  21. needed to build extension modules from source code. The extension
  22. modules are used not only in Heapy but also in GSL in some
  23. situations. (The test generator uses bitsets to speed up an
  24. algorithm.)
  25. To use the graphical browser, Tkinter is needed.
  26. To use the remote monitor, threading must be available.
  27. INSTALLATION
  28. Extract the files from the .tar.gz file, in Linux for example by:
  29. tar xzf guppy-x.y.z.tar.gz
  30. where x.y.z is the current version number. This will create the
  31. directory guppy-x.y.z . You should then cd into this directory. You
  32. can then compile the extension modules by:
  33. python setup.py build
  34. And to install you can do, for example, as follows to install to the
  35. default location (when you are super-user):
  36. python setup.py install
  37. NOTE that you typically must LEAVE the guppy-x.y.z directory to use
  38. Heapy, since the current directory is usually in the Python search
  39. path, and then Python will find the guppy directory there FIRST and
  40. will NOT find the extension modules. This may be a somewhat common
  41. problem -- so I am noting it here for lack of a suitable fix at the
  42. moment.
  43. I also note that the documentation files and emacs-mode are not
  44. automatically installed.
  45. HEAPY USAGE EXAMPLE
  46. The following example shows
  47. 1. How to create the session context: h=hpy()
  48. 2. How to show the reachable objects in the heap: h.heap()
  49. 3. How to create and show a set of objects: h.iso(1,[],{})
  50. 4. How to show the shortest paths from the root to x: h.iso(x).sp
  51. >>> from guppy import hpy; h=hpy()
  52. >>> h.heap()
  53. Partition of a set of 48477 objects. Total size = 3265516 bytes.
  54. Index Count % Size % Cumulative % Kind (class / dict of class)
  55. 0 25773 53 1612820 49 1612820 49 str
  56. 1 11699 24 483960 15 2096780 64 tuple
  57. 2 174 0 241584 7 2338364 72 dict of module
  58. 3 3478 7 222592 7 2560956 78 types.CodeType
  59. 4 3296 7 184576 6 2745532 84 function
  60. 5 401 1 175112 5 2920644 89 dict of class
  61. 6 108 0 81888 3 3002532 92 dict (no owner)
  62. 7 114 0 79632 2 3082164 94 dict of type
  63. 8 117 0 51336 2 3133500 96 type
  64. 9 667 1 24012 1 3157512 97 __builtin__.wrapper_descriptor
  65. <76 more rows. Type e.g. '_.more' to view.>
  66. >>> h.iso(1,[],{})
  67. Partition of a set of 3 objects. Total size = 176 bytes.
  68. Index Count % Size % Cumulative % Kind (class / dict of class)
  69. 0 1 33 136 77 136 77 dict (no owner)
  70. 1 1 33 28 16 164 93 list
  71. 2 1 33 12 7 176 100 int
  72. >>> x=[]
  73. >>> h.iso(x).sp
  74. 0: h.Root.i0_modules['__main__'].__dict__['x']
  75. >>>
  76. TEST
  77. To test if the heapy build and installation was ok, you can do:
  78. >>> from guppy import hpy
  79. >>> hpy().test()
  80. Testing sets
  81. Test #0
  82. Test #1
  83. Test #2
  84. ...
  85. There will be several more tests. Some tests may take a while.
  86. Caveat 1: Some tests may be somewhat picky, and may have to be relaxed
  87. to pass in different installations.
  88. Caveat 2: All tests don't currently work always in Python 2.7
  89. LICENSE
  90. Copyright (C) 2005 -- 2008 Sverker Nilsson, S. Nilsson Computer System AB
  91. The right is granted to copy, use, modify and redistribute this code
  92. according to the rules in what is commonly referred to as an MIT
  93. license.
  94. *** USE AT YOUR OWN RISK AND BE AWARE THAT THIS IS AN EARLY RELEASE ***
  95. CONTACT INFORMATION
  96. Sverker Nilsson <sn@sncs.se> (Homepage: http://sncs.se)
  97. Guppy-PE homepage: http://guppy-pe.sourceforge.net