%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib64/python3.9/site-packages/psutil/__pycache__/
Upload File :
Create Path :
Current File : //lib64/python3.9/site-packages/psutil/__pycache__/_pslinux.cpython-39.pyc

a

M�_�@�
@s�dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"ddlm#Z#ddlm$Z$ddlm%Z%ddlm&Z&ddlm'Z'ddlm(Z(ddlm)Z)ddl*m+Z+ddl*m,Z,ddl*m-Z-dd l*m.Z.dd!l*m/Z/dd"l*m0Z0ej1d#k�r�ddl2Z2ndZ2gd$�Z3d%Z4ej5�6d&e�7��Z8e9ed'�Z:e9ed(�Z;e<�Z=e�>d)�Z?e�@�ZAdaBe0�rLd*nd+ZCejDd,kZEd-ZFe2du�rpe
jGZHne2�Id.d/eJe
jG�i�ZKeKjHZHe2du�r�dZLdZMd0ZNd1ZOn Gd2d3�d3e2jI�ZPeQ��RePjS�ejTejUejVejWejXejYejZejZej[ej\ej]ej^d4�Z_ej`ejaejbejcejdejeejfejgejhejiejjd5�Zked6gd7��Zled8gd9��Zmed:gd;��Zned<d=�Zoed>eojpd?�Zqed@gdA��ZredBdCdD�serjp��ZtedEgdF��ZuedGgdH��ZvdIdJ�ZwdKdL�ZxdMdN�ZyedOdP��Zze=dQfdRdS�Z{zezdT�Wn.e|�y e
�}�edUdV�dWdWdW�a~Yn0dZzddXl�mZWn@e��yvddl�Z�e�j�ddQdY�Z�e9e�dZ��rrd�d[dZ�ZYn0edu�r�e3��d\d]�e�e�D��d^d_�Z�d`da�Z�dbdc�Z�ddde�Z�dfdg�Z�dhdi�Z�djdk�Z�dldm�Z�ej5�6dn��s�ej5�6do��rdpdq�Z�n ej5�6dr��rdsdq�Z�ndtdq�Z�ej�Z�Gdudv�dve|�Z�Gdwdx�dx�Z�e��Z�d�dzd{�Z�d|d}�Z�d~d�Z�ej�Z�d�d�d��Z�d�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�Gd�d��d�e<�Z�dS)�zLinux platform implementation.�)�divisionN)�defaultdict)�
namedtuple�)�_common)�_psposix)�
_psutil_linux)�
_psutil_posix)�AccessDenied)�debug)�decode)�get_procfs_path)�
isfile_strict)�memoize)�memoize_when_activated)�NIC_DUPLEX_FULL)�NIC_DUPLEX_HALF)�NIC_DUPLEX_UNKNOWN)�
NoSuchProcess)�open_binary)�	open_text)�parse_environ_block)�path_exists_strict)�
supports_ipv6)�
usage_percent)�
ZombieProcess)�b)�
basestring)�FileNotFoundError)�PermissionError)�ProcessLookupError)�PY3)��)ZPROCFS_PATH�IOPRIO_CLASS_NONE�IOPRIO_CLASS_RT�IOPRIO_CLASS_BE�IOPRIO_CLASS_IDLE�CONN_ESTABLISHED�
CONN_SYN_SENT�
CONN_SYN_RECV�CONN_FIN_WAIT1�CONN_FIN_WAIT2�CONN_TIME_WAIT�
CONN_CLOSE�CONN_CLOSE_WAIT�
CONN_LAST_ACK�CONN_LISTEN�CONN_CLOSINGz/sys/class/power_supplyz/proc/%s/smaps�proc_ioprio_get�proc_cpu_affinity_get�
SC_CLK_TCK���i �littlei�
AddressFamily�AF_LINK�r"c@seZdZdZdZdZdZdS)�
IOPriorityrrr:r"N)�__name__�
__module__�__qualname__r$r%r&r'�r?r?�5/usr/lib64/python3.9/site-packages/psutil/_pslinux.pyr;wsr;)�R�S�D�T�t�Z�X�x�K�W�I�P)Z01Z02Z03Z04Z05Z06Z07Z08Z09Z0AZ0B�svmem)�total�	available�percent�used�free�active�inactive�buffers�cached�shared�slab�sdiskio)	�
read_count�write_count�
read_bytes�write_bytesZ	read_timeZ
write_timeZread_merged_countZwrite_merged_count�	busy_time�	popenfile)�path�fdZposition�mode�flags�pmemz"rss vms shared text lib data dirty�pfullmem)�uss�pss�swap�
pmmap_grouped)r`�rss�sizergZshared_cleanZshared_dirtyZ
private_cleanZ
private_dirtyZ
referencedZ	anonymousrh�	pmmap_extzaddr perms � �pio)rZr[r\r]Z
read_charsZwrite_chars�	pcputimes)�user�system�
children_user�children_system�iowaitcCsLt|t�sJ|��t�|�}|�d�d}|�d�rHt|�sH|dd�}|S)zWrapper around os.readlink().�r�
 (deleted)N���)�
isinstancer�os�readlink�split�endswithr)r`r?r?r@rz�s
rzcCsXtjdtjdtjdi}||tjtjBtjB@}|tj@rH|�ddd�}|�dd�}|S)zZConvert file's open() flags into a readable string.
    Used by Process.open_files().
    �r�wzw+�arzr+)ry�O_RDONLY�O_WRONLY�O_RDWR�O_APPEND�replace)rcZ	modes_maprbr?r?r@�file_flags_to_mode�s
r�cCs4|�dd�}d}|rd|}nd|}t�|tj�S)z�Return True if the given name refers to a root device (e.g.
    "sda", "nvme0n1") as opposed to a logical partition (e.g.  "sda1",
    "nvme0n1p1"). If name is a virtual device (e.g. "loop1", "ram")
    return True.
    �/�!Tz
