+
    NiKK                       R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^R	IHt ^R
IHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIH t  ^RIH!t! ^RIH"t" ^RIH#t# ^RIH$t$ ^RIH%t% ^RIH&t& ^RIH't' ^RIH(t( ^RIH)t) ^RIH*t* ^RIH+t+ . RnOt,Rt-]P\                  P_                  R]P`                  ! 4        R24      t1]P\                  P_                  R]P`                  ! 4        R 24      t2]3! ]R!4      t4]3! ]R"4      t5]Pl                  ! R#4      t7]Pp                  ! 4       t9]Pt                  R$8H  t;]<! 4       t=R%t>]P~                  ! R&R']@! ]
P                  4      /4      tB]BP                  tC ! R( R)]P~                  4      tD]E! 4       P                  ]DP                  4       R*]P                  R+]P                  R,]P                  R-]P                  R.]P                  R/]P                  R0]P                  R1]P                  R2]P                  R3]P                  R4]P                  R5]P                  /tSR6]P                  R7]P                  R8]P                  R9]P                  R:]P                  R;]P                  R<]P                  R=]P                  R>]P                  R?]P                  R@]P                  /t_RA t`RB taRC tb]$RD 4       tc ]c! RE4      ]nd        ]P                  tdRJ tgRK thRL ti]3! ]RM4      '       d   ]P                  tj]P                  tkRN tlRO tmRP tnRQ toRR tpRS tq]P\                  P_                  RT4      '       g"   ]P\                  P_                  RU4      '       d   RV trMRW tr]P                  ts ! RX RY]e4      tt ! RZ R[4      tu]u! 4       tvRoR\ ltwR] txR^ ty]P                  tzRpR_ lt{ ! R` Ra4      t|RpRb lt}Rc t~Rd tRe tRf tRg tRh tRi tRj tRk t ! Rl Rm4      tR#   ]e d.   tf] ! RF]f: 24       ]! RGRH4      ! RIRIRI4      ]nd         RtfAfEL@RtfAfii ; i)qzLinux platform implementation.N)defaultdict)
namedtuple)_common)_ntuples)_psposix)_psutil_linux)ENCODING)NIC_DUPLEX_FULL)NIC_DUPLEX_HALF)NIC_DUPLEX_UNKNOWN)AccessDenied)NoSuchProcess)ZombieProcess)bcat)cat)debug)decode)get_procfs_path)isfile_strict)memoize)memoize_when_activated)open_binary)	open_text)parse_environ_block)path_exists_strict)supports_ipv6)usage_percentz/sys/class/power_supply/proc//smaps/smaps_rollupproc_ioprio_getproc_cpu_affinity_get
SC_CLK_TCKlittlei   AddressFamilyAF_LINKc                   &    ] tR t^dt^ t^t^t^tRtR# )
IOPriority N)	__name__
__module____qualname____firstlineno__IOPRIO_CLASS_NONEIOPRIO_CLASS_RTIOPRIO_CLASS_BEIOPRIO_CLASS_IDLE__static_attributes__r(       6/tmp/pip-target-e6j6ikcs/lib/python/psutil/_pslinux.pyr'   r'   d   s    OOr2   r'   RSDTtZXxKWIP0102030405060708090A0Bc                    \        V \        4      '       g   Q V 4       h\        P                  ! V 4      p V P	                  R4      ^ ,          p V P                  R4      '       d   \        V 4      '       g   V RR p V # )zWrapper around os.readlink(). 
 (deleted)N)
isinstancestrosreadlinksplitendswithr   )paths   &r3   rR   rR      si    dC  &$& ;;tD ::fa D }}\""+=d+C+CDSzKr2   c                |   \         P                  R\         P                  R\         P                  R/pW\         P                  \         P                  ,          \         P                  ,          ,          ,          pV \         P                  ,          '       d   VP                  RR^4      pVP                  RR4      pV# )zRConvert file's open() flags into a readable string.
Used by Process.open_files().
rwzw+azr+)rQ   O_RDONLYO_WRONLYO_RDWRO_APPENDreplace)flags	modes_mapmodes   &  r3   file_flags_to_moderb      s{     c2;;RYYEIbkkBKK7"))CDEDr{{||Ca(<<d#DKr2   c                    V P                  RR4      p RpV'       d   RV  2pMRV  R2p\        P                  ! V\        P                  4      # )zReturn 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/z/device)r^   rQ   accessF_OK)nameincluding_virtualrU   s   &  r3   is_storage_devicerj      sL     <<S!DTF#TF'*99T277##r2   c                v   \        V  R24      ;_uu_ 4       pVP                  4       P                  4       R,          pRRR4       . ROp\        X4      pV^8  d   VP	                  R4       V^	8  d   VP	                  R4       V^
8  d   VP	                  R4       \        RV4      #   + '       g   i     Ls; i)	zReturn 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.
/stat:   NNNstealguest
guest_nice	scputimes)usernicesystemidleiowaitirqsoftirq)r   readlinerS   lenappendr   )procfs_pathfvaluesfieldsvlens   &    r3   _scputimes_ntupler      s     
}E*	+	+q##%b) 
,KFv;Dqygqygrzl#k6** 
,	+s   &B((B8	/proczignoring exception on import: rq   zuser system idle        c                   V R,          pWP                  R^ 4      ,           p V R,          pV R,          pV R,          p \	        \        4        R24      p^ pT;_uu_ 4        T FS  p	T	P                  4       p	T	P                  R	4      '       g   K,  T\        T	P                  4       ^,          4      ,          pKU  	  RRR4       T\        ,          pY,
          p
Y4,           pT\        T^,          T4      ,          pY,          p
Y\        TR
,          T4      ,
          ,          p
\        T
4      #   \         d,   p\        TP                  ^ ,           R24       Tu Rp?# Rp?ii ; i  \         d    Tu # i ; i  + '       g   i     L; i)a9  Fallback for kernels < 3.14 where /proc/meminfo does not provide
"MemAvailable", 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

We use this function also when "MemAvailable" returns 0 (possibly a
kernel bug, see: https://github.com/giampaolo/psutil/issues/1915).
In that case this routine matches "free" CLI tool result ("available"
column).

XXX: on recent kernels this calculation may differ by ~1.5% compared
to "MemAvailable:", as it's calculated slightly differently.
It is still way more realistic than doing (free + cached) though.
See:
* https://gitlab.com/procps-ng/procps/issues/42
* https://github.com/famzah/linux-memavailable-procfs/issues/2
   MemFree:   Cached:s   Active(file):s   Inactive(file):   SReclaimable:zW is missing from /proc/meminfo; using an approximation for calculating available memoryNz	/zoneinfos   lowg       @)getKeyErrorr   argsr   r   OSErrorstrip
startswithintrS   PAGESIZEmin)memsfreefallbacklru_active_filelru_inactive_fileslab_reclaimableerrr}   watermark_lowlineavail	pagecaches   &           r3   calculate_avail_vmemr      sc   < Dhhz1--H	/0 !34 01?,-Y78 M	
D::<Dv&&TZZ\!_!55  

 XM E3IY]M22I	E	$4s$:M JJJEu:1  xx{m > >	
    
s@   D- E& !*E9+E9-E#8 EE#E#&E65E69F		c                    . p / p\        \        4        R24      ;_uu_ 4       pV F5  pVP                  4       p\        V^,          4      R,          W^ ,          &   K7  	  RRR4       VR,          pVR,          p VR,          p VR,          pWP                  R	^ 4      ,          p VR,          p	 TR,          p
 TR,          p TR,          p TR,          pT^ 8X  d   \        T4      pT^ 8  d   ^ pT P                  R4       MY8  d   TpY],
          p\        Y],
          T^R7      pT '       dQ   RP                  RP                  T 4      \        T 4      ^8X  d   RMR4      p\        P                  ! T\        ^R7       \        P                   ! TTTTTT
TTTT	T4      #   + '       g   i     ELJ; i  \         d    ^ pT P                  R4        ELRi ; i  \         d    ^ pT P                  R
4        ELUi ; i  \         d5     TR,          p	 ELg  \         d    ^ p	T P                  R4         ELi ; ii ; i  \         d    ^ p
T P                  R4        ELi ; i  \         dQ     TR,          TR,          ,           TR,          ,           p EL  \         d    ^ pT P                  R4         ELi ; ii ; i  \         d    ^ p ELi ; i  \         d    \        T4      p ELi ; i)a  Report virtual memory stats.
This implementation mimics procps-ng-3.3.12, aka "free" CLI tool:
https://gitlab.com/procps-ng/procps/blob/
    24fd2605c51fccc375ab0287cec33aa767f06718/proc/sysinfo.c#L778-791
The returned values are supposed to match both "free" and "vmstat -s"
CLI tools.
/meminfo   Ns	   MemTotal:r   s   Buffers:buffersr   r   cacheds   Shmem:s
   MemShared:shareds   Active:actives	   Inactive:s   Inact_dirty:s   Inact_clean:s   Inact_laundry:inactives   Slab:s   MemAvailable:	availableround_z6{} memory stats couldn't be determined and {} set to 0z, waswere
