Lines Matching refs:trace
33 # run with flags --trace-gc --trace-gc-nvp. Relies on gnuplot for actual
36 # Usage: gc-nvp-trace-processor.py <GC-trace-filename>
59 trace = []
64 info['i'] = len(trace)
65 trace.append(info)
66 return trace
173 def generate_datafile(datafile_name, trace, fields):
175 for line in trace:
180 def generate_script_and_datafile(plot, trace, datafile, output):
182 generate_datafile(datafile, trace, fields)
203 def plot_all(plots, trace, prefix):
209 script = generate_script_and_datafile(plot, trace, '~datafile', outfilename)
293 def freduce(f, field, trace, init):
294 return reduce(lambda t,r: f(t, r[field]), trace, init)
296 def calc_total(trace, field):
297 return freduce(lambda t,v: t + long(v), field, trace, long(0))
299 def calc_max(trace, field):
300 return freduce(lambda t,r: max(t, r), field, trace, 0)
302 def count_nonzero(trace, field):
303 return freduce(lambda t,r: t if r == 0 else t + 1, field, trace, 0)
307 trace = parse_gc_trace(filename)
309 marksweeps = filter(lambda r: r['gc'] == 'ms', trace)
310 scavenges = filter(lambda r: r['gc'] == 's', trace)
311 globalgcs = filter(lambda r: r['gc'] != 's', trace)
314 charts = plot_all(plots, trace, filename)
316 def stats(out, prefix, trace, field):
317 n = len(trace)
318 total = calc_total(trace, field)
319 max = calc_max(trace, field)
325 dev = math.sqrt(freduce(lambda t,r: t + (r - avg) ** 2, field, trace, 0) /
342 def throughput(name, trace):
343 total_live_after = calc_total(trace, 'total_size_after')
344 total_live_before = calc_total(trace, 'total_size_before')
345 total_gc = calc_total(trace, 'pause')
365 stats(out, 'Total in GC', trace, 'pause')
368 stats(out, 'Mark', filter(lambda r: r['mark'] != 0, trace), 'mark')
369 stats(out, 'Sweep', filter(lambda r: r['sweep'] != 0, trace), 'sweep')
372 filter(lambda r: r['external'] != 0, trace),
375 throughput('TOTAL', trace)
386 print "Usage: %s <GC-trace-filename>" % sys.argv[0]