Skip to content

Commit

Permalink
Added support to run the lockstorm benchmark multiple times
Browse files Browse the repository at this point in the history
Added support to capture and run the lockstorm_benchmark
multiple times.
For this introduced new .yaml parameter
test_iter.

Signed-off-by: Samir Mulani <[email protected]>
  • Loading branch information
SamirMulani committed Jun 28, 2024
1 parent 3f753c0 commit 41729bc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
30 changes: 16 additions & 14 deletions cpu/lockstorm_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def setUp(self):
self.cancel(f'{package} is needed for the test to be run')

self.cpu_list = self.params.get("cpu_list", default=0)
self.test_iter = self.params.get("test_iter", default=5)

url = "https://github.com/npiggin/lockstorm.git"
git.get_repo(url, branch='master', destination_dir=self.workdir)
Expand All @@ -57,8 +58,8 @@ def capture_dmesg_dump(self, smt_state):
"""
This function capture the spinlock performance stats from dmesg.
:param smt_state: Here we are passing the smt state that we are going to
change.
:param smt_state: Here we are passing the smt state that we are
going to change.
"""
cmd = "dmesg | tail -n 1"
self.log.info(f"=================Dump data for \
Expand All @@ -76,19 +77,20 @@ def test(self):
process.run('ppc64_cpu --cores-on=all', shell=True)
process.run('ppc64_cpu --smt=on', shell=True)
cpu_controller = ["2", "4", "6", "on", "off"]
for smt_mode in cpu_controller:
cmd = "ppc64_cpu --smt={}".format(smt_mode)
self.log.info(f"=======smt mode {smt_mode}=======")
process.run(cmd, shell=True)
cmd = "insmod ./lockstorm.ko" + " cpulist=%s" % \
(self.cpu_list)
for test_run in range(self.test_iter):
self.log.info("Test iteration %s " % (test_run))
for smt_mode in cpu_controller:
cmd = "ppc64_cpu --smt={}".format(smt_mode)
self.log.info(f"=======smt mode {smt_mode}=======")
process.run(cmd, shell=True)
cmd = "insmod ./lockstorm.ko" + " cpulist=%s" % \
(self.cpu_list)

if self.cpu_list == 0:
cmd = "insmod ./lockstorm.ko"

process.system(cmd,
ignore_status=True, shell=False, sudo=True)
self.capture_dmesg_dump(smt_mode)
if self.cpu_list == 0:
cmd = "insmod ./lockstorm.ko"
process.system(cmd,
ignore_status=True, shell=False, sudo=True)
self.capture_dmesg_dump(smt_mode)

def tearDown(self):
"""
Expand Down
1 change: 1 addition & 0 deletions cpu/lockstorm_benchmark.py.data/lockstorm.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
cpu_list:
test_iter:

0 comments on commit 41729bc

Please sign in to comment.