stacklevel)r   r   rS   r   r   r{   r   r   r   formatjoinrz   warningswarnRuntimeWarningntpsvmem)missing_fieldsr   r}   r   r   totalr   r   r   r   r   r   slabr   usedpercentmsgs                    r3   virtual_memoryr   2  s    ND	)*(3	4	4DZZ\F!&)nt3DO  
5 ED){#
0j! 	((+Q//,i(j!
.%H~
/%& A:
 ).Eqyk*	 =DU]U1=G FMMIIn%(A-E6
 	c>a899 Q 
5	4	4  )i()  (h'(  ,	,-(F 	,F!!(++	,,  (h'(  	.	._%'(()* 
  	.H!!*--	.	.    +$T*+s   <F :	F4 	G &	G> 0	I  :	I% 	K 	K  F1	4GGG;:G;>H=
	HH94H=8H99H= I"!I"%K 1%JJ<7K ;J<<K KKK10K1c                    / p \        \        4        R24      ;_uu_ 4       pV F5  pVP                  4       p\        V^,          4      R,          W^ ,          &   K7  	  RRR4        V R,          pV R,          pWE,
          p\        W^R7      p	 \        \        4        R24      pT;_uu_ 4        R;rV F  pVP                  R4      '       d1   \        VP                  R	4      ^,          4      ^,          R,          p
MFVP                  R
4      '       d0   \        VP                  R	4      ^,          4      ^,          R,          pV
f   K  Vf   K   M-	  RpVR,          p\        P                  ! V\        ^R7       ^ ;rRRR4       \        P                  ! YHYYX
X4      #   + '       g   i     ELL; i  \         d0    \
        P                  ! 4       w     rdrWYG,          pYW,          p ELui ; i  + '       g   i     Lz; i  \         d1   pRT R2p\        P                  ! T\        ^R7       ^ ;r Rp?LRp?ii ; i)zReturn swap memory metrics.r   r   Ns
   SwapTotal:s	   SwapFree:r   z/vmstats   pswpin    s   pswpoutz,'sin' and 'sout' swap memory stats couldn't zbe determined and were set to 0r   zM'sin' and 'sout' swap memory stats couldn't be determined and were set to 0 ())r   r   rS   r   r   cextlinux_sysinfor   r   r   r   r   r   r   sswap)r   r}   r   r   r   r   _unit_multiplierr   r   sinsoutr   r   s                 r3   swap_memoryr     s   D	)*(3	4	4DZZ\F!&)nt3DO  
5 ]#L! <DD2G?,-W56 QC ??9--djj.q12Q6=C__Z00tzz$/23a7$>D?t'7  E88c>a@% & 99U$d;;c 
5	4	4   373E3E3G01a4  & Q  003uA7 	 	c>a8dsT   <F &F4 H .A&G10G1
G1/G1 F1	46G.-G.1H	H?&H::H?	heap_infoc                    \        4       p \        V  R24      ;_uu_ 4       pVP                  4       P                  4       pRRR4       X^\	        \
        P                  P                  4      ^,            pV Uu. uF  p\        V4      \        ,          NK  	  pp\
        P                  ! V!  #   + '       g   i     Lv; iu upi )zReturn 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.
rl   N)
r   r   ry   rS   rz   r   rq   _fieldsfloatCLOCK_TICKS)r|   r}   r~   r   r;   s        r3   	cpu_timesr     s     "#K	}E*	+	+q##% 
,ACMM112Q67F.45feAh$$fF5==&!!	 
,	+ 6s   B.9C.B>	c            	        \        4       p . p\        V  R24      ;_uu_ 4       pVP                  4        V F  pVP                  R4      '       g   K  VP	                  4       pV^\        \        P                  P                  4      ^,            pV Uu. uF  p\        V4      \        ,          NK  	  pp\        P                  ! V!  pVP                  V4       K  	  VuuRRR4       # u upi   + '       g   i     R# ; i)z^Return a list of namedtuple representing the CPU times
for every CPU available on the system.
rl   s   cpuN)r   r   ry   r   rS   rz   r   rq   r   r   r   r{   )r|   cpusr}   r   r~   r   r;   entrys           r3   per_cpu_timesr     s     "#KD	}E*	+	+q	

Dv&&C(=(=$>$BC:@A&Q%([00&Av.E"   
,	+ B 
,	+	+s$   *C.AC.C)
2,C.)C..C?	c                     \         P                  ! R4      #   \         Ed!    ^ p \        \	        4        R24      ;_uu_ 4       pT F3  pTP                  4       P                  R4      '       g   K*  T ^,          p K5  	  RRR4       M  + '       g   i     M; iT ^ 8X  d   \        P                  ! R4      p\        \	        4        R24      ;_uu_ 4       pT F=  pTP                  R4      ^ ,          pTP                  T4      '       g   K4  T ^,          p K?  	  RRR4       M  + '       g   i     M; iT ^ 8X  d    R# T u # i ; i)z0Return the number of logical CPUs in the system.SC_NPROCESSORS_ONLN/cpuinfos	   processorNzcpu\drl    )rQ   sysconf
ValueErrorr   r   lowerr   recompiler   rS   match)numr}   r   searchs       r3   cpu_count_logicalr     s    zz/00 O-.h788A::<**<881HC  9888 !8ZZ)Fo/06771D::c?1-D||D))q  8777 !8
-sR    ,E(B1B>	EBAE2D"D"	E"D2-E?EEc                 `   \        4       p RpRp\        P                  ! V4      ;'       g    \        P                  ! V4       FL  p\        V4      ;_uu_ 4       pV P                  VP	                  4       P                  4       4       RRR4       KN  	  \        V 4      pV^ 8w  d   V# / p/ p\        \        4        R24      ;_uu_ 4       pV Fz  pVP                  4       P                  4       pV'       g    VR,          WgR,          &   / pK@  VP                  R4      '       g   KY  VP                  R^4      w  r\        V
4      Wy&   K|  	  RRR4       \        VP                  4       4      pT;'       g    R#   + '       g   i     EKF  ; i  \         d     Li ; i  + '       g   i     L[; i)	z-Return the number of CPU 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_listNr   	   cpu cores   physical ids   	:)r   r   )setglobr   addreadr   rz   r   r   r   r   rS   r   sumr~   )lsp1p2rU   r}   resultmappingcurrent_infor   keyvalues              r3   cpu_count_coresr   4  sb    
B 
EB	JB		"..2.!FF1668>>#$  / WF{ GL	)*(3	4	4D::<%%'D<H$=G89
  "!?@@!ZZ2
$'J!  
5" !"F>>T7 $    
5	4sB   .E7	,F6FF%%F7F	F	FF	FF-	c                 <   \        \        4        R24      ;_uu_ 4       p RpRpRpV  F  pVP                  R4      '       d"   \        VP	                  4       ^,          4      pMoVP                  R4      '       d"   \        VP	                  4       ^,          4      pM7VP                  R4      '       d!   \        VP	                  4       ^,          4      pVf   K  Vf   K  Vf   K   M	  RRR4       ^ p\
        P                  ! XXXV4      #   + '       g   i     L+; i)z*Return various CPU stats as a named tuple.rl   Ns   ctxts   intrs   softirq)r   r   r   r   rS   r   	scpustats)r}   ctx_switches
interruptssoft_interruptsr   syscallss         r3   	cpu_statsr   ^  s    	)*%0	1	1Q
Dw''"4::<?3)) a1
,,"%djjl1o"6(#/* 	 
2" H==z?HMM% 
2	1s*   AD:7D2!DDD$DD	c                 8   \        \        4        R24      ;_uu_ 4       p V  Uu. uFL  pVP                  4       P                  R4      '       g   K*  \	        VP                  R^4      ^,          4      NKN  	  upuuRRR4       # u upi   + '       g   i     R# ; i)z7Return current CPU frequency from cpuinfo if available.r   s   cpu mhz   :N)r   r   r   r   r   rS   )r}   r   s     r3   _cpu_get_cpuinfo_freqr   u  s{    	)*(3	4	4 
zz|&&z2 *E$**T1%a()
 
5	4
 
5	4	4s"   B'B&B6BBB	z'/sys/devices/system/cpu/cpufreq/policy0z$/sys/devices/system/cpu/cpu0/cpufreqc            	     R   \        4       p \        P                  ! R4      ;'       g    \        P                  ! R4      pVP                  R R7       . p\        P                  P
                  p\        V4       EF)  w  rE\        V4      \        V 4      8X  d   W,          R,          pM\        V! VR4      RR7      pVfg   \        V! VR	4      RR7      pVfO   R
V R2p\        VRR7      R8X  d*   VP                  \        P                  ! RRR4      4       K  Rp\        V4      h\        V4      R,          p\        \        V! VR4      4      4      R,          p	\        \        V! VR4      4      4      R,          p
VP                  \        P                  ! WjV	4      4       EK,  	  V# )zjReturn frequency metrics for all CPUs.
Contrarily to other OSes, Linux updates these values in
real-time.
z,/sys/devices/system/cpu/cpufreq/policy[0-9]*z)/sys/devices/system/cpu/cpu[0-9]*/cpufreqc                 ^    \        \        P                  ! R V 4      P                  4       4      # )z[0-9]+)r   r   r   groupr;   s   &r3   <lambda>cpu_freq.<locals>.<lambda>  s    RYYy!%<%B%B%D!Er2   )r   i  scaling_cur_freqNr   cpuinfo_cur_freqz/sys/devices/system/cpu/cpuz/onlinez0
r   z!can't find current frequency filescaling_max_freqscaling_min_freq)r   r   sortrQ   rU   r   	enumeraterz   r   r   r{   r   scpufreqNotImplementedErrorr   )cpuinfo_freqspathsretpjoinirU   curronline_pathr   max_min_s              r3   cpu_freqr    sn   
 ./		:
 D DYYBC 	 	

