summaryrefslogtreecommitdiffstats
path: root/testsuites/tmtests/tmtimer01/plot.py
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/tmtests/tmtimer01/plot.py')
-rw-r--r--testsuites/tmtests/tmtimer01/plot.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuites/tmtests/tmtimer01/plot.py b/testsuites/tmtests/tmtimer01/plot.py
new file mode 100644
index 0000000000..7f3cf9ece0
--- /dev/null
+++ b/testsuites/tmtests/tmtimer01/plot.py
@@ -0,0 +1,25 @@
+#
+# 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 libxml2
+from libxml2 import xmlNode
+import matplotlib.pyplot as plt
+doc = libxml2.parseFile('tmtimer01.scn')
+ctx = doc.xpathNewContext()
+
+plt.title('timer test')
+plt.xscale('log')
+plt.xlabel('active timers')
+plt.ylabel('timer fire and cancel [ns]')
+
+x = map(xmlNode.getContent, ctx.xpathEval('/TMTimer01/Sample/ActiveTimers'))
+for i in ['First', 'Middle', 'Last']:
+ y = map(xmlNode.getContent, ctx.xpathEval('/TMTimer01/Sample/' + i))
+ plt.plot(x, y, label = i)
+plt.legend(loc = 'best')
+plt.show()