| OLD | NEW |
| 1 #!/usr/bin/env python |
| 1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 4 | 5 |
| 5 import sys | 6 import sys |
| 6 import os | 7 import os |
| 7 | 8 |
| 8 execfile(os.path.join( | 9 from syscalls import syscalls |
| 9 os.path.dirname(os.path.join(os.path.curdir, __file__)), | 10 |
| 10 'syscalls.py')) | |
| 11 | 11 |
| 12 def parseEvents(z): | 12 def parseEvents(z): |
| 13 crits = { } | 13 crits = { } |
| 14 calls = { } | 14 calls = { } |
| 15 for e in z: | 15 for e in z: |
| 16 if (e['eventtype'] == 'EVENT_TYPE_ENTER_CS' or | 16 if (e['eventtype'] == 'EVENT_TYPE_ENTER_CS' or |
| 17 e['eventtype'] == 'EVENT_TYPE_TRYENTER_CS' or | 17 e['eventtype'] == 'EVENT_TYPE_TRYENTER_CS' or |
| 18 e['eventtype'] == 'EVENT_TYPE_LEAVE_CS'): | 18 e['eventtype'] == 'EVENT_TYPE_LEAVE_CS'): |
| 19 cs = e['critical_section'] | 19 cs = e['critical_section'] |
| 20 if not crits.has_key(cs): | 20 if not crits.has_key(cs): |
| (...skipping 20 matching lines...) Expand all Loading... |
| 41 raise repr(e) | 41 raise repr(e) |
| 42 tid = tid_stack.pop() | 42 tid = tid_stack.pop() |
| 43 if tid['thread'] != e['thread']: | 43 if tid['thread'] != e['thread']: |
| 44 raise repr(tid) + '--' + repr(e) | 44 raise repr(tid) + '--' + repr(e) |
| 45 | 45 |
| 46 # Critical section left locked? | 46 # Critical section left locked? |
| 47 if tid_stack: | 47 if tid_stack: |
| 48 #raise repr(tid_stack) | 48 #raise repr(tid_stack) |
| 49 pass | 49 pass |
| 50 | 50 |
| 51 execfile(sys.argv[1]) | 51 |
| 52 def main(): |
| 53 execfile(sys.argv[1]) |
| 54 |
| 55 |
| 56 if __name__ == '__main__': |
| 57 main() |
| OLD | NEW |