Your IP : 216.73.216.172


Current Path : /lib/python3/dist-packages/sos/report/plugins/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/sos/report/plugins/__pycache__/ebpf.cpython-38.pyc

U

-�_gq�@s2ddlZddlmZmZmZGdd�dee�ZdS)�N)�Plugin�IndependentPlugin�	PluginOptc@sFeZdZdZdZdZdZeddedd�gZ	d	d
�Z
dd�Zd
d�ZdS)�Ebpfz	eBPF toolZebpf)�systemZkernelZnetwork)Zbpftool�
namespacesNz0Number of namespaces to collect, 0 for unlimited)�defaultZval_typeZdescc
Cszg}zt�|�}Wn:tk
rL}z|�d|���|WY�Sd}~XYnXt|�D]\}}d|krV|�|d�qV|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�9/usr/lib/python3/dist-packages/sos/report/plugins/ebpf.py�get_bpftool_prog_idsszEbpf.get_bpftool_prog_idsc
Cszg}zt�|�}Wn:tk
rL}z|�d|���|WY�Sd}~XYnXt|�D]\}}d|krV|�|d�qV|S)z Collect the list of mapIDs z"Could not parse bpftool map list: Nr	r
)rZmap_jsonrZmap_datarrrrrr�get_bpftool_map_ids&szEbpf.get_bpftool_map_idsc
Cs�|�d�}|�|d�D]$}dD]}|�d|�d|���q q|�d�}|�|d�D]}|�d|���qV|�dd	d
ddg�d
}|�d�}|j|d�D]}||d}	|�|	d�q�dS)Nzbpftool -j prog list�output)ZxlatedZjitedzbpftool prog dump z id zbpftool -j map listzbpftool map dump id zbpftool prog listzbpftool map listzbpftool cgroup treezbpftool net listzbpftool struct_ops dumpzip netns exec r)Zns_max� )Zcollect_cmd_outputrZadd_cmd_outputrZ
get_optionZget_network_namespaces)
rZprogsZprog_idZdumpcmd�mapsZmap_idZ
cmd_prefixZnsps�	namespaceZ
ns_cmd_prefixrrr�setup3s&

�
z
Ebpf.setup)
�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZcommandsr�intZoption_listrrrrrrrr
s��

r)rZsos.report.pluginsrrrrrrrr�<module>	s