~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:22:19 UTC
  • Revision ID: michael.hope@linaro.org-20120612032219-5ei6zqwuh6vfrjkq
Added and updated the test harnesses for the new C only versions.

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
 
 
12
9
def parse_value(v):
13
10
    """Turn text into a primitive"""
14
11
    try:
31
28
    else:
32
29
        return sorted(values)
33
30
 
34
 
def parse_row(line):
35
 
    return Record(*[parse_value(y) for y in line.split(':')])
36
 
 
37
31
def parse():
38
32
    """Parse a record file into named tuples, correcting for loop
39
33
    overhead along the way.
40
34
    """
41
 
    records = [parse_row(x) for x in fileinput.input()]
 
35
    records = [Record(*[parse_value(y) for y in x.split(':')]) for x in fileinput.input()]
42
36
 
43
37
    # Pull out any bounce values
44
38
    costs = {}