Align to Host left adjusted topology output

Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I8e56156200d5eface7f069ccf82a6b7503e1a48c


[ROCm/amdsmi commit: 16c34e91ac]
Este commit está contenido en:
Maisam Arif
2024-02-22 13:45:02 -06:00
padre d41232363c
commit 06d32ac405
Se han modificado 2 ficheros con 27 adiciones y 7 borrados
+25 -5
Ver fichero
@@ -2630,7 +2630,11 @@ class AMDSMICommands():
if args.access:
tabular_output = []
for src_gpu_index, src_gpu in enumerate(args.gpu):
tabular_output_dict = {'gpu': amdsmi_interface.amdsmi_get_gpu_device_bdf(src_gpu)}
gpu_bdf = amdsmi_interface.amdsmi_get_gpu_device_bdf(src_gpu)
if self.logger.is_human_readable_format():
tabular_output_dict = {'gpu' : f"{gpu_bdf} "}
else:
tabular_output_dict = {'gpu' : gpu_bdf}
src_gpu_links = {}
for dest_gpu in args.gpu:
dest_gpu_id = self.helpers.get_gpu_id_from_device_handle(dest_gpu)
@@ -2662,7 +2666,11 @@ class AMDSMICommands():
if args.weight:
tabular_output = []
for src_gpu_index, src_gpu in enumerate(args.gpu):
tabular_output_dict = {'gpu': amdsmi_interface.amdsmi_get_gpu_device_bdf(src_gpu)}
gpu_bdf = amdsmi_interface.amdsmi_get_gpu_device_bdf(src_gpu)
if self.logger.is_human_readable_format():
tabular_output_dict = {'gpu' : f"{gpu_bdf} "}
else:
tabular_output_dict = {'gpu' : gpu_bdf}
src_gpu_weight = {}
for dest_gpu in args.gpu:
dest_gpu_id = self.helpers.get_gpu_id_from_device_handle(dest_gpu)
@@ -2695,7 +2703,11 @@ class AMDSMICommands():
if args.hops:
tabular_output = []
for src_gpu_index, src_gpu in enumerate(args.gpu):
tabular_output_dict = {'gpu': amdsmi_interface.amdsmi_get_gpu_device_bdf(src_gpu)}
gpu_bdf = amdsmi_interface.amdsmi_get_gpu_device_bdf(src_gpu)
if self.logger.is_human_readable_format():
tabular_output_dict = {'gpu' : f"{gpu_bdf} "}
else:
tabular_output_dict = {'gpu' : gpu_bdf}
src_gpu_hops = {}
for dest_gpu in args.gpu:
dest_gpu_id = self.helpers.get_gpu_id_from_device_handle(dest_gpu)
@@ -2728,7 +2740,11 @@ class AMDSMICommands():
if args.link_type:
tabular_output = []
for src_gpu_index, src_gpu in enumerate(args.gpu):
tabular_output_dict = {'gpu': amdsmi_interface.amdsmi_get_gpu_device_bdf(src_gpu)}
gpu_bdf = amdsmi_interface.amdsmi_get_gpu_device_bdf(src_gpu)
if self.logger.is_human_readable_format():
tabular_output_dict = {'gpu' : f"{gpu_bdf} "}
else:
tabular_output_dict = {'gpu' : gpu_bdf}
src_gpu_link_type = {}
for dest_gpu in args.gpu:
dest_gpu_id = self.helpers.get_gpu_id_from_device_handle(dest_gpu)
@@ -2766,7 +2782,11 @@ class AMDSMICommands():
if args.numa_bw:
tabular_output = []
for src_gpu_index, src_gpu in enumerate(args.gpu):
tabular_output_dict = {'gpu': amdsmi_interface.amdsmi_get_gpu_device_bdf(src_gpu)}
gpu_bdf = amdsmi_interface.amdsmi_get_gpu_device_bdf(src_gpu)
if self.logger.is_human_readable_format():
tabular_output_dict = {'gpu' : f"{gpu_bdf} "}
else:
tabular_output_dict = {'gpu' : gpu_bdf}
src_gpu_link_type = {}
for dest_gpu in args.gpu:
dest_gpu_id = self.helpers.get_gpu_id_from_device_handle(dest_gpu)
+2 -2
Ver fichero
@@ -118,8 +118,8 @@ class AMDSMILogger():
table_values += value.rjust(12)
elif key in ('throttle_status', 'pcie_replay'):
table_values += value.rjust(13)
elif 'gpu_' in key: # handle topology tables
table_values += value.rjust(13)
elif 'gpu_' in key: # This is just for handling topology tables
table_values += value.ljust(13)
else:
table_values += value.rjust(10)
return table_values.rstrip()