Viewing File: /opt/alt/python38/lib64/python3.8/site-packages/psutil/__pycache__/_psaix.cpython-38.pyc
U
Œ=Ý_{H ã @ sØ d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl m
Z
ddl mZ ddl mZ
ddl mZ dd l
mZ dd
l
mZ ddl
mZ ddl
mZ dd
l
mZ ddl
mZ ddl
mZ ddl
mZ ddl
mZ ddl
mZ ddlmZ ddlmZ ddlmZ ddlmZ dgZe e
dƒZ!e e
dƒZ"e e
dƒZ#e $¡ Z%ej&Z&e
j'e
j(e
j)e
j*e
j+e
j,e
j-e
j,e
j.e
j/iZ0e
j1e
j2e
j3e
j4e
j5e
j6e
j7e
j8e
j9e
j:e
j;e
j<e
j=e
j>e
j?e
j@e
jAe
jBe
jCe
jDe
jEe
jFe
jGe
jHiZIeJdddddddd d!ZKed"d#d$gƒZLeLZMed%d&d'd(d)gƒZNed*d+d,d-d.d/gƒZOd0d1„ ZPd2d3„ ZQd4d5„ ZRd6d7„ ZSd8d9„ ZTd:d;„ ZUd<d=„ ZVe
jWZWejXZXdRd?d@„ZYejZZZe"rŠe
j[Z[dSdBdC„Z\dDdE„ Z]dFdG„ Z^dHdI„ Z_dJdK„ Z`dLdM„ ZadNdO„ ZbG dPdQ„ dQecƒZddS )TzAIX platform implementation.é N)Ú
namedtupleé )Ú_common)Ú_psposix)Ú_psutil_aix)Ú
_psutil_posix)ÚAccessDenied)Úconn_to_ntuple)Úget_procfs_path)Úmemoize_when_activated)ÚNIC_DUPLEX_FULL)ÚNIC_DUPLEX_HALF)ÚNIC_DUPLEX_UNKNOWN)Ú
NoSuchProcess)Ú
usage_percent)Ú
ZombieProcess)ÚFileNotFoundError)ÚPermissionError)ÚProcessLookupError)ÚPY3ZPROCFS_PATHÚproc_threadsÚnet_io_countersÚproc_io_countersé é é é é é )ÚppidÚrssÚvmsÚcreate_timeÚniceÚnum_threadsÚstatusÚttynrÚpmemr r! Ú scputimesÚuserÚsystemZidleZiowaitÚsvmemÚtotalZ availableÚpercentÚusedÚfreec C s4 t ¡ \} }}}}t| | | dd}t| ||||ƒS )Nr ©Zround_)ÚcextZvirtual_memr r+ )r, Zavailr/ ZpinnedZinuser- © r2 ú@/opt/alt/python38/lib64/python3.8/site-packages/psutil/_psaix.pyÚvirtual_memoryj s r4 c C s: t ¡ \} }}}| | }t|| dd}t | |||||¡S )z=Swap system memory as a (total, used, free, sin, sout) tuple.r r0 )r1 Zswap_memr r Zsswap)r, r/ ZsinZsoutr. r- r2 r2 r3 Úswap_memoryp s r5 c C s t ¡ } tdd„ t| Ž D ƒŽ S )z-Return system-wide CPU times as a named tuplec S s g | ]}t |ƒ‘qS r2 )Úsum©Ú.0Úxr2 r2 r3 Ú
<listcomp>€ s zcpu_times.<locals>.<listcomp>)r1 Ú
per_cpu_timesr( Úzip©Úretr2 r2 r3 Ú cpu_times} s r? c C s t ¡ } dd„ | D ƒS )z5Return system per-CPU times as a list of named tuplesc S s g | ]}t |Ž ‘qS r2 )r( r7 r2 r2 r3 r: † s z!per_cpu_times.<locals>.<listcomp>)r1 r; r= r2 r2 r3 r; ƒ s r; c C s( zt d¡W S tk
r" Y dS X dS )z0Return the number of logical CPUs in the system.ÚSC_NPROCESSORS_ONLNN)ÚosÚsysconfÚ
ValueErrorr2 r2 r2 r3 Úcpu_count_logical‰ s rD c C sr d} t j| dt jt jd}| ¡ \}}tr@dd„ ||fD ƒ\}}|jdkrZtd| |f ƒ‚| ¡ ¡ }t |ƒppd S )Nzlsdev -Cc processorT)ÚshellÚstdoutÚstderrc S s g | ]}| tjj¡‘qS r2 ©ÚdecodeÚsysrF Úencodingr7 r2 r2 r3 r: ˜ s ÿz&cpu_count_physical.<locals>.<listcomp>r z%r command error
%s)
Ú
subprocessÚPopenÚPIPEÚcommunicater Ú
returncodeÚRuntimeErrorÚstripÚ
splitlinesÚlen)ÚcmdÚprF rG Z
processorsr2 r2 r3 Úcpu_count_physical’ s ÿÿ
rW c C s t ¡ \} }}}t | |||¡S )z*Return various CPU stats as a named tuple.)r1 Ú cpu_statsr Z scpustats)Zctx_switchesZ
interruptsZsoft_interruptsZsyscallsr2 r2 r3 rX s ÿrX Fc C sh g }t ¡ }|D ]R}|\}}}}|dkr,d}| s<t|ƒjs<qd }} t |||||| ¡}
| |
¡ q|S )zReturn system disk partitions.ZnoneÚ N)r1 Údisk_partitionsÚ
disk_usager, r Z sdiskpartÚappend)ÚallÚretlistZ
partitionsÚ partitionZdeviceZ
mountpointZfstypeZoptsZmaxfileZmaxpathÚntupler2 r2 r3 rZ ° s
ÿrZ éÿÿÿÿc C s¬ t j}| |kr.td| d dd„ |D ƒ¡f ƒ‚t j| \}}t |¡}g }|D ]X}|\}} }
}}}
}| |krnqN|
|krxqNt|| |
|||
t|dkr”|ndd}| |¡ qN|S )zˆReturn socket connections. If pid == -1 return system-wide
connections (as opposed to connections opened by one process only).
z+invalid %r kind argument; choose between %sz, c S s g | ]}t |ƒ‘qS r2 )Úreprr7 r2 r2 r3 r: Ù s z#net_connections.<locals>.<listcomp>ra N©Úpid) r Z conn_tmaprC Újoinr1 Únet_connectionsr ÚTCP_STATUSESr\ )ÚkindÚ_pidZcmapZfamiliesÚtypesÚrawlistr>