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

Side by Side Diff: tools/gc_nvp_common.py

Issue 1175113008: [tools] Add gc-nvp-to-csv.py script. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix nit Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « tools/gc-nvp-trace-processor.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2015 the V8 project authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 #
6 # Common code for parsing --trace-gc-nvp output.
7 #
8
9
10 from __future__ import with_statement
11 import re
12
13 def split_nvp(s):
14 t = {}
15 for (name, value) in re.findall(r"(\w+)=([-\w]+)", s):
16 try:
17 t[name] = float(value)
18 except ValueError:
19 t[name] = value
20
21 return t
22
23
24 def parse_gc_trace(input):
25 trace = []
26 with open(input) as f:
27 for line in f:
28 info = split_nvp(line)
29 if info and 'pause' in info and info['pause'] > 0:
30 info['i'] = len(trace)
31 trace.append(info)
32 return trace
OLDNEW
« no previous file with comments | « tools/gc-nvp-trace-processor.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698