summaryrefslogtreecommitdiffstats
path: root/testsuites/smptests/smplock01/smplock01.py
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-10-31 10:50:54 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-10-31 13:09:42 +0100
commit7eec247c356826abbf51f53b41e6307d577a446d (patch)
tree29bc4acea20ff434a9b32be0878c136a2480ff3c /testsuites/smptests/smplock01/smplock01.py
parentsys/sockio.h: Update to FreeBSD head 2016-05-03 (diff)
downloadrtems-7eec247c356826abbf51f53b41e6307d577a446d.tar.bz2
smptests/smplock01: Use test support
Convert output to XML.
Diffstat (limited to 'testsuites/smptests/smplock01/smplock01.py')
-rw-r--r--testsuites/smptests/smplock01/smplock01.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/testsuites/smptests/smplock01/smplock01.py b/testsuites/smptests/smplock01/smplock01.py
new file mode 100644
index 0000000000..f8189f32ff
--- /dev/null
+++ b/testsuites/smptests/smplock01/smplock01.py
@@ -0,0 +1,32 @@
+#!/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('smplock01.scn').read()
+data = re.sub(r'\*\*\*.*\*\*\*', '', data)
+doc = libxml2.parseDoc(data)
+ctx = doc.xpathNewContext()
+
+plt.title('SMP Lock Performance')
+plt.xlabel('Active Workers')
+plt.ylabel('Operation Count')
+
+y = map(xmlNode.getContent, ctx.xpathEval('/SMPLock01/GlobalTicketLockWithLocalCounter/SumOfLocalCounter'))
+x = range(1, len(y) + 1)
+plt.plot(x, y, label = 'Global Ticket Lock')
+
+y = map(xmlNode.getContent, ctx.xpathEval('/SMPLock01/GlobalMCSLockWithLocalCounter/SumOfLocalCounter'))
+plt.plot(x, y, label = 'Global MCS Lock')
+
+plt.legend(loc = 'best')
+plt.show()