E
F 'GA5zS// %'$.E$(:;dK| E$(:;dK<$?s'"JK;6%?

3<<S##>? =C-c22t9t#DtE$(:;<=DDtE$(:;<=DDJJs||D56- (. 
r2   c                 l    \        4        U u. uF  p \        P                  ! V RR4      NK  	  up # u up i )zmAlternate implementation using /proc/cpuinfo.
min and max frequencies are not available and are set to None.
r   )r   r   r  r   s    r3   r  r    s/     4I3JK3JaQS)3JKKKs   !1c                       ] tR tRtRtR# )_Ipv6UnsupportedErrori  r(   N)r)   r*   r+   r,   r1   r(   r2   r3   r  r    s    r2   r  c                   x   a  ] tR tRt o RtR tR tR t]R 4       t	]RR l4       t
]RR	 l4       tRR
 ltRtV tR# )NetConnectionsi  a[  A 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                   R \         P                  \         P                  3pR\         P                  \         P                  3pR\         P                  \         P                  3pR\         P                  \         P                  3pR\         P
                  R3pRWW4V3R W3RV3RV3RW43RV3RV3RV3R	WW43R
W3RW$3/V n        RV n        R# )tcptcp6udpudp6unixNalltcp4udp4inetinet4inet6)socketAF_INETSOCK_STREAMAF_INET6
SOCK_DGRAMAF_UNIXtmap_procfs_path)selfr  r  r  r  r  s   &     r3   __init__NetConnections.__init__  s     v~~v'9'9:););<v~~v'8'89):):;-DD1D<TGTGD<TGTGTGT,d\d\
	 !r2   c                @   \        \        4      p\        P                  ! V P                   R V R24       Fh  p \        V P                   R V RV 24      pVP                  R4      '       d1   VR,          RR pW$,          P                  V\        V4      34       Kh  Kj  	  V#   \        \        3 d     K  \         d\   pTP                  \        P                  8X  d    Rp?K  TP                  \        P                  8X  d   \        T4        Rp?K  h Rp?ii ; i)rd   /fd/fd/zsocket:[:   NNN)r   listrQ   listdirr(  rR   r   r{   r   FileNotFoundErrorProcessLookupErrorr   errnoEINVALENAMETOOLONGr   )r)  pidinodesfdinoder   s   &&    r3   get_proc_inodesNetConnections.get_proc_inodes  s    T"** 1 12!C5<=B9 D$5$5#6auD!EF  ##J//!"IcrNEM((#s2w8 0% >, ' &'9:   99,99 2 22#Js/   B$$D8DDD'*DDDc                    / p\        4        F$  p VP                  V P                  V4      4       K&  	  V#   \        \        \
        3 d     KC  i ; iN)pidsupdater<  r3  r4  PermissionError)r)  r9  r8  s   &  r3   get_all_inodesNetConnections.get_all_inodes  sT    6C
d22378   &'9?K  s    7AAc           
        V P                  R4      w  r#\        V^4      pV'       g   R# VP                  R4      pV\        P                  8X  do   \
        '       d7   \        P                  ! V\        P                  ! V4      RRR1,          4      pM\        P                  ! V\        P                  ! V4      4      pM\        P                  ! V4      p \
        '       dR   \        P                  ! \        P                  \        P                  ! R.\        P                  ! RV4      O5!  4      pMQ\        P                  ! \        P                  \        P                  ! R.\        P                  ! RV4      O5!  4      p \         P"                  ! W#4      #   \         d    \        4       '       g   \        Rhh i ; i)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
:asciiNz>4Iz<4Ir(   r0  )rS   r   encoder!  r"  LITTLE_ENDIAN	inet_ntopbase64	b16decoder$  structpackunpackr   r   r  r   addr)rP  familyipports   &&  r3   decode_addressNetConnections.decode_address
  s@   " ::c?4} IYYwV^^#}%%ff.>.>r.B4R4.HI%%ff.>.>r.BC!!"%B =))EEFMM%,DEB
  ))EEFMM%,DEB xx!!  $/T9	s   F !AF 2AF $F=Nc              #     "   V P                  R4      '       d(   \        P                  P                  V 4      '       g   R# \	        V 4      ;_uu_ 4       pVP                  4        \        V^4       F  w  rg VP                  4       R,          w
  rr    rY9   d   Y<,          ^ ,          w  rMRRrTe	   YN8w  d   KL  T\        P                  8X  d   \        T,          pM\        P                  p \        P!                  Y4      p	\        P!                  Y4      p
YY)YT3x  K  	  RRR4       R#   \         d    RT  RT RT: 2p\        T4      Rhi ; i  \"         d     K  i ; i  + '       g   i     R# ; i5i)z.Parse /proc/net/tcp* and /proc/net/udp* files.6NN
   Nerror while parsing ; malformed line r   r0  )rT   rQ   rU   existsr   ry   r  rS   r   RuntimeErrorr!  r#  TCP_STATUSESr   	CONN_NONEr  rT  r  )filerQ  type_r9  
filter_pidr}   linenor   r   laddrraddrstatusr;  r   r8  r:  s   &&&&&           r3   process_inetNetConnections.process_inet=  se     ==bggnnT&:&:t__JJL )!Q	6

S) BAeQ1a ? %mA.GC"B)j.? 2 22!-f!5!(!2!2! . = =e L . = =e L uUCHHC !0 _ " 6.tf 5"81TH.  's+564 1 ! !C __s_   <E>E>"E*7D1AE*1*EE*'
E>1$E	E*E'	#E*&E'	'E**E;	5	E>c              #  6  "   \        V 4      ;_uu_ 4       pVP                  4        V F  pVP                  4       p VR,          w     rxryY9   d
   Y),          pMR.pT Ff  w  rTe	   Y<8w  d   K  \        T4      ^8X  d
   TR,          MRp\        P                  ! \        T4      4      pRp\        P                  pYYTTT3x  Kh  	  K  	  RRR4       R#   \         d     RT9  d    K  RT  RT: 2p
