Skip to content

Commit

Permalink
Merge pull request #5756 from disgoel/add_revision
Browse files Browse the repository at this point in the history
add function to get revision value
  • Loading branch information
PraveenPenguin committed Aug 31, 2023
2 parents a1cd8a8 + 84a5a35 commit a7bddf1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions avocado/utils/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,22 @@ def get_vendor():
return None


def get_revision():
"""
Get revision from /proc/cpuinfo
:return: revision entry from /proc/cpuinfo file
e.g.:- '0080' for IBM POWER10 machine
:rtype: str
"""
rev = None
proc_cpuinfo = genio.read_file("/proc/cpuinfo")
for line in proc_cpuinfo.splitlines():
if "revision" in line:
rev = line.split(" ")[3].strip()
return rev


def get_arch():
"""Work out which CPU architecture we're running on."""
cpu_table = [
Expand Down

0 comments on commit a7bddf1

Please sign in to comment.