HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux ns565604.ip-54-39-133.net 4.18.0-553.50.1.el8_10.x86_64 #1 SMP Tue Apr 15 08:09:22 EDT 2025 x86_64
User: greer489 (1034)
PHP: 8.3.19
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/sos/report/plugins/__pycache__/ebpf.cpython-36.pyc
3

-�_gq�@s2ddlZddlmZmZmZGdd�dee�ZdS)�N)�Plugin�IndependentPlugin�	PluginOptc@sFeZdZdZdZdZdZedded	d
�gZ	dd�Z
d
d�Zdd�ZdS)�Ebpfz	eBPF toolZebpf�system�kernel�network�bpftool�
namespacesNz0Number of namespaces to collect, 0 for unlimited)�defaultZval_typeZdesccCstg}ytj|�}Wn0tk
rB}z|jd|���|Sd}~XnXx*t|�D]\}}d|krN|j|d�qNW|S)z! Collect the list of program IDs z"Couldn't parse bpftool prog list: N�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_idscCstg}ytj|�}Wn0tk
rB}z|jd|���|Sd}~XnXx*t|�D]\}}d|krN|j|d�qNW|S)z Collect the list of mapIDs z"Could not parse bpftool map list: Nr)r
rrrrr)rZmap_jsonrZmap_datarrrrrr�get_bpftool_map_ids&szEbpf.get_bpftool_map_idsc
Cs�|jd�}x:|j|d�D](}x"dD]}|jd|�d|���q$WqW|jd�}x&|j|d�D]}|jd|���q`W|jd	d
ddd
g�d}|jd�}x.|j|d�D]}||d}	|j|	d�q�WdS)Nzbpftool -j prog list�output�xlated�jitedzbpftool 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� )rr)Zcollect_cmd_outputrZadd_cmd_outputrZ
get_optionZget_network_namespaces)
rZprogsZprog_idZdumpcmd�mapsZmap_idZ
cmd_prefixZnsps�	namespaceZ
ns_cmd_prefixrrr�setup3s$



z
Ebpf.setup)rrr)r	)
�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZcommandsr�intZoption_listrrr"rrrrr
s


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