#!/usr/bin/env python

# This script should work in python 2 *or* 3. It loads emar.py, which needs python 2.

from tools.toolchain_profiler import ToolchainProfiler

import sys

if sys.version_info.major == 2:
  if __name__ == '__main__':
    ToolchainProfiler.record_process_start()
    import emar
    emar.run()
    sys.exit(0)
else:
  import os, subprocess
  if __name__ == '__main__':
    sys.exit(subprocess.call(['python2', os.path.join(os.path.dirname(__file__), 'emar.py')] + sys.argv[1:]))