\	        T
4      hi ; i  + '       g   i     R# ; i5i)	zParse /proc/net/unix files.:       Nr   rZ  r[  N r0  )Nr0  )
r   ry   rS   r   r]  rz   r   socktype_to_enumr   r_  )r`  rQ  r9  rb  r}   r   tokensr   ra  r;  r   pairsr8  r:  rU   re  rf  s   &&&&             r3   process_unixNetConnections.process_unixh  s     t__JJL	,28+/Aq!Qq ? #ME'LE$GC!-*2C -0[A-=vbz2 ' 8 8U D !#!(!2!2!5vsKK  %%  _ " ,$ .tf4EdXN  's++, __s@   D&DCBD
DD	*D-D	DD		Dc                R   \        4       V n        Ve   V P                  V4      pV'       g   . # MV P                  4       p\	        4       pV P
                  V,           F  w  rVpV P                   RV 2pV\        P                  \        P                  09   d   V P                  WWsVR7      p	MV P                  WW2R7      p	V	 FS  w  rr{rpV'       d   \        P                  ! WW{W4      pM\        P                  ! WW{WV4      pVP                  V4       KU  	  K  	  \        V4      # )Nz/net/)rb  )r   r(  r<  rC  r   r'  r!  r"  r$  rg  rp  r   pconnsconnr   r1  )r)  kindr8  r9  r  
proto_namerQ  ra  rU   r   r:  rd  re  rf  	bound_pidconns   &&&             r3   retrieveNetConnections.retrieve  s   +-?))#.F	  ((*Fe)-4%J''(j\:D&..&//::&&%C '  &&tV&LFHBE%99RuMD99E%D  GI *9  Cyr2   )r(  r'  r?  )r)   r*   r+   r,   __doc__r*  r<  rC  staticmethodrT  rg  rp  ry  r1   __classdictcell____classdict__s   @r3   r  r    sf     	!.4  0" 0"d (I (IT !L !LF r2   r  c                ,    \         P                  V 4      # )z$Return system-wide open connections.)_net_connectionsry  )ru  s   &r3   net_connectionsr    s    $$T**r2   c                    \        \        4        R24      ;_uu_ 4       p V P                  4       pRRR4       / pXR,           F  pVP                  R4      pV^ 8  g   Q \	        V4      4       hVRV P                  4       pW4^,           R P                  4       P                  4       p\        \        V4      w  ppp	p
ppppppppppppVVVVV	VV
V3W%&   K  	  V#   + '       g   i     L; i)zkReturn network I/O statistics for every network interface
installed on the system as a dict of raw tuples.
z/net/devN   NNrF  )	r   r   	readlinesrfindreprr   rS   mapr   )r}   linesretdictr   colonrh   r   
bytes_recvpackets_recverrindropin_fifoin_framein_compressedin_multicastin
bytes_sentpackets_senterroutdropout_fifoout_collisionsout_carrierout_compressedouts                          r3   net_io_countersr    s    
o'(1	2	2a 
3Gb		

3qy$$t*$yFU|!!#aik"((*002* V'	
 	
7 J NQ 
3	2s   CC+	c                 H   \         P                  \        \         P                  \        \         P
                  \        /p \        4       P                  4       p/ pV F  p \         P                  ! V4      p\         P                  ! V4      p\         P                  ! V4      w  rgRP                  V4      pRV9   p	\        P                  ! WV,          WtV4      W#&   K  	  V#   \         d7   p
T
P                   \         P"                  8w  d   h \%        T
4        Rp
?
K  Rp
?
ii ; i)z)Get NIC stats (isup, duplex, speed, mtu).,runningN)r   DUPLEX_FULLr	   DUPLEX_HALFr
   DUPLEX_UNKNOWNr   r  keys
net_if_mtunet_if_flagsnet_if_duplex_speedr   r   	snicstatsr   r5  ENODEVr   )
duplex_mapnamesr  rh   mtur_   duplexspeedoutput_flagsisupr   s              r3   net_if_statsr    s     	///J
 ""$E
C	//$'C%%d+E 44T:MF 88E?L%D(%lCI   J  	yyELL(#JJ		s   AC  D!++DD!c                   R pR p\         P                  P                  \        4        R24      '       d	   V! 4       pME\         P                  P                  R4      '       d	   V! 4       pM\        4        R2p\	        V4      h/ pV FJ  pVw
  rxrrrppV '       g   \        V4      '       g   K'  V
\        ,          p
V\        ,          pWWWWV3	WW&   KL  	  V# )z[Return disk I/O statistics for every disk installed on the
system as a dict of raw tuples.
c               3   v  "   \        \        4        R 24      ;_uu_ 4       p V P                  4       pRRR4       X F  pVP                  4       p\	        V4      pV^8X  d;   V^,          p\        V^,          4      p\        \
        VR,          4      w
  rxrprrpM{V^8X  g   V^8  d)   V^,          p\        \
        VR,          4      w  rgrrrrpMEV^8X  d.   V^,          p\        \
        VR,          4      w  rhr^ ;p	;p;p;rMRV: 2p\        V4      hWVWWVW{V3
x  K  	  R#   + '       g   i     L; i5i)
/diskstatsN:      N:   r  N:r  NNznot sure how to interpret line )r   r   r  rS   rz   r   r  r   )r}   r  r   r   flenrh   readsreads_mergedrbytesrtimewriteswrites_mergedwbyteswtimer   	busy_timer   s                    r3   read_procfs%disk_io_counters.<locals>.read_procfs	  s4    " /+,J788AKKME 9DZZ\Fv;DrzayF1I69#vd|6L4um1trzay69#vd|6L4fV1ay03C0D-vKLLLLL}y7x@ o%u	; ;/  98s   D9D&C4D9&D6	1D9c               3   R  "   \         P                  ! R 4       F  p \         P                  ! \         P                  P	                  R V 4      4       F  w  rpRV9  d   K  \        \         P                  P	                  VR4      4      ;_uu_ 4       pVP                  4       P                  4       P                  4       pRRR4       \         P                  P                  V4      p\        \        XR,          4      w
  rxrrrr/WgWWWW3
x  K  	  K  	  R#   + '       g   i     L_; i5i)
/sys/blockstatNrX  )rQ   r2  walkrU   r   r   r   r   rS   basenamer  r   )blockrootr   filesr}   r   rh   r  r  r  r  r  r  r  r  r  s                   r3   
read_sysfs$disk_io_counters.<locals>.read_sysfs7  s     ZZ-E"$''"'',,|U*K"L&rww||D&9::aVVX^^-335F ;ww''- 47sF3K3H1fV1FFMF F #M . ;:s   BD'-D	=AD'D$D'r  r  z6/diskstats nor /sys/block are available on this system)rQ   rU   r\  r   r  rj   DISK_SECTOR_SIZE)perdiskr  r  genr   r  r   rh   r  r  r  r  r  r  r  r  r  s   &                r3   disk_io_countersr    s    
+;\F 
ww~~*+:677m		%	%l  ! "  	 "#&&G ).	&ffU9066 """"%iA) 0 Nr2   c                   J   a  ] tR tRt o RtRR.tR tR tR tR t	R	 t
R
tV tR# )RootFsDeviceFinderim  a2  disk_partitions() may return partitions with device == "/dev/root"
or "rootfs". This container class uses different strategies to try to
obtain the real device path. Resources:
https://bootlin.com/blog/find-root-device/
https://www.systutorials.com/how-to-find-the-disk-where-root-is-on-in-bash-on-linux/.
majorminorc                    \         P                  ! R 4      P                  p\         P                  ! V4      V n        \         P                  ! V4      V n        R# )rd   N)rQ   r  st_devr  r  )r)  devs   & r3   r*  RootFsDeviceFinder.__init__w  s3    ggcl!!XXc]
XXc]
r2   c                L   \        \        4        R 24      ;_uu_ 4       pVP                  4       R,           F  pVP                  4       p\	        V4      ^8  d   K%  V^ ,          P                  4       '       d   \        V^ ,          4      MRpV^,          P                  4       '       d   \        V^,          4      MRpV^,          pW@P                  8X  g   K  WPP                  8X  g   K  V'       g   K  RV 2u uuRRR4       # 	  RRR4       R#   + '       g   i     R# ; i)z/partitionsr  N/dev/)	r   r   r  rS   rz   isdigitr   r  r  )r)  r}   r   r   r  r  rh   s   &      r3   ask_proc_partitions&RootFsDeviceFinder.ask_proc_partitions|  s    /+,K899Qb))v;?*0)*;*;*=*=F1I4*0)*;*;*=*=F1I4ayJJ&5JJ+>t!&tf~- :9) :999s0   AD90D**DD+D5DDD#	c                b   R V P                    RV P                   R2p\        V4      ;_uu_ 4       pV F[  pVP                  R4      '       g   K  VP	                  4       P                  R4      ^,          pV'       g   KL  RV 2u uuRRR4       # 	  RRR4       R#   + '       g   i     R# ; i)z/sys/dev/block/rF  z/ueventzDEVNAME=r  N)r  r  r   r   r   
rpartition)r)  rU   r}   r   rh   s   &    r3   ask_sys_dev_block$RootFsDeviceFinder.ask_sys_dev_block  s     Adjj\At__??:..::<22:>qADt!&tf~- _ ___s   B+B BBB.	c                   V P                    R V P                   2p\        P                  ! R4      pV F  p \	        V4      pT;_uu_ 4        VP                  4       P                  4       pWQ8X  dN   \        P                  P                  \        P                  P                  V4      4      pRV 2uuRRR4       u #  RRR4       K  	  R#   + '       g   i     K  ; i  \         d     K  i ; i)rF  z/sys/class/block/*/devr  N)r  r  r   iglobr   r   r   rQ   rU   r  dirnamer3  )r)  needler  r`  r}   datarh   s   &      r3   ask_sys_class_block&RootFsDeviceFinder.ask_sys_class_block  s    JJ<q-

34D	.dO Q668>>+D~!ww//0EF!&tf~	 Q% Q  QQ % s   C"A%CC"C10C1c                   R pVf    V P                  4       pVf    V P                  4       pVf    V P	                  4       pVe*   \
        P                  P                  V4      '       d   V# R # R #   \         d   p\        T4        R p?LtR p?ii ; i  \         d   p\        T4        R p?LR p?ii ; i  \         d   p\        T4        R p?LR p?ii ; ir?  )r  r   r   r  r  rQ   rU   r\  )r)  rU   r   s   &  r3   findRootFsDeviceFinder.find  s    <//1 <--/ <//1
 t 4 4K !5  c


  c


  c

sE   A1 B B7 1B<BBB4B//B47CCC)r  r  N)r)   r*   r+   r,   r{  	__slots__r*  r  r  r  r  r1   r}  r~  s   @r3   r  r  m  s4      '"I#
... r2   r  c                   \        4       p\        4       pV '       g   \        V R24      ;_uu_ 4       pV F}  pVP                  4       pVP	                  R4      '       g"   VP                  VP                  4       4       KK  VP                  R4      ^,          pVR8X  g   Kl  VP                  R4       K  	  RRR4       VR8X  dF   \        P                  P                  R4      '       d!   \        P                  P                  R4      pM"\        P                  P                  V R24      p. p\        P                  ! V4      pV Fz  p	V	w  rr\V
R	8X  d   R
p
V
R9   d#   \        4       P                  4       ;'       g    T
p
V '       g   V
'       d   WQ9  d   KR  \        P                   ! WW\4      pVP#                  V4       K|  	  V#   + '       g   i     EL; i)z8Return mounted disk partitions as a list of namedtuples.z/filesystemsnodev	zfsNr   z	/etc/mtabz/self/mountsnonerl  >   rootfs	/dev/root)r   r   r   r   r   r   rS   rQ   rU   isfilerealpathr   disk_partitionsr  r  r   	sdiskpartr{   )r  fstypesr|   r}   r   fstypemounts_pathretlist
partitions	partitiondevice
mountpointoptsntuples   &             r3   r  r    sk   eG!#K+l344zz|w//KK

- "ZZ-a0FE*  5 g"''.."="=gg&&{3gg&&+l'CDG%%k2J	+4(FVF,,')..0::FFV2v6@v   N? 544s   A*G"GG	c            	     	   \         P                  ! \        4      p \        P                  ! R4      pVP	                  \        P                  ! R4      4       \        V Uu0 uF  q"P                  R4      ^ ,          kK  	  up4      p\        P                  ! R4      p\        P                  ! R4      pV F.  pVP                  RV4      pWa9  g   K  VP                  V4       K0  	  V EF  p VR,           p\        \        V4      4      R,          p	\        P                  P                  \        P                  P!                  V4      R	4      p\#        V4      P%                  4       p
\        TR
,           RR7      p\        TR,           RR7      p\#        TR,           RR7      P%                  4       pTe    \        T4      R,          pTe    \        T4      R,          pY
,          P                  YY34       EK  	  V'       Eg'   \        P                  ! R4      p\        \+        V4      4      pV EF  p \        P                  P                  VR4      p\        \        V4      4      R,          p	\        P                  P                  VR4      p\#        V4      P%                  4       p
\        P                  ! TR,           4      pT Uu0 uFG  pRP                  \        P                  P/                  T4      P                  R4      R,          4      kKI  	  ppRpRpT F  p\        P                  P                  TTR,           4      p\#        TRR7      P%                  4       pTR8X  d4   \        \        P                  P                  TTR,           4      RR7      pM9TR8X  d3   \        \        P                  P                  TTR,           4      RR7      pTe    \        T4      R,          pTf   K   \        T4      R,          pK  	  Y
,          P                  RYT34       EK  	  \1        V 4      # u upi   \&        \(        3 d     EKi  i ; i  \(         d    Rp ELi ; i  \(         d    Rp ELi ; i  \&        \(        3 d   p\-        T4        Rp?EKn  Rp?ii ; iu upi   \(         d    Rp Li ; i  \(         d    Rp EK  i ; i)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*_*r   z5/sys/devices/platform/coretemp.*/hwmon/hwmon*/temp*_*z'/sys/devices/platform/coretemp.*/hwmon/z/sys/class/hwmon/_inputg     @@rh   _maxNr   _crit_labelrl  z /sys/class/thermal/thermal_zone*temptypez/trip_point*:rj  r  N_typecritical_temphigh)collectionsr   r1  r   extendsortedrS   r   r   subr{   r   r   rQ   rU   r   r  r   r   r   r   r   r   r  dict)r  	basenamesr;   
basenames2replrh   altnamebaserU   current	unit_namer  r  labelr   
trip_pathsptrip_points
trip_point	trip_types                       r3   sensors_temperaturesr     s    
!
!$
'C		;<I TYYGHI;AQ;<I ?J ::@AD((.5#T" 
 	(?DDJ'&0G77<< 5v>DD	)I D6MD1w6D8Ob1779T{V+   ?V3 	ut>?A F 9II@A	3y>*	Dww||D&1T
+f4ww||D&1IOO-	
 4.#89J $#A ))!,2237<=#   HD)
ww||D*w*>?r288:	
*#T:+?@4 H &(T:+?@4D #$$T{V3 '(#(?V#;' *. N!!2wh"?@Q T 9A <* $ 		 		$  
      Z( c

* & $#$
 & (#'(s    P7-A:P<6QQ)7A4Q=AR(R-7S <QQQ&%Q&)Q:9Q:=R%R  R%-R=<R= SSc                    \         P                  ! \        4      p \        P                  ! R4      pV'       g   \        P                  ! R4      p\	        V Uu0 uF  q"P                  R4      ^ ,          kK  	  up4      pV F  p \        \        VR,           4      4      p\        \        P                  P                  \        P                  P                  T4      R4      4      P                  4       p\        TR,           RR	7      P                  4       pY,          P!                  \"        P$                  ! Yt4      4       K  	  \'        V 4      # u upi   \         d   p\        T4        Rp?K  Rp?ii ; i)
ak  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*_*r   r  Nrh   r  rl  r   )r  r   r1  r   r  rS   r   r   r   r   r   rQ   rU   r   r  r   r{   r   sfanr  )r  r  r;   r  r  r   r  r  s           r3   sensors_fansr#  Z  s    
!
!$
'C		:;I IIEF	;AQ;<I	$th/0G RWW__T%:FCDJJL	D8Ob1779chhu67  9 <  	#J	s    EEE6 E11E6c                 H  a \        4       oV3R lp \        P                  ! \        4       Uu. uF3  pVP	                  R4      '       g   RVP                  4       9   g   K1  VNK5  	  ppV'       g   R# \        P                  P                  \        \        V4      4      pV ! VR,           VR,           4      pV ! VR,           VR,           4      pV ! VR	,           VR
,           4      pV ! VR,           4      pVe   Ve    RV,          V,          pM&\        \        VR,           RR7      4      pVR8X  d   R# Rp	V ! \        P                  P                  \        R4      \        P                  P                  \        R4      4      p
V
e   V
^8H  p	MC\        VR,           RR7      P                  4       P                  4       pVR8X  d   Rp	M	VR9   d   Rp	V	'       d   \        P                  pMjVe)   Ve%    \        V\        V4      ,          R,          4      pM>Ve+   \        V^<,          4      pV^ 8  d   \        P                   pM\        P                   p\"        P$                  ! WV	4      # u upi   \         d    Rp ELKi ; i  \         d    \        P                   p LMi ; i)zReturn 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.
c                    < V  F%  p\        VSR7      pVS8w  g   K   \        V4      u # 	  R#   \         d    TP                  4       u u # i ; i)zfAttempt to read the content of multiple files which may
not exist. If none of them exist return None.
r   N)r   r   r   r   )r  rU   r  nulls   *  r3   
multi_bcat#sensors_battery.<locals>.multi_bcat  sR     Dtd+Cd{'s8O	   " '99;&'s   
/AABATbatteryNz/energy_nowz/charge_nowz
/power_nowz/current_nowz/energy_fullz/charge_fullz/time_to_empty_nowg      Y@r   z	/capacityr   z
AC0/onlinez	AC/online/statusrl  dischargingFTi  r0  >   fullcharging)objectrQ   r2  POWER_SUPPLY_PATHr   r   rU   r   r   ZeroDivisionErrorr   r   r   r   POWER_TIME_UNLIMITEDabsPOWER_TIME_UNKNOWNr   sbattery)r'  r;   batsr  
energy_now	power_nowenergy_fulltime_to_emptyr   power_pluggedonlinerf  secsleftr&  s                @r3   sensors_batteryr>  y  sQ    8D -..A<<)qwwy"8 	
. 	 
  77<<)3t95D D=0$2FGJ4,.~0EFITN2D>4IJKt&::;M :#9	j(;6G c$,r:;b=
 M
&5
&4F !TI%399;AAC]"!M++ M //		I$9	2:I6=>H 
	"}r)*a<11H--<<=99C. ! 	G	B ! 	211H	2s5   I*
I*!I*=I/ 2"J /J ?J J! J!c                     . p \         P                  ! 4       pV F<  pVw  r4rVp\        P                  ! Y4;'       g    RWVV4      pV P	                  V4       K>  	  V # )z:Return currently connected users as a list of namedtuples.N)r   usersr   suserr{   )	r  rawlistitemrr   ttyhostnametstampr8  nts	            r3   r@  r@    sS    GjjlG+/(8SYYt[[D(C@r  Nr2   c                 @   \        4        R2p \        V 4      ;_uu_ 4       pV FT  pVP                  R4      '       g   K  \        VP	                  4       P                  4       ^,          4      u uuRRR4       # 	  RV  2p\        V4      h  + '       g   i     R# ; i)zAReturn the system boot time expressed in seconds since the epoch.rl   s   btimeNzline 'btime' not found in )r   r   r   r   r   rS   r]  )rU   r}   r   r   s       r3   	boot_timerI    s     &D	T		aDx((TZZ\//1!455 
	 +4&13 
		s   B /B:BB	c                     \        4       P                  \        4      p \        P                  ! V 4       Uu. uF%  qP                  4       '       g   K  \        V4      NK'  	  up# u upi )z7Returns a list of PIDs currently running on the system.)r   rH  r   rQ   r2  r  r   )rU   r;   s     r3   r@  r@    sD    ##H-DJJt,<,q		FCF,<<<s   A$A$c                   \         P                  ! V 4      '       g   R#  \        4        RV  R2p\        V4      ;_uu_ 4       pV FJ  pVP	                  R4      '       g   K  \        VP                  4       ^,          4      pW@8H  u uuRRR4       # 	  RV 2p\        V4      h  + '       g   i     R# ; i  \        \        3 d    T \        4       9   u # i ; i)z[Check for the existence of a unix PID. Linux TIDs are not
supported (always return False).
Frd   r+  s   Tgid:Nz'Tgid' line not found in )
r   
pid_existsr   r   r   r   rS   r   r   r@  )r8  rU   r}   r   tgidr   s   &     r3   rL  rL    s     s##	! &'(#g6DT""aDx00"4::<?3  ${* #" 2$8 o% #"" $ 	!$&= 	!s;   #B8 B$"%B$
B8 B$$B5	/B8 5B8 8CCc                    / p \        4       p\        4        Fv  p \        V RV R24      ;_uu_ 4       pVP                  4       pRRR4       XP	                  R4      pWE^,           R P                  4       p\        V^,          4      pWpV&   Kx  	  V #   + '       g   i     LV; i  \        \        3 d     K  \         d   p\        T4      ThRp?ii ; i)zkObtain a {pid: ppid, ...} dict for all running processes in
one shot. Used to speed up Process.children().
rd   rl   N   ))r   r@  r   r   r  rS   r   r3  r4  rB  r   )	r  r|   r8  r}   r  rpardsetppidr   s	            r3   ppid_maprS    s     C!#Kv	}AcU%899Qvvx : ::d#Dq
#))+DtAw<DH  J :9!#56 	 	-s#,	-s:   B&BB&B#B&&C:CCCCc                F   a  \         P                  ! S 4      V 3R l4       pV# )zdDecorator which translates bare OSError and OSError exceptions
into NoSuchProcess and AccessDenied.
c                   < V P                   V P                  rC S! V .VO5/ VB #   \         d   p\        Y44      ThR p?i\         d"   pT P                  4        \        Y44      ThR p?i\         dX   pT P                  4        \        P                  P                  T P                   RT R24      '       g   \        Y44      Thh R p?ii ; i)Nrd   rl   )r8  _namerB  r   r4  _raise_if_zombier   r3  rQ   rU   r\  r(  )r)  r   kwargsr8  rh   r   funs   &*,   r3   wrapper wrap_exceptions.<locals>.wrapper5  s    HHdjjT	t-d-f-- 	3s)s2! 	4!!#*3  	!!# 77>>T%6%6$7qU"CDD#C.C7	s7   & C=C
CA''C4C5ACC)	functoolswraps)rY  rZ  s   f r3   wrap_exceptionsr^  0  s'    
 __S $ Nr2   c                     a  ] tR tRt o Rt. R<OtR tR tR tR t	]
3R lt]]R 4       4       t]]R	 4       4       t]]R
 4       4       tR tR t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]P2                  P5                  R]P6                  ! 4        R24      '       d	   ]R 4       t]R 4       t]R 4       t]R=R l4       t]R>R l4       t ]R 4       t!]"'       g	   ]#'       dJ   R t$]]%PL                  ! R4      ]%PL                  ! R4      ]%PL                  ! R4      3R l4       t']R  4       t(M]!t(]#'       d	   ]R! 4       t)]R" 4       t*]]%PL                  ! R#4      3R$ l4       t+]]%PL                  ! R%4      3R& l4       t,]R' 4       t-]R( 4       t.]R) 4       t/]0'       d'   ]R* 4       t1]%PL                  ! R+4      3R, lt2]R- 4       t3]4'       d   ]R. 4       t5]R/ 4       t6]7! ]8R04      '       d   ]R=R1 l4       t9]R2 4       t:]R3 4       t;]R?R4 l4       t<]R5 4       t=]R6 4       t>]]%PL                  ! R74      3R8 l4       t?]]%PL                  ! R94      3R: l4       t@R;tAV tBR# )@ProcessiK  zLinux process implementation.c                Z    Wn         R V n        R V n        R V n        \	        4       V n        R # r?  )r8  rV  _ppid_ctimer   r(  )r)  r8  s   &&r3   r*  Process.__init__W  s'    

+-r2   c                     \        V P                   R V P                   R24      pVP                  R4      pW^,           V^,            pVR8H  #   \         d     R# i ; i)rd   rl   rO     ZF)r   r(  r8  r  r   )r)  r  rP  rf  s   &   r3   
_is_zombieProcess._is_zombie^  si    	"4,,-Qtxxj>?D ::d#D(TAX.FT>!  		s   %A AAc                    V P                  4       '       d,   \        V P                  V P                  V P                  4      hR # r?  )rg  r   r8  rV  rb  r)  s   &r3   rW  Process._raise_if_zombien  s/    ??$**djjAA r2   c                d    \         P                  ! V P                   RV P                   24       R# )z+Raise NSP if the process disappeared on us.rd   N)rQ   r  r(  r8  rj  s   &r3   _raise_if_not_aliveProcess._raise_if_not_aliver  s&     	4$$%Qtxxj12r2   c                     \        V4      #   \        \        3 d_    \        P                  P                  T P                   R T P                   24      '       d   T P                  4        T\        Jd   Tu # h i ; i)rd   )
rR   r3  r4  rQ   rU   lexistsr(  r8  rW  UNSET)r)  rU   r   s   &&&r3   	_readlinkProcess._readlinkx  sk    	D>!!#56 	ww$"3"3!4AdhhZ@AA%%'5(#O	s   
 AA<A<:A<c                   \        V P                   RV P                   R24      pVP                  R4      pWP	                  R4      ^,           V pW^,           R P                  4       p/ pW5R&   V^ ,          VR&   V^,          VR&   V^,          VR	&   V^,          VR
&   V^,          VR&   V^,          VR&   V^,          VR&   V^,          VR&   V^$,          VR&    V^',          VR&   V#   \         d    \        R4       ^ TR&    T# i ; i)a!  Parse /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 subtract 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.
rd   rl   rO     (Nrh   rf  rR  ttynrutimestimechildren_utimechildren_stimecreate_timecpu_numblkio_ticksz&can't get blkio_ticks, set iowait to 0)r   r(  r8  r  r  rS   
IndexErrorr   )r)  r  rP  rh   r   r  s   &     r3   _parse_stat_fileProcess._parse_stat_file  s-    t(()488*E:; zz$IIdOa'$/Qhj!'')Fq	HQiFayGbzGbzG &r
 &r
#BZMI	#!'C 
  	#:;!"C
	#s   C+ +D
	D
c                    \        V P                   RV P                   R24      ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     R# ; i)zwRead /proc/{pid}/stat file and return its content.
The return value is cached in case oneshot() ctx manager is
in use.
rd   r+  N)r   r(  r8  r   r)  r}   s   & r3   _read_status_fileProcess._read_status_file  sB     D--.azABBa668 CBBBs   A		A	c                    \        V P                   R V P                   R24      ;_uu_ 4       pVP                  4       P	                  4       uuRRR4       #   + '       g   i     R# ; i)rd   r   N)r   r(  r8  r   r   r  s   & r3   _read_smaps_fileProcess._read_smaps_file  sI     D--.az@AAQ668>># BAAAs   AA(	c                    V P                   P                  V 4       V P                  P                  V 4       V P                  P                  V 4       R # r?  )r  cache_activater  r  rj  s   &r3   oneshot_enterProcess.oneshot_enter  s>    ,,T2--d3,,T2r2   c                    V P                   P                  V 4       V P                  P                  V 4       V P                  P                  V 4       R # r?  )r  cache_deactivater  r  rj  s   &r3   oneshot_exitProcess.oneshot_exit  s>    ..t4//5..t4r2   c                B    \        V P                  4       R ,          4      # )rh   )r   r  rj  s   &r3   rh   Process.name  s     d++-f566r2   c                \    V P                  V P                   R V P                   R2RR7      # )rd   z/exerl  r   rr  r(  r8  rj  s   &r3   exeProcess.exe  5    ~~  !488*D1B  
 	
