-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy patheval.py
More file actions
26 lines (23 loc) · 688 Bytes
/
eval.py
File metadata and controls
26 lines (23 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# parse latency dumps
import struct
import sys
a = open(sys.argv[1], 'r').read()
c = list()
for i in range(0, len(a), 16):
b = struct.unpack('HHIIBBBB', a[i:i+16])
if b[3] > 1: # only look at stuff that has been executed at least twice
if True or b[2] > b[3] or b[0] > 0:
# this thing consistently needs more than one microsecond
print '!!!',
print hex(i / 16), b
c += [(hex(i / 16), b[0], b[1], b[2], b[3], float(b[2])/b[3])]
# cc[0]: address
# cc[1]: minimum latency
# cc[2]: maximum latency
# cc[3]: total latency
# cc[4]: total iterations
# cc[5]: average latency
d = sorted(c, key = lambda cc: cc[3])
# print the flop 10
for i in d[-100:]:
print i