/sys/block/%sz/sys/block/%s/device)r�ry�access�F_OK)�nameZincluding_virtualr`r?r?r@�is_storage_device�s

r�cCs�td|��$}|����dd�}Wd�n1s60Ygd�}t|�}|dkrb|�d�|dkrt|�d�|d	kr�|�d
�td|�adS)z�Set a namedtuple of variable fields depending on the CPU times
    available on this Linux kernel version which may be:
    (user, nice, system, idle, iowait, irq, softirq, [steal, [guest,
     [guest_nice]]])
    Used by cpu_times() function.
    �%s/statrN)rp�nicerqZidlertZirqZsoftirq�Zsteal�	Zguest�
Z
guest_nice�	scputimes)r�readliner{�len�appendrr�)�procfs_path�f�values�fieldsZvlenr?r?r@�set_scputimes_ntuples	2


r�Tc	CstzF|rt|�nt|��}|����Wd�WS1s:0YWn(ttfyn|turh|YS�Yn0dS)z�Return file content.
    fallback: the value returned in case the file does not exist or
              cannot be read
    binary: whether to open the file in binary or text mode.
    N)rr�read�strip�IOError�OSError�_DEFAULT)�fname�fallback�binaryr�r?r?r@�cats0r��/procr�zuser system idle�)�prlimit)Z	use_errnor�cCs�Gdd�dtj�}|�}|dur8t�||dt�|��}n6|�}|d|_|d|_t�||t�|�t�|��}|dkr�t��}t|t	�
|���|j|jfS)Nc@s eZdZdejfdejfgZdS)zprlimit.<locals>.StructRlimit�rlim_cur�rlim_maxN)r<r=r>�ctypesZ
c_longlongZ_fields_r?r?r?r@�StructRlimitJs�r�rr)r�Z	Structure�libcr�Zbyrefr�r�Z	get_errnor�ry�strerror)�pid�	resource_�limitsr��current�ret�new�errnor?r?r@r�Is

�cCs"g|]}|�d�r|��r|�qS)ZRLIM)�
startswith�isupper��.0rHr?r?r@�
<listcomp>b�r�cCs|d}||�dd�}z|d}|d}|d}WntyJ|YS0ztdt��}Wntyt|YS0d}|�@|D]*}|��}|�d�r�|t|��d	�7}q�Wd
�n1s�0Y|t	9}||}	||}
|
t
|
d|�8}
|	|
7}	|	|t
|d|�7}	t|	�S)
a�Fallback for kernels < 3.14 where /proc/meminfo does not provide
    "MemAvailable:" column, see:
    https://blog.famzah.net/2014/09/24/
    This code reimplements the algorithm outlined here:
    https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
        commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773

    XXX: on recent kernels this calculation differs by ~1.5% than
    "MemAvailable:" as it's calculated slightly differently, see:
    https://gitlab.com/procps-ng/procps/issues/42
    https://github.com/famzah/linux-memavailable-procfs/issues/2
    It is still way more realistic than doing (free + cached) though.
    �MemFree:�Cached:rs
Active(file):sInactive(file):�
SReclaimable:z%s/zoneinfoslowrNr:g@)�get�KeyErrorrr
r�r�r��intr{�PAGESIZE�min)�memsrRr�Zlru_active_fileZlru_inactive_fileZslab_reclaimabler�Z
watermark_low�line�availZ	pagecacher?r?r@�calculate_avail_vmemjs2


4r�cCs�g}i}tdt���:}|D]$}|��}t|d�d||d<qWd�n1sV0Y|d}|d}z|d}Wn ty�d}|�d	�Yn0z|d
}Wn ty�d}|�d�Yn0||�dd�7}z|d
}	WnDt�y,z|d}	Wn"t�y&d}	|�d�Yn0Yn0z|d}
Wn"t�y\d}
|�d�Yn0z|d}WnTt�y�z|d|d|d}Wn"t�y�d}|�d�Yn0Yn0z|d}Wnt�y�d}Yn0||||}
|
dk�r||}
z|d}Wnt�y0t|�}Yn0|dk�rJd}|�d�||k�rX|}t|||dd�}|�r�dd�	|�t
|�dk�r�dndf}t�|t
�t||||
||
||||	|�S)a�Report virtual memory stats.
    This implementation matches "free" and "vmstat -s" cmdline
    utility values and procps-ng-3.3.12 source was used as a reference
    (2016-09-18):
    https://gitlab.com/procps-ng/procps/blob/
        24fd2605c51fccc375ab0287cec33aa767f06718/proc/sysinfo.c
    For reference, procps-ng-3.3.10 is the version available on Ubuntu
    16.04.

    Note about "available" memory: up until psutil 4.3 it was
    calculated as "avail = (free + buffers + cached)". Now
    "MemAvailable:" column (kernel 3.14) from /proc/meminfo is used as
    it's more accurate.
    That matches "available" column in newer versions of "free".
    �
%s/meminfor�rNs	MemTotal:r�sBuffers:rUr�rVr�sShmem:s
MemShared:rWsActive:rSs	Inactive:sInact_dirty:sInact_clean:sInact_laundry:rTsSlab:s
MemAvailable:rO�Zround_z6%s memory stats couldn't be determined and %s set to 0�, ZwasZwere)rr
r{r�r�r�r�r�r�joinr��warnings�warn�RuntimeWarningrM)Zmissing_fieldsr�r�r�r�rNrRrUrVrWrSrTrXrQr�rP�msgr?r?r@�virtual_memory�s�8���

	


��r�c
Cs�i}tdt���:}|D]$}|��}t|d�d||d<qWd�n1sR0Yz|d}|d}Wn8ty�t��\}}}}}}}||9}||9}Yn0||}t||dd�}	ztd	t��}WnFt�y}
z,d
t	|
�}t
�|t�d}}
WYd}
~
n�d}
~
00|��d}}
|D]n}|�
d��rXt|�d�d�d
d}n&|�
d��r~t|�d�d�d
d}
|du�r,|
du�r,�q��q,d}t
�|t�d}}
Wd�n1�s�0Yt�||||	||
�S)zReturn swap memory metrics.r�rr�rNs
SwapTotal:s	SwapFree:r�z	%s/vmstatzP'sin' and 'sout' swap memory stats couldn't be determined and were set to 0 (%s)spswpin� r#spswpoutzK'sin' and 'sout' swap memory stats couldn't be determined and were set to 0)rr
r{r�r��cextZ
linux_sysinforr��strr�r�r�r�rZsswap)r�r�r�r�rNrR�_Zunit_multiplierrQrP�errr�ZsinZsoutr?r?r@�swap_memorysF8�
(r�cCsrt�}t|�td|��}|����}Wd�n1s<0Y|dttj�d�}dd�|D�}t|�S)z�Return a named tuple representing the following system-wide
    CPU times:
    (user, nice, system, idle, iowait, irq, softirq [steal, [guest,
     [guest_nice]]])
    Last 3 fields may not be available on all Linux kernel versions.
    r�NrcSsg|]}t|�t�qSr?��float�CLOCK_TICKSr�r?r?r@r�^r�zcpu_times.<locals>.<listcomp>)r
r�rr�r{r�r��_fields)r�r�r�r�r?r?r@�	cpu_timesRs*r�cCs�t�}t|�g}td|��n}|��|D]L}|�d�r,|��}|dttj�d�}dd�|D�}t|�}|�	|�q,|Wd�S1s�0YdS)zfReturn a list of namedtuple representing the CPU times
    for every CPU available on the system.
    r�scpurcSsg|]}t|�t�qSr?r�r�r?r?r@r�pr�z!per_cpu_times.<locals>.<listcomp>N)
r
r�rr�r�r{r�r�r�r�)r��cpusr�r�r�r��entryr?r?r@�
per_cpu_timesbs
r�cCs�zt�d�WSty�d}tdt���0}|D]}|���d�r2|d7}q2Wd�n1sb0Y|dkr�t�d�}t	dt���:}|D]$}|�
d	�d}|�|�r�|d7}q�Wd�n1s�0Y|dkr�YdS|YS0dS)
z0Return the number of logical CPUs in the system.�SC_NPROCESSORS_ONLNr�
%s/cpuinfos	processorrNzcpu\dr�rm)ry�sysconf�
ValueErrorrr
�lowerr��re�compilerr{�match)�numr�r��searchr?r?r@�cpu_count_logicalvs$(

(r�c
Cs2t�}d}d}t�|�p t�|�D]>}t|��"}|�|�����Wd�q"1sV0Yq"t|�}|dkrv|Si}i}tdt���~}|D]h}|����}|s�z|d||d<Wnt	y�Yn0i}q�|�
d�r�|�d	d
�\}	}
t|
�||	<q�Wd�n1�s0Yt
|���}|�p0dS)z2Return the number of physical cores in the system.z9/sys/devices/system/cpu/cpu[0-9]*/topology/core_cpus_listz?/sys/devices/system/cpu/cpu[0-9]*/topology/thread_siblings_listNrr��	cpu cores�physical id)r�r�s	:r)�set�globr�addr�r�r�r
r�r�r�r{r��sumr�)�lsZp1Zp2r`r��result�mappingZcurrent_infor��key�valuer?r?r@�cpu_count_physical�s4
2�
.r�cCs�tdt����}d}d}d}|D]r}|�d�r@t|��d�}n6|�d�r\t|��d�}n|�d�rvt|��d�}|dur |dur |dur q�q Wd�n1s�0Yd}t�||||�S)z*Return various CPU stats as a named tuple.r�Nsctxtrsintrssoftirqr)rr
r�r�r{rZ	scpustats)r�Zctx_switchesZ
interruptsZsoft_interruptsr�Zsyscallsr?r?r@�	cpu_stats�s&


