diff --git a/openlane/steps/step.py b/openlane/steps/step.py index 8a328b3e1..cce492227 100644 --- a/openlane/steps/step.py +++ b/openlane/steps/step.py @@ -21,6 +21,7 @@ import subprocess import textwrap import time +import sys from signal import Signals from inspect import isabstract @@ -131,11 +132,10 @@ def __init__(self, process: psutil.Popen, interval: float = 0.1): self.process = process self.result = None self.interval = interval - self.time = { - "cpu_time_user": 0.0, - "cpu_time_system": 0.0, - "cpu_time_iowait": 0.0, - } + self.time = {"cpu_time_user": 0.0, "cpu_time_system": 0.0} + if sys.platform == "linux": + self.time["cpu_time_iowait"] = 0.0 + self.peak_resources = { "cpu_percent": 0.0, "memory_rss": 0.0, @@ -161,7 +161,8 @@ def run(self): self.time["cpu_time_user"] = cpu_time.user self.time["cpu_time_system"] = cpu_time.system - self.time["cpu_time_iowait"] = cpu_time.iowait # type: ignore + if sys.platform == "linux": + self.time["cpu_time_iowait"] = cpu_time.iowait # type: ignore current: Dict[str, float] = {} current["cpu_percent"] = cpu