관리-도구
편집 파일: ebpf.cpython-39.opt-1.pyc
a ����-�_gq����������������������@���s2���d�dl�Z�d�dlmZmZmZ�G�dd��dee�ZdS�)�����N)�Plugin�IndependentPlugin� PluginOptc�������������������@���sF���e�Zd�ZdZdZdZdZeddedd�gZ d d ��Z dd��Zd d��ZdS�)�Ebpfz eBPF toolZebpf)�systemZkernel�network)Zbpftool� namespacesNz0Number of namespaces to collect, 0 for unlimited)�defaultZval_typeZdescc�������������� ���C���sx���g�}zt��|�}W�n8�tyJ�}�z |��d|�����|W��Y�d}~S�d}~0�0�t|�D�]\}}d|v�rT|�|d���qT|S�)z! Collect the list of program IDs z"Couldn't parse bpftool prog list: N�id��json�loads� ExceptionZ _log_info� enumerate�append)�selfZ prog_json�outZ prog_data�err�_�item��r����;/usr/lib/python3.9/site-packages/sos/report/plugins/ebpf.py�get_bpftool_prog_ids���s����zEbpf.get_bpftool_prog_idsc�������������� ���C���sx���g�}zt��|�}W�n8�tyJ�}�z |��d|�����|W��Y�d}~S�d}~0�0�t|�D�]\}}d|v�rT|�|d���qT|S�)z Collect the list of mapIDs z"Could not parse bpftool map list: Nr ���r���)r���Zmap_jsonr���Zmap_datar���r���r���r���r���r����get_bpftool_map_ids&���s����zEbpf.get_bpftool_map_idsc����������� ������C���s����|���d�}|��|d��D�]$}dD�]}|��d|��d|�����q q|���d�}|��|d��D�]}|��d|�����qV|��g�d���d }|��d �}|�j|d�D�]}||�d�} |��| d ���q�d�S�)Nzbpftool -j prog list�output)ZxlatedZjitedzbpftool prog dump z id zbpftool -j map listzbpftool map dump id )zbpftool prog listzbpftool map listzbpftool cgroup tree�bpftool net listzbpftool struct_ops dumpzip netns exec r���)Zns_max� r���)Zcollect_cmd_outputr���Zadd_cmd_outputr���Z get_optionZget_network_namespaces) r���ZprogsZprog_idZdumpcmd�mapsZmap_idZ cmd_prefixZnsps� namespaceZ ns_cmd_prefixr���r���r����setup3���s���� � z Ebpf.setup) �__name__� __module__�__qualname__Z short_descZplugin_nameZprofilesZcommandsr����intZoption_listr���r���r���r���r���r���r���r��� ���s����� r���)r���Zsos.report.pluginsr���r���r���r���r���r���r���r����<module> ���s���