summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-12-08 14:46:32 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-12-08 14:46:32 +0100
commit16bd9e0a9e333e698975db19ba263c1f69cb7c26 (patch)
treed2d6ea76a603538abf0918bbe46464d3aab70893
parentsptimecounter02: Update screen file (diff)
downloadrtems-16bd9e0a9e333e698975db19ba263c1f69cb7c26.tar.bz2
sptimecounter02: Add plot script
-rwxr-xr-xtestsuites/sptests/sptimecounter02/sptimecounter02.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/testsuites/sptests/sptimecounter02/sptimecounter02.py b/testsuites/sptests/sptimecounter02/sptimecounter02.py
new file mode 100755
index 0000000000..925b3f1d6c
--- /dev/null
+++ b/testsuites/sptests/sptimecounter02/sptimecounter02.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+
+#
+# Copyright (c) 2016 embedded brains GmbH. All rights reserved.
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.org/license/LICENSE.
+#
+
+import re
+import libxml2
+from libxml2 import xmlNode
+import matplotlib.pyplot as plt
+data = open('sptimecounter02.scn').read()
+data = re.sub(r'\*\*\*.*\*\*\*', '', data)
+doc = libxml2.parseDoc(data)
+ctx = doc.xpathNewContext()
+
+plt.title('Timestamp Performance')
+plt.xlabel('Active Workers')
+plt.ylabel('Operation Count')
+
+def m(n):
+ return int(n.getContent())
+
+def getCounterSums(variant):
+ w = 1
+ y = []
+ while True:
+ c = map(m, ctx.xpathEval('/SPTimecounter01/' + variant + '[@activeWorker="' + str(w) + '"]/Counter'))
+ if not c:
+ break
+ y.append(sum(c))
+ w = w + 1
+ return y
+
+y = getCounterSums('BinuptimeTest')
+x = range(1, len(y) + 1)
+plt.xticks(x)
+plt.plot(x, y, marker = 'o')
+plt.show()