scripts/perf: fix measure_bandwidth failed to open outfile error

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I9b9f8c9e407425fdab1e84050354481ad76c19c2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6655
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
This commit is contained in:
Maciej Wawryk 2021-03-03 14:06:13 +01:00 committed by Tomasz Zawadzki
parent 467148fce5
commit 4503500e49

View File

@ -601,9 +601,10 @@ class Target(Server):
with open(os.path.join(results_dir, pcm_power_file_name), "w") as fh: with open(os.path.join(results_dir, pcm_power_file_name), "w") as fh:
fh.write(out) fh.write(out)
def measure_bandwidth(self, results_dir, bandwidth_file_name): def measure_network_bandwidth(self, results_dir, bandwidth_file_name):
self.exec_cmd(["bwm-ng", "-o csv", "-F %s/%s" % (results_dir, bandwidth_file_name), self.log_print("INFO: starting network bandwidth measure")
"-a 1", "-t 1000", "-c %s" % self.bandwidth_count]) self.exec_cmd(["bwm-ng", "-o", "csv", "-F", "%s/%s" % (results_dir, bandwidth_file_name),
"-a", "1", "-t", "1000", "-c", str(self.bandwidth_count)])
def measure_dpdk_memory(self, results_dir): def measure_dpdk_memory(self, results_dir):
self.log_print("INFO: waiting to generate DPDK memory usage") self.log_print("INFO: waiting to generate DPDK memory usage")
@ -1394,7 +1395,7 @@ if __name__ == "__main__":
if target_obj.enable_bandwidth: if target_obj.enable_bandwidth:
bandwidth_file_name = "_".join(["bandwidth", str(block_size), str(rw), str(io_depth)]) bandwidth_file_name = "_".join(["bandwidth", str(block_size), str(rw), str(io_depth)])
bandwidth_file_name = ".".join([bandwidth_file_name, "csv"]) bandwidth_file_name = ".".join([bandwidth_file_name, "csv"])
t = threading.Thread(target=target_obj.measure_bandwidth, args=(target_results_dir, bandwidth_file_name,)) t = threading.Thread(target=target_obj.measure_network_bandwidth, args=(target_results_dir, bandwidth_file_name,))
threads.append(t) threads.append(t)
if target_obj.enable_dpdk_memory: if target_obj.enable_dpdk_memory: