Current File : //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/infiniband.cpython-312.pyc
�

-�_g�
��,�ddlmZmZGd�dee�Zy)�)�Plugin�IndependentPluginc�"�eZdZdZdZdZdZd�Zy)�
InfinibandzInfiniband information�
infiniband)�hardware)zlibibverbs-utils�opensm�rdmazinfiniband-diagsc
�.�|jgd��|jd�|jgd��gd�}d}|j|�r|j|�ng}|D]�}|j	d�r�|j||zdz�D]�}||zdz|zd	z}	t|d
d��5}|j
�}|d
k7r
	ddd��@	ddd�||zdz|zdz}		t|	d
d��5}
|
j
�}|jd�s
	ddd���	ddd�d|�d|��}|j|D�
cgc]	}
|
�d|����c}
�����y#1swY��xYw#t$rY��wxYw#1swY�UxYw#t$rY��wxYwcc}
w)N)z/etc/ofed/openib.confz/etc/ofed/opensm.confz	/etc/rdmaz/var/log/opensm*)�ibv_deviceszibv_devinfo -v�ibstat�ibstatus�
ibswitches)�ibhosts�
iblinkinfo�sminfo�	perfqueryz/sys/class/infiniband/�hfiz/portsz/ports/z/link_layer�rzUTF-8)�encodingzInfiniBand
z/statez	: ACTIVE
z-C z -P � )	�
add_copy_spec�add_cmd_output�
path_isdir�listdir�
startswith�open�readline�IOError�endswith)�self�
ports_cmds�	ib_sysdir�ib_devs�ibdev�port�lfile�link_fp�
link_layer�sfile�state_fp�state�opts�cs              �?/usr/lib/python3/dist-packages/sos/report/plugins/infiniband.py�setupzInfiniband.setups������
�	�	
���-�.����
�	�
�
�-�	�-1�_�_�Y�-G�$�,�,�y�)�R���	I�E�����&�����Y��%6��%A�B�
I��!�E�)�I�5��<�}�L����e�S�7�;�%�w�%,�%5�%5�%7�
�%��7�$�%�%�7�%�"�E�)�I�5��<�x�G����e�S�7�;�%�x� (� 1� 1� 3��$�~�~�l�;�$�%�%�;�%��U�G�4��v�.���#�#�J�$G�q��s�!�D�6�]�$G�H�+
I�	I�%�%�������
%�%�������%Hsf�"E(�0E�E(�E(�(F�6#E7�F�#F�F�E%�!E(�(	E4�3E4�7F�<F�	F�FN)�__name__�
__module__�__qualname__�
short_desc�plugin_name�profiles�packagesr0��r/rrs��)�J��K��H�I�H�6Ir9rN)�sos.report.pluginsrrrr8r9r/�<module>r;s��9�>I��*�>Ir9