File: //lib/python3.9/site-packages/sos/report/plugins/__pycache__/ebpf.cpython-39.opt-1.pyc
a
\��hq � @ 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&