GitHub - vmprof/vmprof-python at b8a237cc8bdfa06f9e2c09cdf1740865f950d82e · GitHub
Skip to content

Latest commit

 

History

263 Commits

Folders and files

Repository files navigation

VMprof Python client

Build Status on TravisCI Build Status on TeamCity Read The Docs

See https://vmprof.readthedocs.org for up to date info

basic usage:

sudo apt-get install python-dev libdwarf-dev libelfg0-dev libunwind8-dev

pip install vmprof

python -m vmprof

vmprofshow

vmprofshow is a command line tool that comes with VMprof which can read profile files generated by VMprof and produce a nicely formatted output.

Here is an example of how to use:

Run a smallish program which burns CPU cycles (with vmprof enabled):

pypy test/cpuburn.py

This will produce a profile file vmprof_cpuburn.dat.

Now display the profile:

vmprofshow vmprof_cpuburn.dat

You will see a (colored) output:

oberstet@thinkpad-t430s:~/scm/vmprof-python$ vmprofshow vmprof_cpuburn.dat
100.0%  <module>  100.0%  tests/cpuburn.py:1
100.0% .. test  100.0%  tests/cpuburn.py:35
100.0% .... burn  100.0%  tests/cpuburn.py:26
 99.2% ...... _iterate  99.2%  tests/cpuburn.py:19
 97.7% ........ _iterate  98.5%  tests/cpuburn.py:19
 22.9% .......... _next_rand  23.5%  tests/cpuburn.py:14
 22.9% ............ JIT code  100.0%  0x7fa7dba57a10
 74.7% .......... JIT code  76.4%  0x7fa7dba57a10
  0.1% .......... JIT code  0.1%  0x7fa7dba583b0
  0.5% ........ _next_rand  0.5%  tests/cpuburn.py:14
  0.0% ........ JIT code  0.0%  0x7fa7dba583b0

About

vmprof - a statistical program profiler

Topics

Resources

Stars

439 stars

Watchers

12 watching

Forks

Releases

Packages

Used by

Contributors

Languages