From: Subrata <sub...@us...> - 2009-06-30 15:47:00
|
Update of /cvsroot/ltp/ltp/testcases/kernel/power_management In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9665/ltp/testcases/kernel/power_management Modified Files: sched_domain.py Log Message: Addtional test scenarios & fixes for power management testcases. On doing demo of LTP testcases to developers we realized some more test scenarios has to be added to LTP testcases for better test coverage. Also some bug fixes has to be done for existing test cases to run on future versions on Linux Kernel. We also want to integrate kernbench in LTP for sched_mc_power_savings=2. Hence this list of patches include patches to integrate kernbench into LTP. The test also covers consolidation at core level for hyper threaded system. [Patch 6/10]sched domian testcase updated to handle exceptions. Signed-off-by: poornima nayak <mp...@li...>. Index: sched_domain.py =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/power_management/sched_domain.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sched_domain.py 30 Mar 2009 07:10:32 -0000 1.3 --- sched_domain.py 30 Jun 2009 15:46:54 -0000 1.4 *************** *** 13,28 **** __author__ = "Poornima Nayak <mp...@li...>" ! # Run test based on the command line arguments ! if __name__ == "__main__": ! sched_smt = 0 ! sched_mc = 0 usage = "-w" parser = OptionParser(usage) ! parser.add_option("-w", "--workload", dest="workload", ! help="Test name that has be triggered") ! parser.add_option("-c", "--mc_level", dest="mc_level", help="Sched mc power saving value 0/1/2") ! parser.add_option("-t", "--smt_level", dest="smt_level", default=0, help="Sched smt power saving value 0/1/2") (options, args) = parser.parse_args() --- 13,29 ---- __author__ = "Poornima Nayak <mp...@li...>" ! class Usage(Exception): ! def __init__(self, msg): ! self.msg = msg ! ! def main(argv=None): ! if argv is None: ! argv = sys.argv usage = "-w" parser = OptionParser(usage) ! parser.add_option("-c", "--mc_level", dest="mc_level", default=-1, help="Sched mc power saving value 0/1/2") ! parser.add_option("-t", "--smt_level", dest="smt_level", default=-1, help="Sched smt power saving value 0/1/2") (options, args) = parser.parse_args() *************** *** 33,49 **** map_cpuid_pkgid() ! if int(options.smt_level) == 1 or int(options.smt_level) == 2: if is_hyper_threaded(): ! sched_smt_level = options.smt_level ! set_sched_smt_power(sched_smt_level) ! else: ! print "INFO: No Hyper-threading support in this machine" ! sys.exit(0) ! ! # Validate sched domain for sched_mc = 1, sched_smt = 0 ! set_sched_mc_power(options.mc_level) ! verify_sched_domain_dmesg(options.mc_level, options.smt_level) ! sys.exit(0) except Exception, details: print "INFO: sched domain test failed: ", details ! sys.exit(1) --- 34,56 ---- map_cpuid_pkgid() ! if is_hyper_threaded() and int(options.smt_level) >= 0: ! set_sched_smt_power(options.smt_level) ! ! if int(options.mc_level) >= 0: ! set_sched_mc_power(options.mc_level) ! if int(options.smt_level) >= 0 or int(options.mc_level) >= 0: ! status = verify_sched_domain_dmesg(options.mc_level, options.smt_level) ! reset_schedmc() if is_hyper_threaded(): ! reset_schedsmt() ! return(status) ! else: ! print "INFO: Invalid arguments given" ! return 1 except Exception, details: print "INFO: sched domain test failed: ", details ! return(1) ! ! # Run test based on the command line arguments ! if __name__ == "__main__": ! sys.exit(main()) |