r2   c                   \        V P                   R V P                   R24      ;_uu_ 4       pVP                  4       pRRR4       X'       g   V P	                  4        . # VP                  R4      '       d   RMRpVP                  V4      '       d   VRR pVP                  V4      pVR8X  d)   \        V4      ^8X  d   RV9   d   VP                  R4      pV#   + '       g   i     L; i)rd   z/cmdlineNrL   r   r0  )r   r(  r8  r   rW  rT   rS   rz   )r)  r}   r  sepcmdlines   &    r3   r  Process.cmdline  s    $++,AdhhZx@AAQ668D B!!#I f--f3==9D**S/ &=S\Q.3$;jjoG- BAs   CC*	c                    \        V P                   R V P                   R24      ;_uu_ 4       pVP                  4       pRRR4       \	        X4      #   + '       g   i     L; i)rd   z/environN)r   r(  r8  r   r   )r)  r}   r  s   &  r3   environProcess.environ  sM    $++,AdhhZx@AAQ668D B"4(( BAs   AA"	c                    \        V P                  4       R ,          4      p\        P                  ! 4       p W!,          #   \         d     R# i ; i)rv  N)r   r  r   get_terminal_mapr   )r)  tty_nrr'  s   &  r3   terminalProcess.terminal  sG    T**,W56((*	< 		s   ? AAr   /ioc           	     |   V P                    R V P                   R2p/ p\        V4      ;_uu_ 4       pV F>  pVP                  4       pV'       g   K   VP	                  R4      w  rV\        V4      W%&   K@  	  RRR4       V'       g   V R2p\        V4      h \        P                  ! VR,          VR,          VR,          VR,          VR	,          VR
,          4      #   \         d     K  i ; i  + '       g   i     L; i  \         d/   pTP                  ^ ,          : RT RT: 2p\        T4      RhRp?ii ; i)rd   r  s   : Nz file was emptys   syscrs   syscws
   read_bytess   write_bytess   rchars   wcharz field was not found in z; found fields are )r(  r8  r   r   rS   r   r   r]  r   pior   r   )	r)  fnamer   r}   r   rh   r   r   r   s	   &        r3   io_countersProcess.io_counters   s9   (()488*C8EFU##qD::<Dt6*.**U*;KD
 ,/u:FL  $ /"3''0ww8$8$=)>*8$8$   * %$% $#0  0xx{o%=eW E##)*.  !o4/0sH   C/C&C/AD C,	(C/+C,	,C//C?	D;)D66D;c                t   V P                  4       p\        VR ,          4      \        ,          p\        VR,          4      \        ,          p\        VR,          4      \        ,          p\        VR,          4      \        ,          p\        VR,          4      \        ,          p\        P                  ! W#WEV4      # )rw  rx  ry  rz  r}  )r  r   r   r   	pcputimes)r)  r~   rw  rx  ry  rz  rv   s   &      r3   r   Process.cpu_times#  s    &&(fWo&4fWo&4v&678;Fv&678;Fvm,-;}}.&
 	
r2   c                B    \        V P                  4       R,          4      # )zWhat CPU the process is on.r|  r   r  rj  s   &r3   r|  Process.cpu_num/  s     4((*9566r2   Nc                X    \         P                  ! V P                  WP                  4      # r?  )r   wait_pidr8  rV  )r)  timeouts   &&r3   waitProcess.wait4  s      7JJ??r2   c                    V P                   f1   \        V P                  4       R,          4      \        ,          V n         V'       d   V P                   # V P                   \	        4       ,           # )Nr{  )rc  r   r  r   rI  )r)  	monotonics   &&r3   r{  Process.create_time8  sR     ;;d++-m<=K K ;; {{Y[((r2   c           	     .   \        V P                   R V P                   R24      ;_uu_ 4       pR VP                  4       P	                  4       R,           4       w  r#rErgpRRR4       \
        P                  ! XXXXXXX4      #   + '       g   i     L,; i)rd   z/statmc              3   N   "   T F  p\        V4      \        ,          x  K  	  R # 5ir?  )r   r   ).0r;   s   & r3   	<genexpr>&Process.memory_info.<locals>.<genexpr>W  s       8+CaA!!+Cs   #%:Nrk  NN)r   r(  r8  ry   rS   r   pmem)	r)  r}   vmsrssr   textlibr  dirtys	   &        r3   memory_infoProcess.memory_infoI  s     D--.az@AAQ8+,::<+=+=+?+C84CfCu B xxS&$T5AA	 BAs   2BB	c                F   ^ ;p;r#\        V P                   RV P                   R24      ;_uu_ 4       pV F  pVP                  R4      '       d1   V\	        VP                  4       ^,          4      R,          ,          pKJ  VP                  R4      '       d*   \	        VP                  4       ^,          4      R,          pK  VP                  R4      '       g   K  \	        VP                  4       ^,          4      R,          pK  	  RRR4       WV3#   + '       g   i     L; i)rj  rd   r   s   Private_r      Pss:   Swap:N)r   r(  r8  r   r   rS   )r)  usspssswapr}   r   s   &     r3   _parse_smaps_rollupProcess._parse_smaps_rollup^  s      ! C #$$%Qtxxj> D{33s4::<?3d::11!$**,q/2T922"4::<?3d:  d## s   A#D=D+DD 	s   \nPrivate.*:\s+(\d+)s   \nPss\:\s+(\d+)s   \nSwap\:\s+(\d+)c                D   V P                  4       p\        \        \        VP	                  V4      4      4      R ,          p\        \        \        VP	                  V4      4      4      R ,          p\        \        \        VP	                  V4      4      4      R ,          pWVV3# )r   )r  r   r  r   findall)r)  _private_re_pss_re_swap_re
smaps_datar  r  r  s   &&&&    r3   _parse_smapsProcess._parse_smapsu  s    * ..0J c#{22:>?@4GCc#wz:;<tCCs3 0 0 <=>EDd##r2   c                   \         '       d    V P                  4       w  rpMV P	                  4       w  rpV P                  4       p\        P                  ! WAW#3,           !  #   \        \        3 d    T P	                  4       w  rp LRi ; ir?  )HAS_PROC_SMAPS_ROLLUPr  r4  r3  r  r  r   pfullmem)r)  r  r  r  	basic_mems   &    r3   memory_full_infoProcess.memory_full_info  s    $$9%)%=%=%?NCd "&!2!2!4$((*I<<3-=!=>> +,=> 9%)%6%6%8NCd9s   A! !$BBc                   R pV P                  4       pV'       g   V P                  4        . # VP                  R4      p. pVP                  ^ 4      pV.pV! W64       EFD  w  rrVP                  R^4      p Vw  rrrV'       g   RpMH\        V4      pVP                  4       pVP                  R4      '       d   \        V4      '       g   VRR p\        V	4      \        V
4      VVP                  R^ 4      VP                  R^ 4      VP                  R	^ 4      VP                  R
^ 4      VP                  R^ 4      VP                  R^ 4      VP                  R^ 4      VP                  R^ 4      VP                  R^ 4      VP                  R^ 4      3pVP                  V4       EKG  	  V#   \         d    TR.,           w  rrr ELHi ; i)a  Return process's mapped memory regions as a list of named
tuples. Fields are explained in 'man proc'; here is an updated
(Apr 2012) version: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/proc.txt?id=b76437579d1344b612cf1851ae610c636cec7db0.

/proc/{PID}/smaps does not exist on kernels < 2.6.14 or if
CONFIG_MMU kernel configuration option is not enabled.
c              3     "   / pV  F}  pVP                  R ^4      pV^ ,          P                  R4      '       g(   VP                  4       V3x  VP                  V4       KZ   \	        V^,          4      R,          W$^ ,          &   K  	  VP                  4       V3x  R #   \
        \        3 d5    T^ ,          P                  R4      '       d    K  RT: 2p\        T4      R hi ; i5i)Nr   r   s   VmFlags:z!don't know how to interpret line )rS   rT   popr{   r   r   r~  r   )r  current_blockr  r   r   r   s   &&    r3   
get_blocks'Process.memory_maps.<locals>.get_blocks  s     !D!ZZa0F!!9--d33,002D99%,,T2<.1&)nt.CDO " %((*D11 !+J7 <%ay33K@@ ($EdX"NC",S/t;<s*   AC&""BC&.C#C&C##C&   
Nrl  z[anon]rM   s   Rss:s   Size:r  s   Shared_Clean:s   Shared_Dirty:s   Private_Clean:s   Private_Dirty:s   Referenced:s
   Anonymous:r  rN   )r  rW  rS   r  r   r   r   rT   r   r   r{   )r)  r  r  r  r   
first_liner  headerhfieldsrP  perms_offset_dev_inoderU   rC  s   &               r3   memory_mapsProcess.memory_maps  s   2& ((*D %%'	JJu%EB1J'LM *5 @ ,,tQ/N?F<D #D!$<D::<D}}\22;M< <  $DSz4L5MHHWa(HHXq)HHWa(HH-q1HH-q1HH.2HH.2HH^Q/HH]A.HHXq) 		$= !A> I7 " N?F"~<DNs   6F((GGc                \    V P                  V P                   R V P                   R2RR7      # )rd   z/cwdrl  r   r  rj  s   &r3   cwdProcess.cwd  r  r2   s   ctxt_switches:\t(\d+)c                   V P                  4       pVP                  V4      pV'       g)   R V P                   RV P                   R2p\	        V4      h\
        P                  ! \        V^ ,          4      \        V^,          4      4      # )zR'voluntary_ctxt_switches' and 'nonvoluntary_ctxt_switches'lines were not found in rd   z1/status; the kernel is probably older than 2.6.23)r  r  r(  r8  r  r   pctxswr   )r)  	_ctxsw_rer  ctxswr   s   &&   r3   num_ctx_switchesProcess.num_ctx_switches  s}     %%'!!$'%%&az 2..  &c**zz#eAh-U1X77r2   s   Threads:\t(\d+)c                d    V P                  4       p\        VP                  V4      ^ ,          4      # rj  )r  r   r  )r)  _num_threads_rer  s   && r3   num_threadsProcess.num_threads  s-     %%'?**40344r2   c                   \         P                  ! V P                   R V P                   R24      pVP	                  4        . pRpV F  pV P                   R V P                   RV R2p \        V4      ;_uu_ 4       pVP                  4       P                  4       pRRR4       XTP                  R4      ^,           R pTP                  R4      p\        T^,          4      \        ,          p	\        T^,          4      \        ,          p
\        P                  ! \!        T4      Y4      pTP#                  T4       K  	  V'       d   V P%                  4        V#   + '       g   i     L; i  \        \        3 d    Rp EK<  i ; i)	rd   z/taskFz/task/rl   NTrO  r   )rQ   r2  r(  r8  r  r   r   r   r3  r4  r  rS   r   r   r   pthreadr   r{   rm  )r)  
thread_idsr  
hit_enoent	thread_idr  r}   str~   rw  rx  r  s   &           r3   threadsProcess.threads  s>   ZZ4#4#4"5Qtxxj FG

#I(()488*F9+UKE ''1)B ( BGGDMA%'(BXXd^F&*%3E&*%3E[[Y>FNN6"! $" $$&! ('%'9:  "
	s0   *E,=EE,E)$E,)E,,FFc                B    \         P                  ! V P                  4      # r?  )r   proc_priority_getr8  rj  s   &r3   nice_getProcess.nice_get"  s     %%dhh//r2   c                D    \         P                  ! V P                  V4      # r?  )r   proc_priority_setr8  )r)  r   s   &&r3   nice_setProcess.nice_set+  s    %%dhh66r2   c                B    \         P                  ! V P                  4      # r?  )r   r!   r8  rj  s   &r3   cpu_affinity_getProcess.cpu_affinity_get2  s    --dhh77r2   s   Cpus_allowed_list:\t(\d+)-(\d+)c           	     2   V P                  4       pVP                  V4      pV'       dK   \        \        \	        V^ ,          ^ ,          4      \	        V^ ,          ^,          4      ^,           4      4      # \        \        \        \        4       4      4      4      # r  )r  r  r1  ranger   rz   r   )r)  _rer  r   s   &&  r3   _get_eligible_cpusProcess._get_eligible_cpus6  sk     ))+DKK%EE#eAhqk"2Ca4Dq4HIJJE#mo"6788r2   c           	         \         P                  ! V P                  V4       R#   \        \        3 d   p\        T\        4      '       g    TP                  \        P                  8X  du   T P                  4       p\        \        \        \        4       4      4      4      pT F9  pYT9  d   R T: RT: 2p\	        T4      RhYS9  g   K'  RT RT 2p\	        T4      Th	  h Rp?ii ; i)zinvalid CPU z; choose between NzCPU number z! is not eligible; choose between )r   proc_cpu_affinity_setr8  r   r   rO   r5  r6  r  tupler  rz   r   )r)  r   r   eligible_cpusall_cpuscpur   s   &&     r3   cpu_affinity_setProcess.cpu_affinity_setA  s    **488T:Z( c:..#))u||2K$($;$;$=M$U3}+?%@AH#.".sg 6$$1#4!6   #-S/t;3"-cU 3,,9?!<   #-S/s:  $ #s   !% C%BC 	C  C%c                    \         P                  ! V P                  4      w  r\        V4      p\        P
                  ! W4      # r?  )r   r    r8  r'   r   pionice)r)  ioclassr   s   &  r3   
