| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # coding=utf-8 | 2 # coding=utf-8 |
| 3 # Copyright 2012 The LUCI Authors. All rights reserved. | 3 # Copyright 2012 The LUCI Authors. All rights reserved. |
| 4 # Use of this source code is governed by the Apache v2.0 license that can be | 4 # Use of this source code is governed under the Apache License, Version 2.0 |
| 5 # found in the LICENSE file. | 5 # that can be found in the LICENSE file. |
| 6 | 6 |
| 7 """Traces an executable and its child processes and extract the files accessed | 7 """Traces an executable and its child processes and extract the files accessed |
| 8 by them. | 8 by them. |
| 9 | 9 |
| 10 The implementation uses OS-specific API. The native Kernel logger and the ETL | 10 The implementation uses OS-specific API. The native Kernel logger and the ETL |
| 11 interface is used on Windows. Dtrace is used on OSX. Strace is used otherwise. | 11 interface is used on Windows. Dtrace is used on OSX. Strace is used otherwise. |
| 12 The OS-specific implementation is hidden in an 'API' interface. | 12 The OS-specific implementation is hidden in an 'API' interface. |
| 13 | 13 |
| 14 The results are embedded in a Results instance. The tracing is done in two | 14 The results are embedded in a Results instance. The tracing is done in two |
| 15 phases, the first is to do the actual trace and generate an | 15 phases, the first is to do the actual trace and generate an |
| (...skipping 3378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3394 sys.stderr.write(str(e)) | 3394 sys.stderr.write(str(e)) |
| 3395 sys.stderr.write('\n') | 3395 sys.stderr.write('\n') |
| 3396 return 1 | 3396 return 1 |
| 3397 | 3397 |
| 3398 | 3398 |
| 3399 if __name__ == '__main__': | 3399 if __name__ == '__main__': |
| 3400 fix_encoding.fix_encoding() | 3400 fix_encoding.fix_encoding() |
| 3401 tools.disable_buffering() | 3401 tools.disable_buffering() |
| 3402 colorama.init() | 3402 colorama.init() |
| 3403 sys.exit(main(sys.argv[1:])) | 3403 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |