Sindbad~EG File Manager

Current Path : /lib/python3.6/site-packages/sos/report/plugins/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/sos/report/plugins/__pycache__/ebpf.cpython-36.opt-1.pyc

3

�f]�@s2ddlZddlmZmZmZGdd�dee�ZdS)�N)�Plugin�IndependentPlugin�	PluginOptc@sBeZdZdZdZdZeddedd	�gZd
d�Z	dd
�Z
dd�ZdS)�Ebpfz	eBPF toolZebpf�system�kernel�network�
namespacesNz0Number of namespaces to collect, 0 for unlimited)�defaultZval_typeZdesccCsrg}ytj|�}Wn.tk
r@}z|jd|�|Sd}~XnXx*t|�D]\}}d|krL|j|d�qLW|S)z! Collect the list of program IDs z$Couldn't parse bpftool prog list: %sN�id)�json�loads�	Exception�	_log_info�	enumerate�append)�selfZ	prog_json�outZ	prog_data�err�_�item�r�/usr/lib/python3.6/ebpf.py�get_bpftool_prog_idsszEbpf.get_bpftool_prog_idscCsrg}ytj|�}Wn.tk
r@}z|jd|�|Sd}~XnXx*t|�D]\}}d|krL|j|d�qLW|S)z Collect the list of mapIDs z$Could not parse bpftool map list: %sNr)rr
rrrr)rZmap_jsonrZmap_datarrrrrr�get_bpftool_map_ids%szEbpf.get_bpftool_map_idsc
Cs�|jd�}x6|j|d�D]$}xdD]}|jd||f�q$WqW|jd�}x$|j|d�D]}|jd|�q\W|jdd	d
ddg�d
}|jd�}x.|j|d�D]}||d}	|j|	d�q�WdS)Nzbpftool -j prog list�output�xlated�jitedzbpftool prog dump %s id %szbpftool -j map listzbpftool map dump id %szbpftool prog listzbpftool map listzbpftool cgroup treezbpftool net listzbpftool struct_ops dumpzip netns exec r	)Zns_max� )rr)Zcollect_cmd_outputrZadd_cmd_outputrZ
get_optionZget_network_namespaces)
rZprogsZprog_idZdumpcmd�mapsZmap_idZ
cmd_prefixZnsps�	namespaceZ
ns_cmd_prefixrrr�setup2s&



z
Ebpf.setup)rrr)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesr�intZoption_listrrr!rrrrr
s


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

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists