From: Poornima Nayak <mpnayak@linux.vnet.ibm.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] [Patch 5/10]CPU consolidation testcase updated to handle exceptions
Date: Tue, 30 Jun 2009 20:27:46 +0530 [thread overview]
Message-ID: <20090630145746.11163.57045.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20090630145706.11163.54040.sendpatchset@localhost.localdomain>
[Patch 5/10]CPU consolidation testcase updated to handle exceptions
Signed-off-by: poornima nayak <mpnayak@linux.vnet.ibm.com>
diff -uprN ltp_orig/testcases/kernel/power_management/cpu_consolidation.py ltp_patched/testcases/kernel/power_management/cpu_consolidation.py
--- ltp_orig/testcases/kernel/power_management/cpu_consolidation.py 2009-06-30 15:04:19.000000000 +0530
+++ ltp_patched/testcases/kernel/power_management/cpu_consolidation.py 2009-06-30 15:21:42.000000000 +0530
@@ -12,42 +12,47 @@ from sched_mc import *
__author__ = "Poornima Nayak <mpnayak@linux.vnet.ibm.com>"
-# Run test based on the command line arguments
-if __name__ == "__main__":
+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",
- help="Sched mc power saving value 0/1/2")
+ default=0, 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")
+ parser.add_option("-w", "--workload", dest="work_ld",
+ default="ebizzy", help="Workload can be ebizzy/kernbench")
+ parser.add_option("-s", "--stress", dest="stress",
+ default="partial", help="Load on system is full/partial [i.e 50%]/thread")
(options, args) = parser.parse_args()
- test_thread_consld = 0
-
try:
- set_sched_mc_power(options.mc_level)
count_num_cpu()
+ count_num_sockets()
+ if is_multi_socket():
+ set_sched_mc_power(options.mc_level)
+ if is_hyper_threaded():
+ set_sched_smt_power(options.smt_level)
map_cpuid_pkgid()
print "INFO: Created table mapping cpu to package"
-
- if int(options.smt_level) == 1 or int(options.smt_level) == 2 :
- if is_hyper_threaded():
- set_sched_smt_power(options.smt_level)
- # Trigger ebizzy with 2 threads only to verify logical CPU
- # consolidation
- test_thread_consld = 1
- trigger_workld(options.mc_level, test_thread_consld)
- generate_report()
- validate_cpu_consolidation(options.mc_level, options.smt_level)
- test_thread_consld = 0
- else:
- print "INFO: No Hyper-threading support in this machine"
- sys.exit(0)
-
- trigger_workld(options.mc_level, test_thread_consld)
+ background="no"
+ duration=60
+ trigger_workld(options.work_ld, options.stress, duration, background)
generate_report()
- validate_cpu_consolidation(options.mc_level, options.smt_level)
- sys.exit(0)
+ status = validate_cpu_consolidation(options.mc_level, options.smt_level)
+ reset_schedmc()
+ if is_hyper_threaded():
+ reset_schedsmt()
+ return(status)
except Exception, details:
- print "INFO(: CPU consolidation failed", details
- sys.exit(1)
+ print "INFO: CPU consolidation failed", details
+ return(1)
+
+if __name__ == "__main__":
+ sys.exit(main())
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2009-06-30 14:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 14:57 [LTP] [Patch 1/10]Patch to integrate kernbench to LTP to test sched_mc=2 Poornima Nayak
2009-06-30 14:57 ` [LTP] [Patch 2/10]Makefile patch to integrate to LTP Poornima Nayak
2009-06-30 16:10 ` Subrata Modak
2009-06-30 14:57 ` [LTP] [Patch 3/10]Readme modified with pre-requisite for sched_mc=2 test Poornima Nayak
2009-06-30 16:10 ` Subrata Modak
2009-06-30 14:57 ` [LTP] [Patch 4/10]Reusable functions for consolidation test modified Poornima Nayak
2009-06-30 14:57 ` Poornima Nayak [this message]
2009-06-30 14:57 ` [LTP] [Patch 6/10]sched domian testcase updated to handle exceptions Poornima Nayak
2009-06-30 14:58 ` [LTP] [Patch 7/10]Fixes for sched_mc & sched_smt interface test Poornima Nayak
2009-06-30 14:58 ` [LTP] [Patch 8/10]New set of reusbale Library functions and fixes Poornima Nayak
2009-06-30 14:58 ` [LTP] [Patch 9/10]Master script modified to cover additional test scenarios Poornima Nayak
2009-06-30 14:58 ` [LTP] [Patch 10/10]Patch to add another command file in runtest Poornima Nayak
2009-06-30 16:10 ` Subrata Modak
2009-06-30 16:09 ` [LTP] [Patch 1/10]Patch to integrate kernbench to LTP to test sched_mc=2 Subrata Modak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090630145746.11163.57045.sendpatchset@localhost.localdomain \
--to=mpnayak@linux.vnet.ibm.com \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox