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

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

Issue 20535: Include a better sample JSON dataset in traceline. (Closed)
Patch Set: DEPS 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/svgui/startup-release.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/traceline/traceline/scripts/filter_short.py
diff --git a/tools/traceline/traceline/scripts/filter_short.py b/tools/traceline/traceline/scripts/filter_short.py
new file mode 100755
index 0000000000000000000000000000000000000000..9d8466ed1f1a4f92a75369ad23cf057374aebe3f
--- /dev/null
+++ b/tools/traceline/traceline/scripts/filter_short.py
@@ -0,0 +1,23 @@
+# 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.
+
+# This script takes an input JSON, and filters out all system call events that
+# took less than 0.2ms. This helps trim down the JSON data to only the most
+# interesting / time critical events.
+
+import sys
+import re
+
+def parseEvents(z):
+ print 'parseEvents(['
+ for e in z:
+ if e.has_key('ms') and e.has_key('done'):
+ dur = e['done'] - e['ms']
+ if dur < 0.2:
+ continue
+ # Ugly regex to remove the L suffix on large python numbers.
+ print '%s,' % re.sub('([0-9])L\\b', '\\1', str(e))
+ print '])'
+
+execfile(sys.argv[1])
« no previous file with comments | « tools/traceline/svgui/startup-release.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698