5
Last change
on this file since 0154dea3 was
0154dea3,
checked in by Sebastian Huber <sebastian.huber@…>, on 11/03/16 at 07:55:24
|
tmtests/tmfine01: Update screen file
Add plot script.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | # |
---|
4 | # Copyright (c) 2016 embedded brains GmbH. All rights reserved. |
---|
5 | # |
---|
6 | # The license and distribution terms for this file may be |
---|
7 | # found in the file LICENSE in this distribution or at |
---|
8 | # http://www.rtems.org/license/LICENSE. |
---|
9 | # |
---|
10 | |
---|
11 | import re |
---|
12 | import libxml2 |
---|
13 | from libxml2 import xmlNode |
---|
14 | import matplotlib.pyplot as plt |
---|
15 | data = open('tmfine01.scn').read() |
---|
16 | data = re.sub(r'\*\*\*.*\*\*\*', '', data) |
---|
17 | doc = libxml2.parseDoc(data) |
---|
18 | ctx = doc.xpathNewContext() |
---|
19 | |
---|
20 | plt.title('Uncontested Mutex Performance') |
---|
21 | plt.xlabel('Active Workers') |
---|
22 | plt.ylabel('Operation Count') |
---|
23 | |
---|
24 | def m(n): |
---|
25 | return int(n.getContent()) |
---|
26 | |
---|
27 | def getCounterSums(variant): |
---|
28 | w = 1 |
---|
29 | y = [] |
---|
30 | while True: |
---|
31 | c = map(m, ctx.xpathEval('/TestTimeFine01/' + variant + '[@activeWorker="' + str(w) + '"]/Counter')) |
---|
32 | if not c: |
---|
33 | break |
---|
34 | y.append(sum(c)) |
---|
35 | w = w + 1 |
---|
36 | return y |
---|
37 | |
---|
38 | y = getCounterSums('ManySysLockMutex') |
---|
39 | x = range(1, len(y) + 1) |
---|
40 | plt.plot(x, y, label = 'Self-Contained Mutex', marker = 'o') |
---|
41 | |
---|
42 | y = getCounterSums('ManyMutex') |
---|
43 | plt.plot(x, y, label = 'Classic Mutex', marker = 'o') |
---|
44 | |
---|
45 | plt.legend(loc = 'best') |
---|
46 | plt.show() |
---|
Note: See
TracBrowser
for help on using the repository browser.