�$�r�z'/sys/devices/system/cpu/cpufreq/policy0z$/sys/devices/system/cpu/cpu0/cpufreqcCs�dd�}g}tt��D]�}||�}|s(qtjj}t||d�dd�}|durlt||d�dd�}|durltd��t|�d}tt||d	���d}tt||d
���d}|�t	�
|||��q|S)z�Return frequency metrics for all CPUs.
        Contrarily to other OSes, Linux updates these values in
        real-time.
        cSs.d|d|fD]}tj�|�r|SqdS)Nz(/sys/devices/system/cpu/cpufreq/policy%sz%/sys/devices/system/cpu/cpu%s/cpufreq)ryr`�exists)r��pr?r?r@�get_path�s
�zcpu_freq.<locals>.get_pathZscaling_cur_freqN�r�Zcpuinfo_cur_freqz!can't find current frequency filei�Zscaling_max_freqZscaling_min_freq)�ranger�ryr`r�r��NotImplementedErrorr�r�r�scpufreq)r�r��nr`ZpjoinZcurrZmax_Zmin_r?r?r@�cpu_freq�s&�r�z
/proc/cpuinfoc	Csvg}tdt���P}|D]:}|���d�r|�dd�\}}|�t�t|�dd��qWd�n1sh0Y|S)z}Alternate implementation using /proc/cpuinfo.
        min and max frequencies are not available and are set to None.
        r�scpu mhz�:rr�N)	rr
r�r�r{r�rr�r�)r�r�r�r�r�r?r?r@r��s8cCsgS)zGDummy implementation when none of the above files are present.
        r?r?r?r?r@r�sc@seZdZdS)�_Ipv6UnsupportedErrorN)r<r=r>r?r?r?r@r�sr�c@sZeZdZdZdd�Zdd�Zdd�Zedd	��Zeddd��Z	edd
d��Z
ddd�Zd
S)�ConnectionsawA wrapper on top of /proc/net/* files, retrieving per-process
    and system-wide open connections (TCP, UDP, UNIX) similarly to
    "netstat -an".

    Note: in case of UNIX sockets we're only able to determine the
    local endpoint/path, not the one it's connected to.
    According to [1] it would be possible but not easily.

    [1] http://serverfault.com/a/417946
    cCs�dtjtjf}dtjtjf}dtjtjf}dtjtjf}dtjdf}|||||f||f|f|f||f|f|f|f||||f||f||fd�|_d|_dS)N�tcp�tcp6�udp�udp6�unix)�allr�tcp4rr�udp4rr�inetZinet4Zinet6)�socket�AF_INET�SOCK_STREAM�AF_INET6Z
SOCK_DGRAMZAF_UNIX�tmap�_procfs_path)�selfrrrrrr?r?r@�__init__ s$
�
zConnections.__init__cCs�tt�}t�d|j|f�D]�}ztd|j||f�}WnVttfyRYqYqty�}z&|j	t	j
krxWYd}~q�WYd}~qd}~00|�d�r|dd�dd�}||�|t
|�f�q|S)N�%s/%s/fd�%s/%s/fd/%szsocket:[r�r6)r�listry�listdirrrzrr r�r��EINVALr�r�r�)rr��inodesra�inoder�r?r?r@�get_proc_inodes7s
zConnections.get_proc_inodescCsFi}t�D]6}z|�|�|��Wq
tttfy>Yq
Yq
0q
|S�N)�pids�updaterrr r)rrr�r?r?r@�get_all_inodesMs
zConnections.get_all_inodesc	Cs�|�d�\}}t|d�}|s dStr.|�d�}|tjkrntrZt�|t�	|�ddd��}q�t�|t�	|��}n~t�	|�}zRtr�t�tj
tjdgt�
d|��R��}n$t�tj
tjdgt�
d|��R��}Wn ty�t�s�t�n�Yn0t�||�S)	a�Accept an "ip:port" address as displayed in /proc/net/*
        and convert it into a human readable form, like:

        "0500000A:0016" -> ("10.0.0.5", 22)
        "0000000000000000FFFF00000100007F:9E49" -> ("::ffff:127.0.0.1", 40521)

        The IP address portion is a little or big endian four-byte
        hexadecimal number; that is, the least significant byte is listed
        first, so we need to reverse the order of the bytes to convert it
        to an IP address.
        The port is represented as a two-byte hexadecimal number.

        Reference:
        http://linuxdevcenter.com/pub/a/linux/2000/11/16/LinuxAdmin.html
        �:�r?�asciiNr6z>4Iz<4I)r{r�r!�encoder
r�
LITTLE_ENDIANZ	inet_ntop�base64Z	b16decoder
�struct�pack�unpackr�rr�r�addr)r'�familyZip�portr?r?r@�decode_address]s4



��zConnections.decode_addressNccsR|�d�rtj�|�sdSt|td���}|��t|d�D]�\}}z(|��dd�\
}}	}
}}}}}}}Wn$t	y�t
d|||f��Yn0||vr�||d\}
}nd\}
}|dur�||
kr�q<q<|tjkr�t
|}ntj}zt�|	|�}	t�|
|�}
Wnt�yYq<Yn0||||	|
||
fVq<Wd�n1�sD0YdS)	z.Parse /proc/net/tcp* and /proc/net/udp* files.�6N��	bufferingrr�z,error while parsing %s; malformed line %s %rr�Nr6)r|ryr`r�r�BIGFILE_BUFFERINGr��	enumerater{r��RuntimeErrorr
r�TCP_STATUSESr�	CONN_NONErr*r�)�filer(�type_r�
filter_pidr��linenor�r��laddr�raddr�statusrr�rar?r?r@�process_inet�s8���



zConnections.process_inetc
cst|td���}|��|D]�}|��}z|dd�\}}}}}}}	Wn.tyrd|vr^Yqtd||f��Yn0|	|vr�||	}
ndg}
|
D]b\}}|dur�||kr�q�q�t|�dkr�|d	}
nd
}
t�t	|��}d
}tj
}||||
|||fVq�qWd�n1�s0YdS)zParse /proc/net/unix files.r,r�rmz)error while parsing %s; malformed line %rr.Nr�r6�)rr/r�r{r�r1r�rZsocktype_to_enumr�r3)r4r(rr6r�r��tokensr�r5r�pairsr�rar`r9r:r?r?r@�process_unix�s6��


zConnections.process_unixcCs||jvr,td|d�dd�|jD��f��t�|_|durP|�|�}|sXgSn|��}t�}|j|D]�\}}}d|j|f}|tj	tj
fvr�|j|||||d�}	n|j||||d�}	|	D]L\}
}}}}}
}|r�t
�|
|||||
�}nt
�|
|||||
|�}|�|�q�qht|�S)Nz+invalid %r kind argument; choose between %sr�cSsg|]}t|��qSr?)�reprr�r?r?r@r��r�z(Connections.retrieve.<locals>.<listcomp>z	%s/net/%s)r6)rr�r�r
rrrr�r
rr
r;r@rZpconnZsconnr�r)r�kindr�rr�Z
proto_namer(r5r`r�rar8r9r:Z	bound_pidZconnr?r?r@�retrieve�s<
�

����zConnections.retrieve)N)N)N)r<r=r>�__doc__rrr�staticmethodr*r;r@rCr?r?r?r@rs
2'%rr	cCs
t�|�S)z$Return system-wide open connections.)�_connectionsrC)rBr?r?r@�net_connectionssrGcCs�tdt���}|��}Wd�n1s,0Yi}|dd�D]�}|�d�}|dkshJt|���|d|���}||dd�����}tt|�\}}}	}
}}}
}}}}}}}}}|||||	||
|f||<qF|S)zsReturn network I/O statistics for every network interface
    installed on the system as a dict of raw tuples.
    z
%s/net/devNr:rrr)	rr
�	readlines�rfindrAr�r{�mapr�)r��lines�retdictr��colonr�r�Z
bytes_recvZpackets_recvZerrinZdropinZfifoinZframeinZcompressedinZmulticastinZ
bytes_sentZpackets_sentZerroutZdropoutZfifooutZ
collisionsoutZ
carrieroutZ
compressedoutr?r?r@�net_io_counterss:&
��
rNc	Cs�tjttjttjti}t���}i}|D]v}z&t	�
|�}t	�|�}t�|�\}}Wn2t
y�}z|jtjkrp�WYd}~q(d}~00t�|||||�||<q(|S)z)Get NIC stats (isup, duplex, speed, mtu).N)r�ZDUPLEX_FULLrZDUPLEX_HALFrZDUPLEX_UNKNOWNrrN�keys�
cext_posixZ
net_if_mtuZnet_if_is_runningZnet_if_duplex_speedr�r�ZENODEVrZ	snicstats)	Z
duplex_map�namesr�r�ZmtuZisupZduplexZspeedr�r?r?r@�net_if_stats+s �


rRFcCs�dd�}dd�}tj�dt��r*|�}n"tj�d�r>|�}ntdt���i}|D]T}|\
}}}}	}
}}}
}}|s~t|�s~qT|	t9}	|
t9}
|||	|
|||
||f	||<qT|S)zcReturn disk I/O statistics for every disk installed on the
    system as a dict of raw tuples.
    cssDtdt���}|��}Wd�n1s,0Y|D�]}|��}t|�}|dkr�|d}t|d�}tt|dd��\
}}}	}
}}}
}}}n�|dks�|dkr�|d}tt|dd��\}}}}	}
}}}
}}}nN|dk�r|d}tt|dd��\}}}
}d	}	}
}}}ntd
|��|||
|||	|
|||f
Vq:dS)N�%s/diskstats�r"r:r#��r<rz!not sure how to interpret line %r)rr
rHr{r�r�rJr�)r�rKr�r�Zflenr��reads�reads_merged�rbytes�rtime�writes�
writes_merged�wbytes�wtimer�r^r?r?r@�read_procfsLs4&
�
��
�
�z%disk_io_counters.<locals>.read_procfscss�t�d�D]�}t�tj�d|��D]�\}}}d|vr6q"ttj�|d��� }|������}Wd�n1sn0Ytj�	|�}t
t|dd��\
}}}	}
}}}
}}}||||	|
|
||||f
Vq"q
dS)N�
/sys/block�statr�)ryr�walkr`r�rr�r�r{�basenamerJr�)�block�rootr��filesr�r�r�rWrXrYrZr[r\r]r^r^r?r?r@�
read_sysfsws.��z$disk_io_counters.<locals>.read_sysfsrSr`zC%s/diskstats nor /sys/block filesystem are available on this system)ryr`r�r
r�r��DISK_SECTOR_SIZE)Zperdiskr_rg�genrLr�r�rWr[rYr]rZr^rXr\r^r?r?r@�disk_io_countersHs0+
����
rjc	Cs&t�}t�}td|��\}|D]F}|��}|�d�sD|�|���q|�d�d}|dkr|�d�qWd�n1sz0Y|dkr�tj�	d�r�tj�
d�}ntj�
d	|�}g}t�|�}|D]X}	|	\}
}}}|
d
kr�d}
|s�|
dks�||vr�q�d}
}t
�|
||||
|�}|�|�q�|S)z8Return mounted disk partitions as a list of namedtuples.z%s/filesystemsZnodev�	rZzfsNr�z	/etc/mtabz%s/self/mountsZnoner=)r�r
rr�r�r�r{ryr`�isfile�realpathr��disk_partitionsrZ	sdiskpartr�)rZfstypesr�r�r�ZfstypeZmounts_path�retlistZ
partitions�	partitionZdeviceZ
mountpointZoptsZmaxfileZmaxpath�ntupler?r?r@rn�s8
*
�rncCsdt�t�}t�d�}|�t�d��ttdd�|D���}t�d�}t�d�}|D]"}|�	d|�}||vrR|�
|�qR|D�]}z>|d}tt|��d	}t
j�t
j�|�d
�}t|dd�}	Wntttfy�YqzYn0t|d
dd�}
t|ddd�}t|dddd�}|
du�rBzt|
�d	}
Wnt�y@d}
Yn0|du�rvzt|�d	}Wnt�ytd}Yn0||	�
|||
|f�qz|�s\t�d�}tt|��}|D�]�}z<t
j�|d�}tt|��d	}t
j�|d�}t|dd�}	WnJtttf�y:}
z*td|
|f�WYd}
~
�q�WYd}
~
n
d}
~
00t�|d�}tdd�|D��}d}d}
|D]�}t
j�||d�}t|ddd�}|dk�r�tt
j�||d�dd�}n$|dk�r�tt
j�||d�dd�}
|
du�r
zt|
�d	}
Wnt�yd}
Yn0|du�rhzt|�d	}Wnt�y<d}Yn0�qh||	�
d||
|f��q�t|�S)a�Return hardware (CPU and others) temperatures as a dict
    including hardware name, label, current, max and critical
    temperatures.

    Implementation notes:
    - /sys/class/hwmon looks like the most recent interface to
      retrieve this info, and this implementation relies on it
      only (old distros will probably use something else)
    - lm-sensors on Ubuntu 16.04 relies on /sys/class/hwmon
    - /sys/class/thermal/thermal_zone* is another one but it's more
      difficult to parse
    z/sys/class/hwmon/hwmon*/temp*_*z&/sys/class/hwmon/hwmon*/device/temp*_*cSsg|]}|�d�d�qS�r�r�r{r�r?r?r@r��r�z(sensors_temperatures.<locals>.<listcomp>z5/sys/devices/platform/coretemp.*/hwmon/hwmon*/temp*_*z'/sys/devices/platform/coretemp.*/hwmon/z/sys/class/hwmon/�_inputg@�@r�F�r�Z_maxNr�Z_crit�_labelr=�r�r�z /sys/class/thermal/thermal_zone*Ztemp�typezignoring %r for file %rz/trip_point*cSs,g|]$}d�tj�|��d�dd���qS)r�rr")r�ryr`rcr{)r�r�r?r?r@r�%s��Z_type�criticalZ_temp�high)�collectionsrrr��extend�sortedr�r�r��subr�r�r�ryr`r��dirnamer�r�r�r�dict)r��	basenamesZ
basenames2�replr�Zaltname�baser`r��	unit_namerzry�labelr�Z
trip_pathsZtrip_pointsZ
trip_pointZ	trip_typer?r?r@�sensors_temperatures�s�

�

	






$�
�
�


r�cCs�t�t�}t�d�}|s"t�d�}ttdd�|D���}|D]�}ztt|d��}WnDtt	fy�}z(t
�d|t�WYd}~q<WYd}~n
d}~00tt
j�t
j�|�d�d	d
�}t|ddd	d
�}||�t�||��q<t|�S)a�Return hardware fans info (for CPU and other peripherals) as a
    dict including hardware label and current speed.

    Implementation notes:
    - /sys/class/hwmon looks like the most recent interface to
      retrieve this info, and this implementation relies on it
      only (old distros will probably use something else)
    - lm-sensors on Ubuntu 16.04 relies on /sys/class/hwmon
    z/sys/class/hwmon/hwmon*/fan*_*z%/sys/class/hwmon/hwmon*/device/fan*_*cSsg|]}|�d�d�qSrrrsr�r?r?r@r�Tr�z sensors_fans.<locals>.<listcomp>rtzignoring %rNr�Frurvr=rw)r{rrr�r}r�r�r�r�r�r�r�r�ryr`r�rr�rZsfanr�)r�r�r�r�r�r�r�r?r?r@�sensors_fansCs"



"�r�cs�t���fdd�}dd�t�t�D�}|s.dStj�tt|�d�}||d|d�}||d	|d
�}||d|d�}||d
�}|dur�|dur�zd||}Wq�ty�d}Yq�0n tt	|ddd��}|dkr�dSd}|tj�td�tj�td��}	|	du�r|	dk}n4t	|dddd��
�}
|
dk�r<d}n|
dv�rJd}|�rXtj}nt|du�r�|du�r�zt||d�}Wnt�y�tj
}Yn0n.|du�r�t|d�}|dk�r�tj
}ntj
}t�|||�S)aReturn battery information.
    Implementation note: it appears /sys/class/power_supply/BAT0/
    directory structure may vary and provide files with the same
    meaning but under different names, see:
    https://github.com/giampaolo/psutil/issues/966
    cs:|D]0}t|�d�}|�kr|��r,t|�n|SqdS)zvAttempt to read the content of multiple files which may
        not exist. If none of them exist return None.
        r�N)r��isdigitr�)�pathsr`r��Znullr?r@�	multi_catls
z"sensors_battery.<locals>.multi_catcSs&g|]}|�d�sd|��vr|�qS)ZBATZbattery)r�r�r�r?r?r@r�vs�z#sensors_battery.<locals>.<listcomp>Nrz/energy_nowz/charge_nowz
/power_nowz/current_nowz/energy_fullz/charge_fullz/time_to_empty_nowgY@r�z	/capacityr6r�z
AC0/onlinez	AC/onlinerz/statusr=FrwZdischarging)ZchargingZfullTi�<)�objectryr�POWER_SUPPLY_PATHr`r�r}�ZeroDivisionErrorr�r�r�rZPOWER_TIME_UNLIMITEDZPOWER_TIME_UNKNOWNZsbattery)r�ZbatsreZ
energy_nowZ	power_nowZenergy_fullZ
time_to_emptyrPZ
power_pluggedZonliner:Zsecsleftr?r�r@�sensors_batterycsh
����





r�c
Cs\g}t��}|D]F}|\}}}}}}|s*q|dvr6d}t�||pBd|||�}	|�|	�q|S)z:Return currently connected users as a list of namedtuples.)z:0.0z:0Z	localhostN)r��usersrZsuserr�)
roZrawlist�itemrpZtty�hostnameZtstampZuser_processr��ntr?r?r@r��sr�cCs�dt�}t|��^}|D]<}|�d�rt|����d�}|a|Wd�Sqtd|��Wd�n1sv0YdS)zAReturn the system boot time expressed in seconds since the epoch.r�sbtimerNzline 'btime' not found in %s)r
rr�r�r�r{�	BOOT_TIMEr1)r`r�r�r�r?r?r@�	boot_time�s


�r�cCsdd�t�tt���D�S)z7Returns a list of PIDs currently running on the system.cSsg|]}|��rt|��qSr?)r�r�r�r?r?r@r��r�zpids.<locals>.<listcomp>)ryrrr
r?r?r?r@r�src	Cs�t�|�sdSz�dt�|f}t|��\}|D]:}|�d�r,t|��d�}||kWd�WSq,td|��Wd�n1s�0YWn ttfy�|t	�vYS0dS)zcCheck for the existence of a unix PID. Linux TIDs are not
    supported (always return False).
    F�%s/%s/statussTgid:rNz'Tgid' line not found in %s)
r�
pid_existsr
rr�r�r{r��EnvironmentErrorr)r�r`r�r�Ztgidr?r?r@r��s



.r�c
Cs�i}t�}t�D]�}z<td||f��}|��}Wd�n1sD0YWnttfyfYq0|�d�}||dd���}t|d�}|||<q|S)zsObtain a {pid: ppid, ...} dict for all running processes in
    one shot. Used to speed up Process.children().
    �
%s/%s/statN�)r:r)	r
rrr�rr rIr{r�)r�r�r�r��data�rparZdset�ppidr?r?r@�ppid_maps
*

r�cst����fdd��}|S)zlDecorator which translates bare OSError and IOError exceptions
    into NoSuchProcess and AccessDenied.
    cs�z�|g|�Ri|��WSty8t|j|j��YnXtyVt|j|j��Yn:ty�tj�	d|j
|jf�s�t|j|j���Yn0dS)N�%s/%s)rr
r��_namer rrryr`r�r)r�args�kwargs��funr?r@�wrapper%sz wrap_exceptions.<locals>.wrapper)�	functools�wraps)r�r�r?r�r@�wrap_exceptions!s
r�c@sneZdZdZgd�Zdd�Zdd�Zeedd���Z	eed	d
���Z
eedd���Zd
d�Zdd�Z
edd��Zdd�Zedd��Zedd��Zedd��Zej�de���r�edd��Zedd��Zed d!��Zed\d#d$��Zed%d&��Zed'd(��Ze�r(ee�d)�e�d*�e�d+�fd,d-��Z neZ e�r>ed.d/��Z!ed0d1��Z"ee�d2�fd3d4��Z#ee�d5�fd6d7��Z$ed8d9��Z%ed:d;��Z&ed<d=��Z'e(�r�ed>d?��Z)e�d@�fdAdB�Z*edCdD��Z+e,�r�edEdF��Z-edGdH��Z.e/d"u�red]dIdJ��Z0edKdL��Z1edMdN��Z2ed^dPdQ��Z3edRdS��Z4edTdU��Z5ee�dV�fdWdX��Z6ee�dY�fdZd[��Z7d"S)_�ProcesszLinux process implementation.)r�r��_ppidr�_cachecCs||_d|_d|_t�|_dSr)r�r�r�r
r)rr�r?r?r@r;szProcess.__init__cCst�d|j|jf�dS)z+Raise NSP if the process disappeared on us.r�N)ryrarr��rr?r?r@�
_assert_aliveAszProcess._assert_alivecCs�td|j|jf��}|��}Wd�n1s20Y|�d�}||�d�d|�}||dd���}i}||d<|d|d	<|d|d
<|d|d<|d
|d<|d|d<|d|d<|d|d<|d|d<|d|d<|d|d<|S)aZParse /proc/{pid}/stat file and return a dict with various
        process info.
        Using "man proc" as a reference: where "man proc" refers to
        position N always substract 3 (e.g ppid position 4 in
        'man proc' == position 1 in here).
        The return value is cached in case oneshot() ctx manager is
        in use.
        r�Nr��(rr:r�rr:r�r#�ttynr��utime��stime�
�children_utimerU�children_stime��create_time�$�cpu_num�'�blkio_ticks)rrr�r�rI�findr{)rr�r�r�r�r�r�r?r?r@�_parse_stat_fileGs$&
zProcess._parse_stat_filecCs@td|j|jf��}|��Wd�S1s20YdS)z�Read /proc/{pid}/stat file and return its content.
        The return value is cached in case oneshot() ctx manager is
        in use.
        r�N)rrr�r��rr�r?r?r@�_read_status_filejszProcess._read_status_filecCsHtd|j|jftd��}|����Wd�S1s:0YdS)Nz%s/%s/smapsr,)rrr�r/r�r�r�r?r?r@�_read_smaps_filets
�zProcess._read_smaps_filecCs(|j�|�|j�|�|j�|�dSr)r�Zcache_activater�r�r�r?r?r@�
oneshot_enter{szProcess.oneshot_entercCs(|j�|�|j�|�|j�|�dSr)r�Zcache_deactivater�r�r�r?r?r@�oneshot_exit�szProcess.oneshot_exitcCs|��d}trt|�}|S)Nr�)r�r!r)rr�r?r?r@r��szProcess.namec	Cs�ztd|j|jf�WSttfyvtj�d|j|jf�rFYdSt|j�s`t	|j|j
��nt|j|j
|j��Yn t
y�t|j|j
��Yn0dS)Nz	%s/%s/exer�r=)rzrr�rr ryr`�lexistsr�rr�rr�rr
r�r?r?r@�exe�s
zProcess.execCs�td|j|jf��}|��}Wd�n1s20Y|sDgS|�d�rRdnd}|�|�rl|dd�}|�|�}|dkr�t|�dkr�d|vr�|�d�}|S)Nz
%s/%s/cmdlinerurmr6r)rrr�r�r|r{r�)rr�r��sep�cmdliner?r?r@r��s&


zProcess.cmdlinecCsDtd|j|jf��}|��}Wd�n1s20Yt|�S)Nz
%s/%s/environ)rrr�r�r)rr�r�r?r?r@�environ�s&zProcess.environcCs<t|��d�}t��}z
||WSty6YdS0dS)Nr�)r�r�rZget_terminal_mapr�)rZtty_nrrr?r?r@�terminal�s
zProcess.terminalz/proc/%s/ioc
Csd|j|jf}i}t|��\}|D]F}|��}|r"z|�d�\}}WntyZYq"Yq"0t|�||<q"Wd�n1s~0Y|s�td|��z,t|d|d|d|d|d|d	�WSt	�y}z"td
|d||f��WYd}~n
d}~00dS)Nz%s/%s/ios: z%s file was emptyssyscrssyscws
read_bytesswrite_bytessrcharswcharz1%r field was not found in %s; found fields are %rr)
rr�rr�r{r�r�r1rnr�)rr�r�r�r�r�r�r�r?r?r@�io_counters�s4

,��zProcess.io_counterscCsh|��}t|d�t}t|d�t}t|d�t}t|d�t}t|d�t}t|||||�S)Nr�r�r�r�r�)r�r�r�ro)rr�r�r�r�r�rtr?r?r@r��szProcess.cpu_timescCst|��d�S)zWhat CPU the process is on.r��r�r�r�r?r?r@r��szProcess.cpu_numNcCst�|j||j�Sr)rZwait_pidr�r�)r�timeoutr?r?r@�wait�szProcess.waitcCs&t|��d�}tpt�}|t|S)Nr�)r�r�r�r�r�)r�ctimeZbtr?r?r@r��s
zProcess.create_timec	Csttd|j|jf��<}dd�|����dd�D�\}}}}}}}Wd�n1sV0Yt|||||||�S)Nz%s/%s/statmcSsg|]}t|�t�qSr?)r�r�r�r?r?r@r�r�z'Process.memory_info.<locals>.<listcomp>r<)rrr�r�r{rd)	rr�ZvmsrjrW�text�libr�Zdirtyr?r?r@�memory_infos
�.zProcess.memory_infos\nPrivate.*:\s+(\d+)s\nPss\:\s+(\d+)s\nSwap\:\s+(\d+)c	Csj|��}|��}ttt|�|���d}ttt|�|���d}ttt|�|���d}t||||f�S)Nr�)r�r�r�rJr��findallre)	rZ_private_reZ_pss_reZ_swap_reZ	basic_memZ
smaps_datarfrgrhr?r?r@�memory_full_infos
zProcess.memory_full_infocCsRdd�}|��}|sgS|�d�}g}|�d�}|g}|||�D�]
\}}|�dd�}z|\}	}
}}}
}Wn(ty�|dg\}	}
}}}
}Yn0|s�d}n2tr�t|�}|��}|�d	�r�t|�s�|dd
�}|�	t|	�t|
�||�
dd�|�
dd�|�
d
d�|�
dd�|�
dd�|�
dd�|�
dd�|�
dd�|�
dd�|�
dd�f
�q@|S)aPReturn process's mapped memory regions as a list of named
            tuples. Fields are explained in 'man proc'; here is an updated
            (Apr 2012) version: http://goo.gl/fmebo

            /proc/{PID}/smaps does not exist on kernels < 2.6.14 or if
            CONFIG_MMU kernel configuration option is not enabled.
            c	ss�i}|D]�}|�dd�}|d�d�s@|��|fV|�|�qzt|d�d||d<Wqty�|d�d�r~Yqntd|��Yq0q|��|fVdS)N�rr�rr�sVmFlags:z#don't know how to interpret line %r)r{r|�popr�r�r�r�)rK�
current_blockr�r�r�r?r?r@�
get_blocksEs�z'Process.memory_maps.<locals>.get_blocks�
rNr�r=z[anon]rvrwsRss:sSize:sPss:s
Shared_Clean:s
Shared_Dirty:sPrivate_Clean:sPrivate_Dirty:sReferenced:s
Anonymous:sSwap:)r�r{r�r�r!rr�r|rr�r�)rr�r�rKr�Z
first_liner��headerZhfieldsr'Zperms�offset�devrr`r?r?r@�memory_maps<sL	

�
�









�
zProcess.memory_mapsc	Cs^ztd|j|jf�WSttfyXt|j�sBt|j|j��nt|j|j|j	��Yn0dS)Nz	%s/%s/cwd)
rzrr�rr r�rr�rr�r�r?r?r@�cwd�s
zProcess.cwdsctxt_switches:\t(\d+)cCsL|��}|�|�}|s,td|j|jf��nt�t|d�t|d��SdS)Nz�'voluntary_ctxt_switches' and 'nonvoluntary_ctxt_switches'lines were not found in %s/%s/status; the kernel is probably older than 2.6.23rr)r�r�r�rr�rZpctxswr�)rZ	_ctxsw_rer�Zctxswr?r?r@�num_ctx_switches�s
���zProcess.num_ctx_switchessThreads:\t(\d+)cCs|��}t|�|�d�S�Nr)r�r�r�)rZ_num_threads_rer�r?r?r@�num_threads�szProcess.num_threadsc	Cst�d|j|jf�}|��g}d}|D]�}d|j|j|f}z8t|��}|����}Wd�n1sl0YWnty�d}Yq*Yn0||�	d�dd�}|�
d�}t|d�t}	t|d	�t}
t
�t|�|	|
�}|�|�q*|r�|��|S)
Nz
%s/%s/taskFz%s/%s/task/%s/statTr�r:r�r�r�)ryrrr��sortrr�r�rr�r{r�r�rZpthreadr�r�r�)rZ
thread_idsro�
hit_enoentZ	thread_idr�r��str�r�r�rqr?r?r@�threads�s.
�
.

zProcess.threadscCst�|j�Sr)rP�getpriorityr�r�r?r?r@�nice_get�szProcess.nice_getcCst�|j|�Sr)rP�setpriorityr�)rr�r?r?r@�nice_set�szProcess.nice_setcCst�|j�Sr)r�r4r�r�r?r?r@�cpu_affinity_get�szProcess.cpu_affinity_getsCpus_allowed_list:\t(\d+)-(\d+)cCsV|��}|�|�}|r@ttt|dd�t|dd�d��Stttt����SdS)Nrr)r�r�rr�r�r�r�)r�_rer�r�r?r?r@�_get_eligible_cpus�s

*zProcess._get_eligible_cpusc
Cs�zt�|j|�Wn�ttfy�}zxt|t�s<|jtjkr�|��}t	t
tt����}|D]4}||vrvtd||f��||vrZtd||f��qZ�WYd}~n
d}~00dS)Nz(invalid CPU number %r; choose between %sz0CPU number %r is not eligible; choose between %s)
r�Zproc_cpu_affinity_setr�r�r�rxr�rr��tupler�r�r�)rr�r�Z
eligible_cpusZall_cpusZcpur?r?r@�cpu_affinity_set�s(����zProcess.cpu_affinity_setcCs,t�|j�\}}tdur t|�}t�||�Sr)r�r3r��enumr;rZpionice�rZioclassr�r?r?r@�
ionice_get�szProcess.ionice_getcCsP|durd}|r(|ttfvr(td|��|dks8|dkr@td��t�|j||�S)Nrz%r ioclass accepts no valuer<zvalue not in 0-7 range)r'r$r�r�Zproc_ioprio_setr�r�r?r?r@�
ionice_set�szProcess.ionice_setc
Cs�|jdkrtd��zD|dur*t|j|�WSt|�dkrFtdt|���t|j||�WnPty�}z8|jtjkr�t|j�r�t	|j|j
|j��n�WYd}~n
d}~00dS)Nrz)can't use prlimit() against PID 0 processr:z4second argument must be a (soft, hard) tuple, got %s)r�r�r�r�rAr�r�ZENOSYSr�rr�r�)rr�r�r�r?r?r@�rlimits 
��zProcess.rlimitcCs$|��d}tr|��}t�|d�S)Nr:�?)r�r!r�
PROC_STATUSESr�)rZletterr?r?r@r:szProcess.statusc
Csvg}t�d|j|jf�}d}|D�]>}d|j|j|f}zt|�}WnZttfydd}Yq"Yq"ty�}z&|jtj	kr�WYd}~q"�WYd}~q"d}~00|�
d�r"t|�r"d|j|j|f}zXt|��:}t
|����d�}	t
|����dd�}
Wd�n1�s0YWnt�y6d}Yq"0t|
�}t|t
|�t
|	�||
�}|�|�q"|�rr|��|S)	NrFrTr�z%s/%s/fdinfo/%srr�)ryrrr�rzrr r�r�rr�rrr�r�r{r�r_r�r�)
rrorfr�rar4r`r�r��posrcrbrqr?r?r@�
open_files&s@

�
:
�zProcess.open_filesr	cCst�||j�}|��|Sr)rFrCr�r�)rrBr�r?r?r@�connectionsRszProcess.connectionscCstt�d|j|jf��S)Nr)r�ryrrr�r�r?r?r@�num_fdsXszProcess.num_fdscCst|��d�S)Nr�r�r�r?r?r@r�\szProcess.ppidsUid:\t(\d+)\t(\d+)\t(\d+)cCs6|��}|�|�d\}}}t�t|�t|�t|��Sr�)r�r�rZpuidsr�)rZ_uids_rer��real�	effective�savedr?r?r@�uids`szProcess.uidssGid:\t(\d+)\t(\d+)\t(\d+)cCs6|��}|�|�d\}}}t�t|�t|�t|��Sr�)r�r�rZpgidsr�)rZ_gids_rer�r�r�r�r?r?r@�gidsfszProcess.gids)N)N)r	)8r<r=r>rD�	__slots__rr�r�rr�r�r�r�r�r�r�r�r�r�ryr`r��getpidr�r�r�r�r�r��	HAS_SMAPSr�r�r�r�r�r�r�r�r�r��HAS_CPU_AFFINITYr�r�r��HAS_PROC_IO_PRIORITYr�r�r�r�r:r�r�r�r�r�r�r?r?r?r@r�6s�!



	

	



�
C

�




�




	


+

r�)N)r	)F)F)�rDZ
__future__rr#r{r�r�r�ryr�r
r$�sys�	tracebackr�rrr=rrrr�r	rPr
rrr
rrrrrrrrrrrrrrZ_compatrrrrr r!�version_infor�Z__extra__all__r�r`r�rr�hasattrrrr�r�r�r�Zgetpagesizer�r�r/�	byteorderr"rhZ	AF_PACKETr9�IntEnumr�r8r$r%r&r'r;�globalsr�__members__ZSTATUS_RUNNINGZSTATUS_SLEEPINGZSTATUS_DISK_SLEEPZSTATUS_STOPPEDZSTATUS_TRACING_STOPZ
STATUS_ZOMBIEZSTATUS_DEADZSTATUS_WAKE_KILLZ
STATUS_WAKINGZSTATUS_IDLEZ
STATUS_PARKEDr�r(r)r*r+r,r-r.r/r0r1r2r2rMrYr_rdr�rerir�rlrnrorzr�r�r�r��	Exception�	print_excr�r��resource�ImportErrorr�ZCDLLr�r|�dirr�r�r�r�r�r�r�r�r�Znet_if_addrsr�rrFrGrNrR�
disk_usagerjrnr�r�r�r�r�rr�r�r�r�r?r?r?r@�<module>sb






�
�����
���




�	4z:*
�
 

k
%
_
+q ^ 

Zerion Mini Shell 1.0