/[escript]/trunk/escript/py_src/__init__.py
ViewVC logotype

Diff of /trunk/escript/py_src/__init__.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2344 by jfenwick, Mon Mar 30 02:13:58 2009 UTC revision 2473 by jfenwick, Mon Jun 15 02:21:07 2009 UTC
# Line 25  from util import * Line 25  from util import *
25  import os  import os
26  import atexit  import atexit
27    
28  def escriptOnExitProfiling():  # To have this function called automatically
29    def escriptLogMemoryStatusNow(prefix='memescript'):
30      if os.name=='posix':      if os.name=='posix':
31      pid=os.getpid()      pid=os.getpid()
32      os.system("cat /proc/%d/status > memescript.%d"%(pid,pid))      os.system("cat /proc/%d/status > %s.%d"%(pid,prefix,pid))
33            
34  if 'escriptExitProfiling' in os.environ:  if 'escriptExitProfiling' in os.environ:
35      atexit.register(escriptOnExitProfiling)      atexit.register(escriptLogMemoryStatusNow)

Legend:
Removed from v.2344  
changed lines
  Added in v.2473

  ViewVC Help
Powered by ViewVC 1.1.26