Current File : //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/process.cpython-312.pyc
�

-�_g*��@�ddlZddlZddlmZmZmZGd�dee�Zy)�N)�Plugin�IndependentPlugin�	PluginOptc
��eZdZdZdZdZeddd��edd	d
��edd	d��ed
ded��edded��gZd�Z	d�Z
y)�Processzprocess information�process)�system�lsofTzcollect info on all open files)�default�desc�lsof-threadsFz,collect threads' open file info if supported�smapszcollect /proc/*/smaps files�samples�z"number of iotop samples to collect)r�val_typer�numprocsiz*number of process to collect /proc data ofc
��d}d}d}|dz
}|jgd��|jd�D�cgc]}tjd|�s�|��}}|j	d�r|d|j	d�}|D],}|jd	|�d
�d	|�d�d	|�d�d	|�d
�d	|�d�g��.|j	d�r|jd�|jddgd�d��|jdd��|j	d�r|jddddd��|j	d�r|jddd� �|jgd!�d"�#�|j|�d$|��|�d$|��g�|j	d%�r%|jd&|j	d%���d'�(�|jd)d*g�ycc}w)+Nzps axoz3pid,ppid,user,group,lwp,nlwp,start_time,comm,cgroupz3flags,state,uid,pid,ppid,pgid,sid,cls,pri,psr,addr,zsz,wchan:20,lstart,tty,time,cmd)z/proc/sched_debugz
/proc/statz/sys/kernel/debug/sched/debugz /sys/kernel/debug/sched/featuresz/sys/kernel/sched_ext/z/procz[0-9]rz/proc/z/statusz/cpusetz/oom_*z/stackz/limitsrz/proc/[0-9]*/smapsz
ps auxwwwm�ps)�ps_aux�ps_auxww�	ps_auxwww�
ps_auxwwwm�	ps_auxcww�)�root_symlink�tags�priorityz
pstree -lp�pstree)rr
zlsof +M -n -l -c ''��2)r�timeoutrrr
z
lsof +M -n -l)r!r)z	ps alxwwwz
ps auxfwwwzps -elfLT)�
cmd_as_tag� rziotop -b -o -d 0.5 -t -n �d)rz#pidstat -p ALL -rudvwsRU --human -hzpidstat -tl)�
add_copy_spec�listdir�re�match�
get_option�add_cmd_output)�self�ps_axo�
ps_group_opts�
ps_sched_opts�p�procs�procs       �</usr/lib/python3/dist-packages/sos/report/plugins/process.py�setupz
Process.setup!s&����M�
�M�
��:�:�
����
�	�!�L�L��1�J�q�R�X�X�g�q�5I��J��J��?�?�:�&��6�4�?�?�:�6�7�E��	�D�������g�&����g�&����f�%����f�%����g�&� �
�	��?�?�7�#����3�4����L�t�"=�%&�	�	(�
	
���L�x��@��?�?�6�"���� 5�F�(*�R�f�
 �
F��?�?�>�*������b��I����
��		�	�	
����h�a�
��'��h�a�
��'�
�	�
�?�?�9�%���� ;�#'�?�?�9�#=�">�!@�),�
 �
.�	
���1��
�	��[Ks�F>�F>c��|jd�5}|jjjs|j	d�	ddd�y|jd�}i}i}|ddk(s!|j	d|d���	ddd�y|dj
�D]s}|j�j�}|d}|d}|j|�s�=||vr(|jjj|�||<|||d	�||<�u|j	tj|d�
��ddd�y#1swYyxYw)Nzpids_to_packages.jsonz/Package manager not configured for path querieszps --no-headers aex�statusrzUnable to get process list: �output�)�path�package)�indent)
�collection_file�policy�package_manager�query_path_command�write�exec_cmd�
splitlines�strip�split�path_exists�pkg_by_path�json�dumps)r+�pfile�_ps�pidpkg�pathsr1�pidr8s        r2�collectzProcess.collectbsI��
�
!�
!�"9�
:�	6�e��;�;�.�.�A�A����M�N��	6�	6��-�-� 5�6�C��F��E��x�=�A�%����:�3�x�=�/�J�K��	6�	6��H�
�0�0�2�
E���z�z�|�)�)�+���1�g���A�w���'�'��-���u�$�"&�+�+�"=�"=�"I�"I�$�"O�E�$�K�'+��d��D��s��
E�
�K�K��
�
�6�!�4�5�)	6�	6�	6�s�3E�5E�B/E�E
N)�__name__�
__module__�__qualname__�
short_desc�plugin_name�profilesr�int�option_listr3rM��r2rrsr��&�J��K��H�	�&�$�-M�N��.�%�F�	H��'�5�/L�M��)�R�#�;�	=��*�d�S�C�	E�	�K�?�B6rWr)rFr'�sos.report.pluginsrrrrrVrWr2�<module>rYs$���	�C�C�h6�f�'�h6rW