Skip to content

Commit

Permalink
Add PID to the OIL_TIMING trace.
Browse files Browse the repository at this point in the history
Also get rid of unused 'libc' import.  Thinking about PyPy.
  • Loading branch information
Andy Chu committed Oct 5, 2017
1 parent a239109 commit ce06499
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion bin/oil.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
# Uncomment this to see startup time problems.
if os.environ.get('OIL_TIMING'):
def tlog(msg):
print('%.3f' % ((time.time() - start_time) * 1000), msg)
pid = os.getpid() # TODO: Maybe remove PID later.
print('[%d] %.3f %s' % (pid, (time.time() - start_time) * 1000, msg))
else:
def tlog(msg):
pass
Expand Down Expand Up @@ -450,6 +451,8 @@ def main(argv):
except RuntimeError as e:
print('FATAL: %s' % e, file=sys.stderr)
sys.exit(1)
finally:
tlog('Exiting main()')


if __name__ == '__main__':
Expand Down
2 changes: 0 additions & 2 deletions core/word_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import re
import sys

import libc

from core import braces
from core import expr_eval
from core import glob_
Expand Down

0 comments on commit ce06499

Please sign in to comment.