Jamie Gennis | 9279147 | 2012-03-05 17:33:58 -0800 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
Zhen Wang | 46b43bf | 2015-08-28 09:54:29 -0700 | [diff] [blame] | 3 | # Copyright (c) 2015 The Chromium Authors. All rights reserved. |
Jamie Gennis | 4b56a2b | 2012-04-28 01:06:56 -0700 | [diff] [blame] | 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
Jamie Gennis | 9279147 | 2012-03-05 17:33:58 -0800 | [diff] [blame] | 6 | |
Zhen Wang | 46b43bf | 2015-08-28 09:54:29 -0700 | [diff] [blame] | 7 | import os |
Brent Austin | c0555cc | 2015-05-14 14:05:59 -0700 | [diff] [blame] | 8 | import sys |
Jamie Gennis | 9279147 | 2012-03-05 17:33:58 -0800 | [diff] [blame] | 9 | |
Zhen Wang | 46b43bf | 2015-08-28 09:54:29 -0700 | [diff] [blame] | 10 | version = sys.version_info[:2] |
| 11 | if version != (2, 7): |
| 12 | sys.stderr.write('Systrace does not support Python %d.%d. ' |
| 13 | 'Please use Python 2.7.\n' % version) |
Brent Austin | c0555cc | 2015-05-14 14:05:59 -0700 | [diff] [blame] | 14 | sys.exit(1) |
| 15 | |
Zhen Wang | 46b43bf | 2015-08-28 09:54:29 -0700 | [diff] [blame] | 16 | systrace_dir = os.path.abspath( |
Chris Craik | be1f909 | 2016-03-28 13:54:49 -0700 | [diff] [blame] | 17 | os.path.join(os.path.dirname(__file__), 'catapult', 'systrace')) |
Zhen Wang | 46b43bf | 2015-08-28 09:54:29 -0700 | [diff] [blame] | 18 | sys.path.insert(0, systrace_dir) |
Chris Craik | be1f909 | 2016-03-28 13:54:49 -0700 | [diff] [blame] | 19 | |
Chris Craik | a23c9e9 | 2016-08-19 14:42:29 -0700 | [diff] [blame] | 20 | from systrace import run_systrace |
Brent Austin | 6975e31 | 2015-05-14 13:27:45 -0700 | [diff] [blame] | 21 | |
Jamie Gennis | 9279147 | 2012-03-05 17:33:58 -0800 | [diff] [blame] | 22 | if __name__ == '__main__': |
Chris Craik | a23c9e9 | 2016-08-19 14:42:29 -0700 | [diff] [blame] | 23 | sys.exit(run_systrace.main()) |