Author: gnichols Date: 2010-08-18 15:30:13 +0000 (Wed, 18 Aug 2010) New Revision: 639
Modified: trunk/tests/cpuscaling/cpuscaling.py Log: 619252 - CPUSCALING test to show the current CPU frequency before calculating PI
Modified: trunk/tests/cpuscaling/cpuscaling.py =================================================================== --- trunk/tests/cpuscaling/cpuscaling.py 2010-08-18 13:41:40 UTC (rev 638) +++ trunk/tests/cpuscaling/cpuscaling.py 2010-08-18 15:30:13 UTC (rev 639) @@ -201,6 +201,7 @@
def _runLoadTest(self): print "Running CPU load test..." + sys.stdout.flush() try: Command("taskset -pc %s %s" % (self.getLogicalDeviceName(), os.getpid())).echo() except V7CommandException, exception: @@ -233,6 +234,8 @@
def runLoadTest(self): result = self._runLoadTest() + print "CPU Load finished." + sys.stdout.flush() if self.getMode() == Constants.self: print "Warning: in self-test mode, returning face data" result = self.selfTestData[self.selfTestStep] @@ -323,6 +326,7 @@ return False
self.getCPUFlags() + sys.stdout.flush()
return True
@@ -341,6 +345,7 @@ print "" print "On Userspace Governor Test:" print "-------------------------------------------------" + sys.stdout.flush() # 5. Set the govr.(*) to "userspace" for each cpu via a command similar to: # 6. Verify the govr. setting took by checking ~/scaling_governor self.differenceSpeedUp = None @@ -355,9 +360,11 @@
# 7. Set the the cpu speed to it's lowest value frequency = self.frequencies[0] - print "Setting cpu frequency to %u MHz" % (frequency/1000) + currentFrequency = self.getParameter("scaling_cur_freq") + print "Changing cpu frequency from %u to %u MHz" % (int(currentFrequency)/1000, (frequency/1000)) if not self.setFrequency("%u" % frequency): success = False + sys.stdout.flush()
# 8. Verify the speed is set to the lowest value by comparing ~/scaling_min_freq to ~/scaling_cur_freq minimumFrequency = self.getParameter("scaling_min_freq") @@ -376,7 +383,8 @@
# 11. Set the cpu speed to it's highest value as above. frequency = self.frequencies[-1] - print "Setting cpu frequency to %u MHz" % (frequency/1000) + currentFrequency = self.getParameter("scaling_cur_freq") + print "Changing cpu frequency from %u to %u MHz" % (int(currentFrequency)/1000, (frequency/1000)) if not self.setFrequency("%u" % frequency): success = False
@@ -442,10 +450,14 @@ print "On Demand load test time: %.2f" % self.onDemandTestTime
# 18. Compare the timing to the max results from earlier, again time should be within self.speedUpTolerance - self.differenceOnDemandVsMaximum = (abs(self.onDemandTestTime-self.maximumFrequencyTestTime)/self.maximumFrequencyTestTime)*100 - print "Percentage Difference vs. maximum frequency: %.1f%%" % self.differenceOnDemandVsMaximum - if self.differenceOnDemandVsMaximum > self.speedUpTolerance: - print "Error: on demand performance vs maximum of %.1f%% is not within %.1f%% margin" % (self.differenceOnDemandVsMaximum, self.speedUpTolerance) + if self.maximumFrequencyTestTime: + self.differenceOnDemandVsMaximum = (abs(self.onDemandTestTime-self.maximumFrequencyTestTime)/self.maximumFrequencyTestTime)*100 + print "Percentage Difference vs. maximum frequency: %.1f%%" % self.differenceOnDemandVsMaximum + if self.differenceOnDemandVsMaximum > self.speedUpTolerance: + print "Error: on demand performance vs maximum of %.1f%% is not within %.1f%% margin" % (self.differenceOnDemandVsMaximum, self.speedUpTolerance) + success = False + else: + print "No maximum frequency test data to compare" success = False
# 19. Verify the current speed has returned to the lowest speed as before
v7-commits@lists.stg.fedorahosted.org