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

Unified Diff: tools/traceline/traceline/scripts/scstats.py

Issue 20494: Import Traceline, a Windows performance trace event logger. (Closed)
Patch Set: Feedback. Created 11 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/traceline/traceline/scripts/heap.js ('k') | tools/traceline/traceline/scripts/syscalls.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/traceline/traceline/scripts/scstats.py
diff --git a/tools/traceline/traceline/scripts/scstats.py b/tools/traceline/traceline/scripts/scstats.py
new file mode 100755
index 0000000000000000000000000000000000000000..21f28d846a8843fc23f9a829bdb6e8ee34a441a9
--- /dev/null
+++ b/tools/traceline/traceline/scripts/scstats.py
@@ -0,0 +1,26 @@
+# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import sys
+
+execfile(os.path.join(
+ os.path.dirname(os.path.join(os.path.curdir, __file__)),
+ 'syscalls.py'))
+
+def parseEvents(z):
+ calls = { }
+ for e in z:
+ if e['eventtype'] == 'EVENT_TYPE_SYSCALL' and e['done'] > 0:
+ delta = e['done'] - e['ms']
+ syscall = e['syscall']
+ tid = e['thread']
+ ms = e['ms']
+ calls[syscall] = calls.get(syscall, 0) + delta
+ print '%f - %f - %x - %d %s' % (
+ delta, ms, tid, syscall, syscalls.get(syscall, 'unknown'))
+
+ #for syscall, delta in calls.items():
+ # print '%f - %d %s' % (delta, syscall, syscalls.get(syscall, 'unknown'))
+
+execfile(sys.argv[1])
« no previous file with comments | « tools/traceline/traceline/scripts/heap.js ('k') | tools/traceline/traceline/scripts/syscalls.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698