Skip to content

Commit

Permalink
Merge pull request avocado-framework-tests#2851 from SamirMulani/lock…
Browse files Browse the repository at this point in the history
…storm_multi

Added support to run the lockstorm benchmark multiple times
  • Loading branch information
PraveenPenguin authored Jun 29, 2024
2 parents 5684857 + 41729bc commit 6e2637e
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 6e2637e

Please sign in to comment.