o i©¹dB ã@s&ddlmZmZGdd„deeƒZdS)é)ÚPluginÚIndependentPluginc@s$eZdZdZdZdZdZdd„ZdS)Ú InfinibandzInfiniband informationÚ infiniband)Úhardware)zlibibverbs-utilsÚopensmÚrdmazinfiniband-diagsc s8| gd¢¡| d¡| gd¢¡gd¢}d}| |¡r#| |¡ng}|D]r} | d¡r0q'| ||d¡D]_}zt||d|d ƒ}Wn tyRYq9w| ¡}| ¡|d kr`q9zt||d|d ƒ}Wn tywYq9w| ¡} | ¡|   d ¡s†q9d ||f‰| ‡fdd„|Dƒ¡q9q'dS)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_layerz InfiniBand z/statez : ACTIVE z -C %s -P %scsg|]}d|ˆf‘qS)z%s %s©)Ú.0Úc©Úoptsrú?/usr/lib/python3/dist-packages/sos/report/plugins/infiniband.pyÚ Psz$Infiniband.setup..) Ú add_copy_specÚadd_cmd_outputÚ path_isdirÚlistdirÚ startswithÚopenÚIOErrorÚreadlineÚcloseÚendswith) ÚselfÚ ports_cmdsÚ IB_SYS_DIRÚibsÚibÚportÚpÚ link_layerÚsÚstaterrrÚsetupsF    ÿ ÿ ÿ  é÷zInfiniband.setupN)Ú__name__Ú __module__Ú __qualname__Ú short_descÚ plugin_nameÚprofilesÚpackagesr-rrrrrs  rN)Úsos.report.pluginsrrrrrrrÚs