~linaro-toolchain-dev/cortex-strings/trunk

« back to all changes in this revision

Viewing changes to scripts/plot-sizes.py

  • Committer: Will Newton
  • Date: 2013-06-21 14:42:10 UTC
  • Revision ID: will.newton@linaro.org-20130621144210-za4jb0kw9d4mcnml
Allow aligning source and destination buffers separately.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    records = [x for x in records if x.function==function]
25
25
 
26
26
    if alignment != None:
27
 
        records = [x for x in records if x.alignment==alignment]
 
27
        records = [x for x in records if x.src_alignment==alignment[0] and
 
28
                   x.dst_alignment==alignment[1]]
28
29
 
29
 
    alignments = libplot.unique(records, 'alignment')
30
 
    assert len(alignments) == 1
31
 
    aalignment = alignments[0]
 
30
    alignments = libplot.unique(records, ('src_alignment', 'dst_alignment'))
 
31
    if len(alignments) != 1:
 
32
        return False
 
33
    if libplot.alignments_equal(alignments):
 
34
        aalignment = alignments[0][0]
 
35
    else:
 
36
        aalignment = "%s:%s" % (alignments[0][0], alignments[0][1])
32
37
 
33
38
    bytes = libplot.unique(records, 'bytes')[0]
34
39
 
76
81
    pylab.axes().set_xticklabels([pretty_kb(2**x) for x in range(0, power+1)])
77
82
    pylab.xlim(0, top)
78
83
    pylab.ylim(0, pylab.ylim()[1])
 
84
    return True
79
85
 
80
86
def main():
81
87
    records = libplot.parse()
82
88
 
83
89
    functions = libplot.unique(records, 'function')
84
 
    alignments = libplot.unique(records, 'alignment')
 
90
    alignments = libplot.unique(records, ('src_alignment', 'dst_alignment'))
85
91
 
86
92
    for function in functions:
87
93
        for alignment in alignments:
88
94
            for scale in [1, 2.5]:
89
 
                plot(records, function, alignment, scale)
90
 
                pylab.savefig('sizes-%s-%02d-%.1f.png' % (function, alignment, scale), dpi=72)
 
95
                if plot(records, function, alignment, scale):
 
96
                    pylab.savefig('sizes-%s-%02d-%02d-%.1f.png' % (function, alignment[0], alignment[1], scale), dpi=72)
91
97
 
92
98
    pylab.show()
93
99