+
    Ni]                        R 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(Ot]P<                  ! 4       t]P@                  t ]PB                  R)8  t"Rt#Rt$]PJ                  ]PL                  ]PN                  ]PP                  ]PR                  ]PT                  ]PV                  ]PX                  ]PZ                  ]P\                  ]P^                  ]PP                  ]P`                  ]Pb                  /t2]Pf                  ]Ph                  ]Pj                  ]Pl                  ]Pn                  ]Pp                  ]Pr                  ]Pt                  ]Pv                  ]Px                  ]Pz                  ]P|                  ]P~                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]#]P                  ]$/tM]N! ^ ^^^^^^^^^	^
^R7      tOR tPR tQR tRR tSR tTR tUR tV]P                  tW]P                  tXR*R ltY]P                  tZ]P                  t[R+R lt\R  t]R! t^R" t_R# t`R$ taR% tb ! R& R'4      tcR# ),z'Sun OS Solaris platform implementation.N)
namedtuple)AF_INET)_common)_ntuples)_psposix)_psutil_sunos)AF_INET6)ENCODING)AccessDenied)NoSuchProcess)ZombieProcess)debug)get_procfs_path)isfile_strict)memoize_when_activated)sockfam_to_enum)socktype_to_enum)usage_percentIDLEBOUND)ppidrssvmscreate_timenicenum_threadsstatusttynruideuidgidegidc                     \         P                  ! R4      \        ,          p \         P                  ! R4      \        ,          ;rW,
          p\        W0^R7      p\        P
                  ! WWCV4      # )zReport virtual memory metrics.SC_PHYS_PAGESSC_AVPHYS_PAGESround_)ossysconf	PAGE_SIZEr   ntpsvmem)totalfreeavailusedpercents        6/tmp/pip-target-e6j6ikcs/lib/python/psutil/_pssunos.pyvirtual_memoryr2   `   sT     JJ')3E::/09<<D<DD2G99U7$77    c            	     V   \         P                  ! 4       w  r\        P                  ! RR\        P
                  R,           2RR.\        P                  R7      pVP                  4       w  r4VP                  \        P                  P                  4      pVP                  ^ 8w  d   RVP                   R2p\        V4      hVP                  4       P                  R	4      R
,          pV'       g   Rp\        V4      h^ ;rxV Fb  p	V	P                  4       p	V	R,          w  rV\!        \!        V
4      R,          4      ,          pV\!        \!        V4      R,          4      ,          pKd  	  Wx,
          p\#        W^R7      p\$        P&                  ! W|WV \(        ,          V\(        ,          4      # )zReport swap memory metrics.z/usr/bin/envzPATH=/usr/sbin:/sbin:PATHswapz-l)stdoutz'swap -l' failed (retcode=)
:   NNzno swap device(s) configured:      Ni   r%   )cextswap_mem
subprocessPopenr'   environPIPEcommunicatedecodesysr7   encoding
returncodeRuntimeErrorstripsplitintr   r*   sswapr)   )sinsoutpr7   _msglinesr,   r-   linetfr/   r0   s                 r1   swap_memoryrV   k   sX   IC 	#BJJv$6#78		
 	A IF]]3::../F||q*1<<.:3LLN  &r*E,3Ezz|CySVc\""CFSL!!	 
 <DD2G99TC)OTI5E r3   c                     \         P                  ! 4       p \        P                  ! \	        V !   Uu. uF  p\        V4      NK  	  up!  # u upi )z.Return system-wide CPU times as a named tuple.)r=   per_cpu_timesr*   	scputimeszipsumretxs     r1   	cpu_timesr_      s9    



C==3959a3q695665s   A
c                 ~    \         P                  ! 4       p V  Uu. uF  p\        P                  ! V!  NK  	  up# u upi )z6Return system per-CPU times as a list of named tuples.)r=   rX   r*   rY   r\   s     r1   rX   rX      s1    



