Commit d77b332e authored by machenbach's avatar machenbach Committed by Commit bot

[tools] Make cpu-governor flip more robust in perf runner

NOTRY=true
TBR=mtrofin@chromium.org

Review-Url: https://codereview.chromium.org/1996923002
Cr-Commit-Position: refs/heads/master@{#36399}
parent 2f3879d5
......@@ -856,8 +856,10 @@ class CustomMachineConfiguration:
try:
with open("/sys/devices/system/cpu/present", "r") as f:
indexes = f.readline()
first, last = map(int, indexes.split("-"))
return range(first, last + 1)
r = map(int, indexes.split("-"))
if len(r) == 1:
return range(r[0], r[0] + 1)
return range(r[0], r[1] + 1)
except Exception as e:
print "Failed to retrieve number of CPUs."
raise e
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment