Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: tools/traceline/traceline/scripts/crit_sec.py

Issue 8678023: Fix python scripts in src/tools/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 #!/usr/bin/env python
2 # Copyright (c) 2011 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
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()
OLDNEW
« no previous file with comments | « tools/traceline/traceline/scripts/alloc.py ('k') | tools/traceline/traceline/scripts/filter_short.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698