ionice_getProcess.ionice_get[  s1    !11$((;NG )G;;w..r2   c                   Vf   ^ pV'       d7   V\         P                  \         P                  09   d   V: R2p\        V4      hV^ 8  g   V^8  d   Rp\        V4      h\        P
                  ! V P                  W4      # )Nz ioclass accepts no valuezvalue not in 0-7 range)r'   r0   r-   r   r   proc_ioprio_setr8  )r)  r  r   r   s   &&& r3   
ionice_setProcess.ionice_seta  sy    },,,,%  !#<= o%qyEAI. o%'''AAr2   prlimitc                   V P                   ^ 8X  d   Rp\        V4      h Vf"   \        P                  ! V P                   V4      # \	        V4      ^8w  d   RV: 2p\        V4      h\        P                  ! V P                   W4       R#   \
         d6   pTP                  \        P                  8X  d   T P                  4        h Rp?ii ; i)rj  z)can't use prlimit() against PID 0 processNz2second argument must be a (soft, hard) tuple, got )	r8  r   resourcer!  rz   r   r5  ENOSYSrW  )r)  	resource_limitsr   r   s   &&&  r3   rlimitProcess.rlimitr  s    
 xx1}A o%>#++DHHi@@ 6{a'**05  )o-$$TXXyA 99, ))+s   $B	 AB	 	C	0CC	c                |    V P                  4       R ,          pVP                  4       p\        P                  VR4      # )rf  ?)r  r   PROC_STATUSESr   )r)  letters   & r3   rf  Process.status  s3    &&(2  --r2   c                   . p\         P                  ! V P                   R V P                   R24      pRpV EF;  pV P                   R V P                   RV 2p \	        V4      pVP                  R 4      '       d   \        V4      '       d   V P                   R V P                   RV 2p \        V4      ;_uu_ 4       p\        VP                  4       P                  4       ^,          4      p\        VP                  4       P                  4       ^,          ^4      p	RRR4       \        X	4      p
\        P                  ! V\        V4      \        X4      W4      pVP                  V4       EK8  EK;  EK>  	  V'       d   V P-                  4        V#   + '       g   i     L|; i  \        \         3 d    Rp EK  i ; i  \        \         3 d    Rp EK  \"         d^   pTP$                  \$        P&                  8X  d    Rp?EK  TP$                  \$        P(                  8X  d   \+        T4        Rp?EK   h Rp?ii ; i)rd   r-  Fr.  z/fdinfo/NT)rQ   r2  r(  r8  rR   r   r   r   r   ry   rS   rb   r   	popenfiler{   r3  r4  r   r5  r6  r7  r   rm  )r)  r  r  r  r:  r`  rU   r}   posr_   ra   r  r   s   &            r3   
open_filesProcess.open_files  s   

d//0$((3?@
B''($((4t<D$/~& ??3''M$,?,?"//0$((8B4HD/(..!"%ajjl&8&8&:1&=">C$'

(:(:(<Q(?$CE /  2%8!$ #b'3s8T"  v.! -@'- N $$& /. ./AB * &*
*3 &'9: !
 99,99 2 22#Js[   F?,F$?AFF$F!F$$F<;F<?H=H=H= H8*H87H88H=c                d    \         P                  WP                  4      pV P                  4        V# r?  )r  ry  r8  rm  )r)  ru  r  s   && r3   r  Process.net_connections  s'    ''hh7  "
r2   c                t    \        \        P                  ! V P                   R V P                   R24      4      # )rd   r-  )rz   rQ   r2  r(  r8  rj  s   &r3   num_fdsProcess.num_fds  s.    2::!2!2 31TXXJcBCDDr2   c                B    \        V P                  4       R ,          4      # )rR  r  rj  s   &r3   rR  Process.ppid  s    4((*6233r2   s   Uid:\t(\d+)\t(\d+)\t(\d+)c                    V P                  4       pVP                  V4      ^ ,          w  r4p\        P                  ! \	        V4      \	        V4      \	        V4      4      # r  )r  r  r   puidsr   )r)  _uids_rer  real	effectivesaveds   &&    r3   uidsProcess.uids  I    %%'!)!1!1$!7!:yyTC	NCJ??r2   s   Gid:\t(\d+)\t(\d+)\t(\d+)c                    V P                  4       pVP                  V4      ^ ,          w  r4p\        P                  ! \	        V4      \	        V4      \	        V4      4      # r  )r  r  r   pgidsr   )r)  _gids_rer  r=  r>  r?  s   &&    r3   gidsProcess.gids  rB  r2   )rc  rV  rb  r(  r8  )_cacherc  rV  rb  r(  r8  r?  Fr  )Cr)   r*   r+   r,   r{  r  r*  rg  rW  rm  rq  rr  r^  r   r  r  r  r  r  rh   r  r  r  r  rQ   rU   r\  getpidr  r   r|  r  r{  r  r  HAS_PROC_SMAPSr  r   r   r  r  r  r  r  r  r  r  r  HAS_CPU_AFFINITYr	  r  r  HAS_PROC_IO_PRIORITYr  r  hasattrr#  r'  rf  r1  r  r6  rR  r@  rF  r1   r}  r~  s   @r3   r`  r`  K  s    'I." B3 (-   #  #J    $  $3
5
 7 7 
 

  2 ) )
   
ww~~ryy{m3/00	 	0 
 	0D 	
 	
 7 7 @ @ ) )  B B$ 	$. 
 

#;<JJ23ZZ 45	$ 
	$8 
		? 
		? '	E	 
E	N 
 

 

#<=8 8 *,**5H*I 5 5
  4 0 0 7 7 		8 
	8 jj!DE		9 
	 
	. 		/ 
	/
 
	B 
	B x##		 
	6 . . - -^  
 E E 4 4 JJ'DE @ @
 JJ'DE @ @r2   r`  )PROCFS_PATHr-   r.   r/   r0   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_CLOSINGrJ  rI  )r{  rK  r  enumr5  r\  r   rQ   r   r#  r!  rM  sysr   r   r   rl  r   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __extra__all__r0  rU   r\  rK  rL  r  rO  rN  rM  r   r   getpagesizer   	byteorderrI  r/  rq  r  IntEnumr   	AF_PACKETr$   r%   r'   globalsrA  __members__STATUS_RUNNINGSTATUS_SLEEPINGSTATUS_DISK_SLEEPSTATUS_STOPPEDSTATUS_TRACING_STOPSTATUS_ZOMBIESTATUS_DEADSTATUS_WAKE_KILLSTATUS_WAKINGSTATUS_IDLESTATUS_PARKEDr+  rQ  rR  rS  rT  rU  rV  rW  rX  rY  rZ  r[  r^  rR   rb   rj   r   rq   	Exceptionr   r   r   r   r   	heap_trimr   r   r   r   r   r   r  net_if_addrsr  r  r  r  r  r  
disk_usager  r  r  r   r#  r>  r@  rI  r@  rL  rS  r^  r`  r(   r2   r3   <module>rt     sI  
 %       	 	    
  # "    #  $ $ ' ! " "     $ "  +    ( ' " "	$ . &V <=		}M'JK t%67 4!89  jj&)  iV%5%5!67 

  	  '' ( 			 	 	"	"			$	$							!	!						" 	'
"
"'

'

'
 
 '
 
 '
 
 '

'
!
!'

'

'

((
$& 	+ 	+0O%g.CM MM	<~~B4<p 4II"&:'TN.
 77>>;<<*A A#NL   	I 	i iX "# +
,^B   
fRH HV$Xsl>W:~  =!B,6R
@ R
@O+  O	*3'
23{,>?S#NCMMOs   P6 6Q*="Q%%Q*