관리-도구
편집 파일: _psbsd.cpython-38.pyc
U �Mg�} � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlm Z ddl mZ ddl mZ dd l m Z dd l mZ ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm!Z! g Z"e�r�ej#ej$ej%ej&ej'ej(ej)ej*ej+ej,ej-ej.ej/ej0iZ1n~e�r�ej#ej$ej'ej(ej)ej*ej2ej,ej+ej,ej%ej3ej4ej&iZ1n:e�r�ej#ej$ej'ej(ej)ej*ej+ej,ej%ej3ej4ej&iZ1ej5ej6ej7ej8ej9ej:ej;ej<ej=ej>ej?ej@ejAejBejCejDejEejFejGejHejIejJejKejLiZMe�N� ZOejPZPeQed�ZReQed�ZSeQed�ZTeQed�ZUeVdddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6�ZWed7d8d9d:d;d<d=d>d?d@dAdBg�ZXedCdDdEdFdGdHg�ZYedIdJdKdLdMdNg�ZZeZZ[edOdDdFdPdQg�Z\edRdS�Z]edTdU�Z^e�rdedVdWdXdYdZd[d\d]g�Z_nedVdWdXdYdZg�Z_d^d_� Z`d`da� Zadbdc� ZbeR�r�ddd� Zcnded� Zcdfec_ddgdh� Zee�s�e�r�didj� Zfndkdj� Zfdldm� Zge�r�dndo� Zhne�r�dpdo� Zhd�dqdr�ZiejjZjejkZkejlZlejmZmdsdt� Zndudv� Zoe�r@dwdx� Zpdydz� Zqd{d|� Zrd}d~� Zsedd�� �Ztd�d�� Zue�rtd�d�� Zvne�r�d�d�� ZvnejvZvd�d�� Zwd�d�� Zxejyd�d�� �ZzG d�d�� d��Z{dS )�z5FreeBSD, OpenBSD and NetBSD platforms implementation.� N)�defaultdict)� namedtuple)�ElementTree� )�_common)�_psposix)�_psutil_bsd)� _psutil_posix)�FREEBSD)�NETBSD)�OPENBSD)�AccessDenied)� NoSuchProcess)� ZombieProcess)� conn_tmap)�conn_to_ntuple)�debug)�memoize)�memoize_when_activated)� usage_percent)�FileNotFoundError)�PermissionError)�ProcessLookupError)�which� per_cpu_times�proc_num_threads�proc_open_files�proc_num_fds� � � � � � � � � � � � � � � � � � � � � � � )�ppid�status�real_uid� effective_uid� saved_uid�real_gid� effective_gid� saved_gid�ttynr�create_time�ctx_switches_vol�ctx_switches_unvol� read_io_count�write_io_count� user_time�sys_time�ch_user_time�ch_sys_time�rss�vms�memtext�memdata�memstack�cpunum�name�svmem�total� available�percent�used�free�active�inactive�buffers�cached�shared�wired� scputimes�user�nice�system�idle�irq�pmemrG rH �text�data�stack� pcputimes� children_user�children_system� pmmap_grouped�*path rss, private, ref_count, shadow_count� pmmap_ext�6addr, perms path rss, private, ref_count, shadow_count�sdiskioZ read_countZwrite_count� read_bytes�write_bytesZ read_timeZ write_timeZ busy_timec C s� t �� } tr�| \}}}}}}tdd��N}|D ]B}|�d�rPt|�� d �d } q,|�d�r,t|�� d �d } q,W 5 Q R X || }|| }n,| \}}}}}}} } || | }|| | }t|| |dd�} t||| ||||| || |�S )Nz /proc/meminfo�rbs Buffers:r i s MemShared:�Zround_) �cextZvirtual_memr �open� startswith�int�splitr rN )ZmemrO rS rT rU rY rW �f�linerV rX rR ZavailrQ � rw �=/opt/hc_python/lib64/python3.8/site-packages/psutil/_psbsd.py�virtual_memory� s8 �ry c C s4 t �� \} }}}}t|| dd�}t�| |||||�S )z@System swap memory as (total, used, free, sin, sout) namedtuple.r ro )rp Zswap_memr r Zsswap)rO rR rS �sinZsoutrQ rw rw rx �swap_memory� s r{ c C s"