source: rtems/testsuites/smptests/smplock01/smplock01perf.py @ a6283671

5
Last change on this file since a6283671 was a6283671, checked in by Sebastian Huber <sebastian.huber@…>, on 11/22/16 at 11:51:12

smptests/smplock01: Test TAS and TTAS locks

Cache align locks in the context.

  • Property mode set to 100755
File size: 1.2 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
11import re
12import libxml2
13from libxml2 import xmlNode
14import matplotlib.pyplot as plt
15data = open('smplock01.scn').read()
16data = re.sub(r'\*\*\*.*\*\*\*', '', data)
17doc = libxml2.parseDoc(data)
18ctx = doc.xpathNewContext()
19
20plt.title('SMP Lock Performance')
21plt.xlabel('Active Workers')
22plt.ylabel('Operation Count')
23
24y = map(xmlNode.getContent, ctx.xpathEval('/SMPLock01/GlobalTicketLockWithLocalCounter/SumOfLocalCounter'))
25x = range(1, len(y) + 1)
26plt.plot(x, y, label = 'Ticket Lock', marker = 'o')
27
28y = map(xmlNode.getContent, ctx.xpathEval('/SMPLock01/GlobalMCSLockWithLocalCounter/SumOfLocalCounter'))
29plt.plot(x, y, label = 'MCS Lock', marker = 'o')
30
31y = map(xmlNode.getContent, ctx.xpathEval('/SMPLock01/GlobalTASLockWithLocalCounter/SumOfLocalCounter'))
32plt.plot(x, y, label = 'TAS Lock', marker = 'o')
33
34y = map(xmlNode.getContent, ctx.xpathEval('/SMPLock01/GlobalTTASLockWithLocalCounter/SumOfLocalCounter'))
35plt.plot(x, y, label = 'TTAS Lock', marker = 'o')
36
37plt.legend(loc = 'best')
38plt.show()
Note: See TracBrowser for help on using the repository browser.