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

« back to all changes in this revision

Viewing changes to scripts/libplot.py

  • Committer: Michael Hope
  • Date: 2012-06-12 03:40:53 UTC
  • Revision ID: michael.hope@linaro.org-20120612034053-01y3rxf81q1g2r0f
Generate a tumbnail and full size for the size plots.  Tweak the colours to have more and make the first a Linaro purple.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
Record = collections.namedtuple('Record', 'variant function bytes loops alignment elapsed rest')
7
7
 
8
8
 
 
9
def make_colours():
 
10
    return iter('m b g r c y k pink orange brown grey'.split())
 
11
 
9
12
def parse_value(v):
10
13
    """Turn text into a primitive"""
11
14
    try:
28
31
    else:
29
32
        return sorted(values)
30
33
 
 
34
def parse_row(line):
 
35
    return Record(*[parse_value(y) for y in line.split(':')])
 
36
 
31
37
def parse():
32
38
    """Parse a record file into named tuples, correcting for loop
33
39
    overhead along the way.
34
40
    """
35
 
    records = [Record(*[parse_value(y) for y in x.split(':')]) for x in fileinput.input()]
 
41
    records = [parse_row(x) for x in fileinput.input()]
36
42
 
37
43
    # Pull out any bounce values
38
44
    costs = {}