Enhance gc-nvp-trace-processor.py:

- correctly display time spent in scavenger (it was attributed to 'other' scope).
- display time spent in 'external' scope.

Review URL: http://codereview.chromium.org/7067022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8030 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
vegorov@chromium.org 2011-05-24 12:19:57 +00:00
parent 3c7e1d7015
commit 24222bdb57

View File

@ -216,16 +216,26 @@ def reclaimed_bytes(row):
return row['total_size_before'] - row['total_size_after'] return row['total_size_before'] - row['total_size_after']
def other_scope(r): def other_scope(r):
return r['pause'] - r['mark'] - r['sweep'] - r['compact'] if r['gc'] == 's':
# there is no 'other' scope for scavenging collections.
return 0
return r['pause'] - r['mark'] - r['sweep'] - r['compact'] - r['external']
def scavenge_scope(r):
if r['gc'] == 's':
return r['pause'] - r['external']
return 0
plots = [ plots = [
[ [
Set('style fill solid 0.5 noborder'), Set('style fill solid 0.5 noborder'),
Set('style histogram rowstacked'), Set('style histogram rowstacked'),
Set('style data histograms'), Set('style data histograms'),
Plot(Item('Marking', 'mark', lc = 'purple'), Plot(Item('Scavenge', scavenge_scope, lc = 'green'),
Item('Marking', 'mark', lc = 'purple'),
Item('Sweep', 'sweep', lc = 'blue'), Item('Sweep', 'sweep', lc = 'blue'),
Item('Compaction', 'compact', lc = 'red'), Item('Compaction', 'compact', lc = 'red'),
Item('External', 'external', lc = '#489D43'),
Item('Other', other_scope, lc = 'grey')) Item('Other', other_scope, lc = 'grey'))
], ],
[ [
@ -314,6 +324,10 @@ def process_trace(filename):
stats(out, 'Mark', filter(lambda r: r['mark'] != 0, trace), 'mark') stats(out, 'Mark', filter(lambda r: r['mark'] != 0, trace), 'mark')
stats(out, 'Sweep', filter(lambda r: r['sweep'] != 0, trace), 'sweep') stats(out, 'Sweep', filter(lambda r: r['sweep'] != 0, trace), 'sweep')
stats(out, 'Compact', filter(lambda r: r['compact'] != 0, trace), 'compact') stats(out, 'Compact', filter(lambda r: r['compact'] != 0, trace), 'compact')
stats(out,
'External',
filter(lambda r: r['external'] != 0, trace),
'external')
out.write('</table>') out.write('</table>')
for chart in charts: for chart in charts:
out.write('<img src="%s">' % chart) out.write('<img src="%s">' % chart)