HEX
Server: Apache
System: Linux insrv.serversdaddy.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
User: jsaha (1066)
PHP: 8.3.6
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3.9/site-packages/sos/report/plugins/__pycache__/process.cpython-39.opt-1.pyc
a

^��c{�@s:ddlZddlZddlmZmZmZGdd�dee�ZdS)�N)�Plugin�IndependentPlugin�	PluginOptc
@sleZdZdZdZdZedddd�edd	d
d�edd	dd�ed
dedd�eddedd�gZdd�Z	dd�Z
dS)�Processzprocess informationZprocess)�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)rZval_typer	�numprocsiz*number of process to collect /proc data ofc	CsZd}d}d}|d7}|�ddg�dd�|�d	�D�}|�d
�rR|d|�d
��}|D],}|�d|d|d
|d|d|g�qV|�d�r�|�d�|jddgd�dd�|jddd�|�d�r�|jdddddd�|�d�r�|jd ddd!�|jd"d#gd$d%�|�d&||fd&||fg�|�d'��rH|jd(|�d'�d)d*�|�d+d,g�dS)-Nzps axoz3pid,ppid,user,group,lwp,nlwp,start_time,comm,cgroupz2flags,state,uid,pid,ppid,pgid,sid,cls,pri,addr,sz,zwchan:20,lstart,tty,time,cmdz/proc/sched_debugz
/proc/statcSsg|]}t�d|�r|�qS)z[0-9])�re�match)�.0�p�r�>/usr/lib/python3.9/site-packages/sos/report/plugins/process.py�
<listcomp>-�z!Process.setup.<locals>.<listcomp>z/procrz/proc/%s/statusz/proc/%s/cpusetz/proc/%s/oom_*z/proc/%s/stackz/proc/%s/limitsrz/proc/[0-9]*/smapsz
ps auxwwwmZps)Zps_auxZps_auxwwZ	ps_auxwwwZ
ps_auxwwwmZ	ps_auxcww�)�root_symlink�tags�priorityz
pstree -lpZpstree)rrzlsof +M -n -l -c ''��2)r�timeoutrrr
z
lsof +M -n -l)rrz	ps alxwwwzps -elfLT)Z
cmd_as_tagz%s %srziotop -b -o -d 0.5 -t -n %s�d)rz#pidstat -p ALL -rudvwsRU --human -hzpidstat -tl)Z
add_copy_spec�listdirZ
get_optionZadd_cmd_output)�selfZps_axoZ
ps_group_optsZ
ps_sched_optsZprocs�procrrr�setup!sh�
�

�
�
��

����z
Process.setupcCs|�d���}|jjjs0|�d�Wd�dS|�d�}i}i}|ddksr|�d|d���Wd�dS|d��D]X}|����}|d}|d}|�	|�s�q~||vr�|jj�
|�||<|||d	�||<q~|�tj|dd
��Wd�n1�s0YdS)Nzpids_to_packages.jsonz/Package manager not configured for path querieszps --no-headers aex�statusrzUnable to get process list: �output�)�path�package)�indent)
Zcollection_fileZpolicyZpackage_managerZquery_path_command�writeZexec_cmd�
splitlines�strip�splitZpath_existsZpkg_by_path�json�dumps)r ZpfileZ_psZpidpkg�pathsr!�pidr&rrr�collect]s(



zProcess.collectN)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesr�intZoption_listr"r1rrrrrs"����<r)r-rZsos.report.pluginsrrrrrrrr�<module>	s