C'*+s!CMM1s+++s   :c                 T     \         P                  ! R4      #   \         d     R# i ; i)z0Return the number of logical CPUs in the system.SC_NPROCESSORS_ONLNN)r'   r(   
ValueError r3   r1   cpu_count_logicalre      s)    zz/00 s    ''c                 ,    \         P                  ! 4       # )z-Return the number of CPU cores in the system.)r=   cpu_count_coresrd   r3   r1   rg   rg      s    !!r3   c                 d    \         P                  ! 4       w  rr#^ p\        P                  ! WWB4      # )z*Return various CPU stats as a named tuple.)r=   	cpu_statsr*   	scpustats)ctx_switches
interruptssyscalls_trapssoft_interruptss        r1   ri   ri      s)    151A.LhO==?MMr3   c                V   . p\         P                  ! 4       pV F`  pVw  rErgVR8X  d   RpV '       g     \        V4      P                  '       g   K7   \        P                  ! WEWg4      p	VP                  V	4       Kb  	  V#   \         d   p\        RT: RT 24        Rp?K  Rp?ii ; i)zReturn system disk partitions.none z	skipping z: N)	r=   disk_partitions
disk_usager,   OSErrorr   r*   	sdiskpartappend)
allretlist
partitions	partitiondevice
mountpointfstypeoptserrntuples
   &         r1   rs   rs      s     G%%'J	+4(FVF!*-333 4 v6@v!  " N  	*r#78s   B  B(B##B(c           
     6   \         P                  V ,          w  r#\        P                  ! V4      p\	        4       pV F  pVw  rxrrpW9  d   K  W9  d   K  V\
        \        09   d9   V
'       d   \        P                  ! V
!  p
V'       d   \        P                  ! V!  p\        V,          p\        V4      p\        V	4      p	VR8X  d   \        P                  ! WxWWV4      pM\        P                  ! WxWW4      pVP                  V4       K  	  \        V4      # )zReturn socket connections.  If pid == -1 return system-wide
connections (as opposed to connections opened by one process only).
Only INET sockets are returned (UNIX are not).
)r   	conn_tmapr=   net_connectionssetr   r   r*   addrTCP_STATUSESr   r   sconnpconnaddlist)kind_pidfamiliestypesrawlistr]   itemfdfamtype_laddrraddrr   pidnts   &&             r1   r   r      s    
 ''-OH""4(G
%C481uc7H%%%(%(f%c" '2:2E%EB2E%@B' ( 9r3   c                     \         P                  ! 4       p V P                  4        FP  w  rVw  r4rV\        \        R4      '       d   \        P
                  ! V4      p\        P                  ! W4WVR4      W&   KR  	  V # )z)Get NIC stats (isup, duplex, speed, mtu).	NicDuplexrr   )r=   net_if_statsitemshasattrr   r   r*   	snicstats)r]   namer   isupduplexspeedmtus          r1   r   r     sd    



Cyy{#( e7K((&&v.FMM$B?		 #
 Jr3   c                 ,    \         P                  ! 4       # )z:The system boot time expressed in seconds since the epoch.)r=   	boot_timerd   r3   r1   r   r     s    >>r3   c                     . p \         P                  ! 4       pRpV FD  pVw  rErgrV'       g   K  Wb9   d   Rp\        P                  ! WEWgV	4      p
V P	                  V
4       KF  	  V # )z:Return currently connected users as a list of namedtuples.	localhost)z:0.0z:0)r=   usersr*   suserrw   )ry   r   r   r   userttyhostnametstampuser_processr   r   s              r1   r   r     se    GjjlGI9=68\  "HYYt(C8r  Nr3   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   encoder	   r'   listdirisdigitrK   )pathr^   s     r1   pidsr   2  sD    ##H-DJJt,<,q		FCF,<<<s   A$A$c                .    \         P                  ! V 4      # )z&Check for the existence of a unix pid.)r   
pid_exists)r   s   &r1   r   r   8  s    s##r3   c                F   a  \         P                  ! S 4      V 3R l4       pV# )z{Call callable into a try/except clause and translate ENOENT,
EACCES and EPERM in NoSuchProcess or AccessDenied exceptions.
c                   < V P                   V P                  V P                  rTp S! V .VO5/ VB #   \        \        3 d0   p\        T4      '       g   \        Y54      Th\        Y5T4      ThR p?i\         d   p\        Y54      ThR p?i\         d*   pT^ 8X  d   ^ \        4       9   d   \        Y54      Thh h R p?ii ; iN)r   _ppid_nameFileNotFoundErrorProcessLookupErrorr   r   r   PermissionErrorr
   ru   r   )selfargskwargsr   r   r   r   funs   &*,    r1   wrapper wrap_exceptions.<locals>.wrapperB  s    ((DJJ

4	t-d-f--!#56 	: c??#C.C740c9 	3s)s2 	ax;&s1s:	s9   2 B>*A--B>:B>;BB>B>$B99B>)	functoolswraps)r   r   s   f r1   wrap_exceptionsr   =  s'    
 __S ( Nr3   c                   H  a  ] tR tRt o Rt. R(OtR tR tR tR t	]
]R 4       4       t]
]R 4       4       t]
]R	 4       4       t]
R
 4       t]
R 4       t]
R 4       t]
R 4       t]
R 4       t]
R 4       t]
R 4       t]
R 4       t]
R 4       t]
R 4       t]
R 4       t]
R 4       t]
R 4       t]
R 4       t]
R 4       t]
R 4       t]t]
R 4       t ]
R 4       t!]
R 4       t"R t#]
R)R l4       t$]%! RR 4      t&]%! RR!4      t']
R" 4       t(]
R# 4       t)]
R$ 4       t*]
R*R& l4       t+R't,V t-R%# )+ProcessiZ  z1Wrapper class around underlying C implementation.c                L    Wn         R V n        R V n        \        4       V n        R # r   )r   r   r   r   _procfs_path)r   r   s   &&r1   __init__Process.__init___  s     

+-r3   c                d    \         P                  ! V P                   RV P                   24       R# )z+Raise NSP if the process disappeared on us./N)r'   statr   r   r   s   &r1   _assert_aliveProcess._assert_alivee  s&     	4$$%Qtxxj12r3   c                    V P                   P                  V 4       V P                  P                  V 4       V P                  P                  V 4       R # r   )_proc_name_and_argscache_activate_proc_basic_info
_proc_credr   s   &r1   oneshot_enterProcess.oneshot_enterk  s<      //5,,T2&&t,r3   c                    V P                   P                  V 4       V P                  P                  V 4       V P                  P                  V 4       R # r   )r   cache_deactivater   r   r   s   &r1   oneshot_exitProcess.oneshot_exitp  s<      11$7..t4((.r3   c                X    \         P                  ! V P                  V P                  4      # r   )r=   proc_name_and_argsr   r   r   s   &r1   r   Process._proc_name_and_argsu  s!     &&txx1B1BCCr3   c                d   V P                   ^ 8X  dU   \        P                  P                  V P                   RV P                    R24      '       g   \        V P                   4      h\        P                  ! V P                   V P                  4      p\        V4      \        \        4      8X  g   Q hV# )    r   z/psinfo)
r   r'   r   existsr   r
   r=   proc_basic_infolenproc_info_map)r   r]   s   & r1   r   Process._proc_basic_infoz  s     88q=  !488*G4"
 "
 txx((""488T->->?3x3}----
r3   c                X    \         P                  ! V P                  V P                  4      # r   )r=   	proc_credr   r   r   s   &r1   r   Process._proc_cred  s     ~~dhh(9(9::r3   c                0    V P                  4       ^ ,          # )r   r   r   s   &r1   r   Process.name  s     '')!,,r3   c                     \         P                  ! V P                   R V P                   R24      #   \         d     Mi ; iT P                  4        R# )r   z/path/a.outrr   )r'   readlinkr   r   ru   cmdliner   s   &r1   exeProcess.exe  sN    	;;$"3"3!4AdhhZ{KLL 		
 	s   /2 A A c                0    V P                  4       ^,          # )r:   r   r   s   &r1   r   Process.cmdline  s    '')!,,r3   c                X    \         P                  ! V P                  V P                  4      # r   )r=   proc_environr   r   r   s   &r1   rA   Process.environ        4+<+<==r3   c                F    V P                  4       \        R ,          ,          # )r   r   r   r   s   &r1   r   Process.create_time      $$&}]'CDDr3   c                F    V P                  4       \        R ,          ,          # )r   r   r   s   &r1   r   Process.num_threads  r   r3   c                F    V P                  4       \        R ,          ,          # )r   r   r   s   &r1   nice_getProcess.nice_get  s    
 $$&}V'<==r3   c                    V P                   R9   d!   \        V P                   V P                  4      h\        P                  ! V P                   V4      # )   >   r  r;   )r   r
   r   r=   proc_priority_set)r   values   &&r1   nice_setProcess.nice_set  s<    88v
 txx44%%dhh66r3   c                h    V P                  4       \        R ,          ,          V n        V P                  # )r   )r   r   r   r   s   &r1   r   Process.ppid  s&    **,]6-BC
zzr3   c                    V P                  4       w  rp  p\        P
                  ! WV4      #   \         dJ    T P                  4       \        R ,          ,          pT P                  4       \        R,          ,          pRp Lji ; i)r   r   Nr   r
   r   r   r*   puids)r   real	effectivesavedrP   s   &    r1   uidsProcess.uids  sw    	.2oo.?+DUAq!
 yy%00	  	((*=+?@D--/f0EFIE	s   / ABBc                
    V P                  4       w    rr4\        P
                  ! W#V4      #   \         dJ    T P                  4       \        R ,          ,          pT P                  4       \        R,          ,          pRp Lji ; i)r    r!   Nr  )r   rP   r  r  r  s   &    r1   gidsProcess.gids  su    	.2oo.?+Aq!9
 yy%00	  	((*=+?@D--/f0EFIE	s   . ABBc                    \         P                  ! V P                  V P                  4      p\        P                  ! T!  #   \         d9   pTP
                  \
        P                  8X  d   \        '       g   Rp Rp?LQh Rp?ii ; i)        N)r  r  r  r  )
r=   proc_cpu_timesr   r   ru   errno	EOVERFLOW	IS_64_BITr*   	pcputimes)r   timesr   s   &  r1   r_   Process.cpu_times  sd    	''$2C2CDE }}e$$  	yyEOO+II -	s#   +A B*A?7A?>A??Bc                X    \         P                  ! V P                  V P                  4      # r   )r=   proc_cpu_numr   r   r   s   &r1   cpu_numProcess.cpu_num  r   r3   c                b   V P                   pR p\        V P                  4       \        R,          ,          4      pV\        P
                  8w  d3   R F,  p \        P                  ! V RV P                   RV 24      u # 	  V'       d   V P                  4        R# R#   \         d    Rp K\  i ; i)Fr   r   /path/TN)r   r:   r     )r   r   r   r   r=   PRNODEVr'   r   r   r   r   )r   procfs_path
hit_enoentr   r^   s   &    r1   terminalProcess.terminal  s    ''
d335mG6LMN$,,#;;+azs'KLL $    ) !%Js   'BB.-B.c                    V P                   p \        P                  ! V R V P                   R24      #   \         d*    \        P
                  ! T R T P                   24        R# i ; i)r   z	/path/cwdrr   )r   r'   r   r   r   r   )r   r(  s   & r1   cwdProcess.cwd  sa     ''	;;+azCDD  	GG{m1TXXJ/0	s   %4 0A('A(c                    V P                  4       pV\        R ,          ,          R,          pV\        R,          ,          R,          p\        P                  ! W#4      # )r   i   r   )r   r   r*   pmem)r   r]   r   r   s   &   r1   memory_infoProcess.memory_info  sG    ##%-&'$.-&'$.xx!!r3   c                r    V P                  4       \        R ,          ,          p\        P                  VR4      # )r   ?)r   r   PROC_STATUSESget)r   codes   & r1   r   Process.status  s-    $$&}X'>?  s++r3   c                :   V P                   p. p\        P                  ! V R V P                   R24      pRpV FZ  p\	        V4      p \
        P                  ! V P                  WQ4      w  rg\        P                  ! WVV4      pVP                  V4       K\  	  V'       d   V P                  4        V#   \         d_   p	T	P                  \        P                  8X  d   \        '       g    Rp	?	K  T	P                  \        P                  8X  d	   Rp Rp	?	K  h Rp	?	ii ; i)r   z/lwpFNT)r   r'   r   r   rK   r=   query_process_threadr*   pthreadrw   ru   r  r  r  ENOENTr   )
r   r(  r]   tidsr)  tidutimestimer   r   s
   &         r1   threadsProcess.threads  s    ''zz[M488*D9:
Cc(C#88HHc & [[U3

2/ 0  
)  99/		 99,!%Js$   #B11D<*D-!DDDc           	     :   . pR pV P                   pV RV P                   R2p\        P                  ! V RV P                   R24       F  p\        P                  P                  WE4      p\        P                  P                  V4      '       g   KI   \        P                  ! V4      p\        V4      '       d2   VP                  \        P                  ! V\        V4      4      4       K  K  	  V'       d   V P                  4        V#   \         d    Rp K  i ; i)Fr   z/path/fdT)r   r   r'   r   r   joinislinkr   r   rw   r*   	popenfilerK   r   r   )r   ry   r)  r(  pathdirr   r   files   &       r1   
open_filesProcess.open_files8  s    
'' M488*E2**}AdhhZs;<B77<<,Dww~~d##E;;t,D
 %T**s}}T3r7'CD + =   ) !%Js   D		DDc              #    "   R\        V4      .p\        P                  ! V\        P                  \        P                  R7      pVP	                  4       w  rER WE3 4       w  rEVP
                  ^ 8w  d~   RVP                  4       9   d!   \        V P                  V P                  4      hRVP                  4       9   d!   \        V P                  V P                  4      hV: RV 2p\        V4      hVP                  R4      R,          p\        V4       F  w  rV	P                  4       p	V	P                  R	4      '       g   K.  V	P                  R
^4      ^,          p
Wx^,
          ,          P!                  4       pVR8X  d   \"        P$                  pMVR8X  d   \"        P&                  pMRpR\"        P(                  WR\*        P,                  3x  K  	  R# 5i)z<Get UNIX sockets used by process by parsing 'pfiles' output.pfiles)r7   stderrc              3   r   "   T F-  qP                  \        P                  P                  4      x  K/  	  R # 5ir   )rD   rE   r7   rF   ).0r^   s   & r1   	<genexpr>,Process._get_unix_sockets.<locals>.<genexpr>V  s(      
3CaHHSZZ(())3Cs   57zpermission deniedzno such processz command error
r9   r  NNzsockname: AF_UNIX SOCK_STREAM
SOCK_DGRAMrr   Nr   )strr?   r@   rB   rC   rG   lowerr
   r   r   r   rH   rJ   	enumeratelstrip
startswithrI   socketrU  rV  AF_UNIXr   	CONN_NONE)r   r   cmdrO   r7   rN  rQ   rR   irS   r   types   &&          r1   _get_unix_socketsProcess._get_unix_socketsM  su     S"


 
4:3C
 <<1"flln4"488TZZ88 FLLN2#DHHdjj99G+F84Cs##T"2& 'GA;;=D233zz#q)!,U|))+=(!--D\)!,,DD6>>4r7;L;LMM (s   D;GBGc           	     P   \        WP                  R 7      pV'       g0   \        P                  ! V P                   RV P                   24       VR9   dM   TP                  V P                  V P                  4       Uu. uF  p\        P                  ! V!  NK  	  up4       V# u upi ))r   r   >   rx   unix)	r   r   r'   r   r   extendrb  r*   r   )r   r   r]   conns   &&  r1   r   Process.net_connectionso  s    d2 GGt(()488*56 ?"JJ.2.D.DTXX.NO.NdD!.NO 
 Ps   =B#mmapzpath rss anon lockedzaddr perms path rss anon lockedc           	        R  pV P                   p. p \        P                  ! V P                  V4      pRpT Ff  pTw  rrrpT! Y4      pTP                  R4      '       g*    \        P                  ! T RT P                   RT 24      pTP                  YYY34       Kh  	  T'       d   T P                  4        T#   \         d9   pTP
                  \
        P                  8X  d   \        '       g   . u Rp?# h Rp?ii ; i  \         dA   pTP
                  \
        P                  8X  d   T RT P                   RT 2pRp Rp?Lh Rp?ii ; i)c                     R P                  \        V 4      R,          P                  R4      \        V4      R,          P                  R4      4      # )z{}-{}rS  L)formathexrI   )startends   &&r1   toaddr#Process.memory_maps.<locals>.toaddr  s>    >>E
2$$S)3s8B<+=+=c+B r3   NF[r   r%  T)r   r=   proc_memory_mapsr   ru   r  r  r  r[  r'   r   r<  rw   r   )r   rq  r(  ry   r   r   r)  r   r   addrsizepermr   r   anonlockeds   &              r1   memory_mapsProcess.memory_maps  s5   	
 ''	++DHHkBG 
D<@9DD6$)D??3'';;+azv'NOD NND4@A% &  E  	yyEOO+II 		&  yyELL0 #.azvF%)
sG   !B< "(D<C?*C:2C:3C?9C::C?E5EEEc                t    \        \        P                  ! V P                   R V P                   R24      4      # )r   rD  )r   r'   r   r   r   r   s   &r1   num_fdsProcess.num_fds  s.    2::!2!2 31TXXJcBCDDr3   c                |    \         P                  ! \        P                  ! V P                  V P
                  4      !  # r   )r*   pctxswr=   proc_num_ctx_switchesr   r   r   s   &r1   num_ctx_switchesProcess.num_ctx_switches  s-    zz''$2C2CD
 	
r3   Nc                X    \         P                  ! V P                  WP                  4      # r   )r   wait_pidr   r   )r   timeouts   &&r1   waitProcess.wait  s      7JJ??r3   )r   r   r   r   )_cacher   r   r   r   )inetr   ).__name__
__module____qualname____firstlineno____doc__	__slots__r   r   r   r   r   r   r   r   r   r   r   r   rA   r   r   r  r  r   r  r  r_   r"  r*  r-  r1  memory_full_infor   rA  rJ  rb  r   r   nt_mmap_groupednt_mmap_extry  r|  r  r  __static_attributes____classdictcell__)__classdict__s   @r1   r   r   Z  s    ;CI.3-
/
 D  D    ;  ; - - 	 	 - - > > E E E E > > 7 7   1 1 1 1 % %" > > ! ! 
 
 " " #, ,
  B  ( ND  $ !)?@OV%FGK, ,\ E E 
 

 @ @r3   r   )	CONN_IDLE
CONN_BOUNDPROCFS_PATHl        )F)r   )dr  r  r   r'   r\  r?   rE   collectionsr   r   rr   r   r   r*   r   r   r=   r   r	   r
   r   r   r   r   r   r   r   r   r   __extra__all__getpagesizer)   AF_LINKmaxsizer  r  r  SSLEEPSTATUS_SLEEPINGSRUNSTATUS_RUNNINGSZOMBSTATUS_ZOMBIESSTOPSTATUS_STOPPEDSIDLSTATUS_IDLESONPROCSWAITSTATUS_WAITINGr5  TCPS_ESTABLISHEDCONN_ESTABLISHEDTCPS_SYN_SENTCONN_SYN_SENTTCPS_SYN_RCVDCONN_SYN_RECVTCPS_FIN_WAIT_1CONN_FIN_WAIT1TCPS_FIN_WAIT_2CONN_FIN_WAIT2TCPS_TIME_WAITCONN_TIME_WAITTCPS_CLOSED
CONN_CLOSETCPS_CLOSE_WAITCONN_CLOSE_WAITTCPS_LAST_ACKCONN_LAST_ACKTCPS_LISTENCONN_LISTENTCPS_CLOSINGCONN_CLOSINGPSUTIL_CONN_NONEr^  	TCPS_IDLE
TCPS_BOUNDr   dictr   r2   rV   r_   rX   re   rg   ri   disk_io_countersrt   rs   net_io_countersnet_if_addrsr   r   r   r   r   r   r   r   rd   r3   r1   <module>r     s  
 .   	   
 "     #   ! " "  $ " + $ % "; 	
,,KK%		
 	KK((IIw%%JJ%%JJ&&IIw""LL'((JJ&& 	733----'00'00//g(('11--g))w++7,,NNIOOZ" 	
			

		

	*8&\7,"
N ((   
> &&  > 
0=$
:f@ f@r3   