def get_wbt_lat(device: Device): wbt_lat_config_path = os.path.join(get_sysfs_path(device.get_device_id()), "queue/wbt_lat_usec") return int( TestRun.executor.run_expect_success( f"cat {wbt_lat_config_path}").stdout)
def set_wbt_lat(device: Device, value: int): if value < 0: raise ValueError("Write back latency can't be negative number") wbt_lat_config_path = os.path.join(get_sysfs_path(device.get_device_id()), "queue/wbt_lat_usec") return TestRun.executor.run_expect_success( f"echo {value} > {wbt_lat_config_path}")