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

« back to all changes in this revision

Viewing changes to scripts/libplot.py

  • Committer: Will Newton
  • Date: 2013-04-30 14:31:08 UTC
  • Revision ID: will.newton@linaro.org-20130430143108-ww31c741wek8dnus
Split bionic reference code into A15 and A9 versions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import fileinput
4
4
import collections
5
5
 
6
 
Record = collections.namedtuple('Record', 'variant function bytes loops src_alignment dst_alignment run_id elapsed rest')
 
6
Record = collections.namedtuple('Record', 'variant function bytes loops alignment elapsed rest')
7
7
 
8
8
 
9
9
def make_colours():
19
19
    except ValueError:
20
20
        return v
21
21
 
22
 
def create_column_tuple(record, names):
23
 
    cols = [getattr(record, name) for name in names]
24
 
    return tuple(cols)
25
22
 
26
23
def unique(records, name, prefer=''):
27
24
    """Return the unique values of a column in the records"""
28
 
    if type(name) == tuple:
29
 
        values = list(set(create_column_tuple(x, name) for x in records))
30
 
    else:
31
 
        values = list(set(getattr(x, name) for x in records))
 
25
    values = list(set(getattr(x, name) for x in records))
32
26
 
33
27
    if not values:
34
28
        return values
37
31
    else:
38
32
        return sorted(values)
39
33
 
40
 
def alignments_equal(alignments):
41
 
    for alignment in alignments:
42
 
        if alignment[0] != alignment[1]:
43
 
            return False
44
 
    return True
45
 
 
46
34
def parse_row(line):
47
35
    return Record(*[parse_value(y) for y in line.split(':')])
48
36