Skip to content

Commit

Permalink
Merge pull request #5916 from disgoel/phy-core
Browse files Browse the repository at this point in the history
avocado/utils/cpu.py: add getting physical core from lscpu
  • Loading branch information
PraveenPenguin authored Apr 26, 2024
2 parents d0d627c + 0e79149 commit 6a0127d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion avocado/utils/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,10 @@ def lscpu():
output = process.run("lscpu")
res = {}
for line in output.stdout.decode("utf-8").split("\n"):
if "Physical cores/chip:" in line:
res["physical_cores"] = int(line.split(":")[1].strip())
if "Core(s) per socket:" in line:
res["cores"] = int(line.split(":")[1].strip())
res["virtual_cores"] = int(line.split(":")[1].strip())
if "Physical sockets:" in line:
res["physical_sockets"] = int(line.split(":")[1].strip())
if "Physical chips:" in line:
Expand Down

0 comments on commit 6a0127d

Please sign in to comment.