Debian Codegraph @

rpython/bin/rpython-vmprof

raw
1 #!/usr/bin/env pypy
2
3 """RPython translation usage:
4
5 rpython <translation options> target <targetoptions>
6
7 run with --help for more information
8 """
9
10 import sys, os
11 sys.path.insert(0, os.path.dirname(os.path.dirname(
12 os.path.dirname(os.path.realpath(__file__)))))
13 from rpython.translator.goal.translate import main
14
15 # no implicit targets
16 if len(sys.argv) == 1:
17 print __doc__
18 sys.exit(1)
19
20 import _vmprof, subprocess
21 x = subprocess.Popen('gzip > vmprof.log.gz', shell=True, stdin=subprocess.PIPE)
22 _vmprof.enable(x.stdin.fileno(), 0.001)
23 try:
24 main()
25 finally:
26 _vmprof.disable()
27 x.stdin.close()
28 x.wait()