uawdijnntqw1x1x1
IP : 3.12.149.139
Hostname : ns1.eurodns.top
Kernel : Linux ns1.eurodns.top 4.18.0-553.5.1.lve.1.el7h.x86_64 #1 SMP Fri Jun 14 14:24:52 UTC 2024 x86_64
Disable Function : mail,sendmail,exec,passthru,shell_exec,system,popen,curl_multi_exec,show_source,eval,open_base
OS : Linux
PATH:
/
home
/
..
/
lib
/
python2.7
/
site-packages
/
procfs
/
..
/
iotop
/
data.pyc
/
/
� E"�[c@sddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ej jd�Zyddl mZe�ZWn eZnXeZes�er ed�ed�es�ed�nes�ed�nejd �ndd lmZmZddlmZmZmZmZddlmZmZd e fd��YZ!de!fd��YZ"d Z#d Z$dZ%d Z&dZ'de fd��YZ(d�Z)d�Z*d�Z+de!fd��YZ,de!fd��YZ-de!fd��YZ.dS(i����(tprint_functionNs /proc/self/io(tVmStats<Could not run iotop as some of the requirements are not met:s- Linux >= 2.6.20 withs` - I/O accounting support (CONFIG_TASKSTATS, CONFIG_TASK_DELAY_ACCT, CONFIG_TASK_IO_ACCOUNTING)s0 - VM event counters (CONFIG_VM_EVENT_COUNTERS)i(tiopriotvmstat(t ConnectiontNETLINK_GENERICtU32Attrt NLM_F_REQUEST(t ControllertGeNlMessagetDumpableObjectcBseZdZd�ZRS(sFBase class for all objects that allows easy introspection when printedcCs*dtt|��d tj|j�fS(Ns%s: %s>i����(tstrttypetpprinttpformatt__dict__(tself((s./usr/lib/python2.7/site-packages/iotop/data.pyt__repr__?s(t__name__t __module__t__doc__R(((s./usr/lib/python2.7/site-packages/iotop/data.pyR =stStatscBsYeZdddddgZeZd �Zdd�Zd �Zd�Ze d��Z RS(tblkio_delay_totali(tswapin_delay_totali8t read_bytesi�twrite_bytesitcancelled_write_bytesicCsp|j}xBtjD]7\}}|||d!}tjd|�d||<qWtjsl|jdkt_ndS(NitQi(RRtmembers_offsetststructtunpackthas_blkio_delay_totalR(Rttask_stats_buffertsdtnametoffsettdata((s./usr/lib/python2.7/site-packages/iotop/data.pyt__init__Rs ic CsS|j}|j}|j}x1tjD]&\}}|||||||<q%WdS(s3Update destination from operator(self, other_stats)N(RRR( Rtother_statstdestinationtcoefftddR!todtmemberR#((s./usr/lib/python2.7/site-packages/iotop/data.pyt accumulate]s cCs|j||dd�S(s*Update destination with self - other_statsR(i����(R,(RR&R'((s./usr/lib/python2.7/site-packages/iotop/data.pytdeltaescCs;|j}x+tjD] \}}||dkrtSqWtS(Ni(RRRtFalsetTrue(RR!R"R#((s./usr/lib/python2.7/site-packages/iotop/data.pytis_all_zerois cCs@tjt�}|j}x!tjD]\}}d||<q"W|S(Ni(Rt__new__RR(tstatststdR"R#((s./usr/lib/python2.7/site-packages/iotop/data.pytbuild_all_zerops (sblkio_delay_totali((sswapin_delay_totali8(s read_bytesi�(swrite_bytesi(Ri(RRRR.RR%R,R-R0tstaticmethodR4(((s./usr/lib/python2.7/site-packages/iotop/data.pyRGs iitTaskStatsNetlinkcBs#eZd�Zd�Zd�ZRS(cCs=||_tt�|_t|j�}|jd�|_dS(Nt TASKSTATS(toptionsRRt connectionRt get_family_idt family_id(RR8t controller((s./usr/lib/python2.7/site-packages/iotop/data.pyR%�s cCs+t|jdtdtt|�gdt�S(Ntcmdtattrstflags(R R;tTASKSTATS_CMD_GETRtTASKSTATS_CMD_ATTR_PIDR(Rttid((s./usr/lib/python2.7/site-packages/iotop/data.pyt build_request�scCs�|jj|j�ytj|j�}Wn,tk rW}|jtjkrQdS�nXx=|jj �D](\}}|t krh|j�}PqhqhWdS|tj }t|�dkr�dStjd|d �d}|dks�t�t|�S(NitHiii(ttask_stats_requesttsendR9R trecvtOSErrorterrnotESRCHR>titemstTASKSTATS_TYPE_AGGR_PIDtnestedtTASKSTATS_TYPE_STATSR$tlenRRtAssertionErrorR(Rtthreadtreplytet attr_typet attr_valuettaskstats_datattaskstats_version((s./usr/lib/python2.7/site-packages/iotop/data.pytget_single_task_stats�s$ (RRR%RCRX(((s./usr/lib/python2.7/site-packages/iotop/data.pyR6�s cCs�g|_t}x�|jpgD]�}yt|�}Wn]tk r�ytj|�}Wn-tk r�td|dt j �t}q�X|j}nX|s|jj |�qqW|r�t jd�ndS(sDBuild options.uids from options.users by resolving usernames to UIDss Unknown user:tfileiN(tuidsR.tuserstintt ValueErrortpwdtgetpwnamtKeyErrortprinttsyststderrR/tpw_uidtappendtexit(R8terrortutuidtpasswd((s./usr/lib/python2.7/site-packages/iotop/data.pyt find_uids�s cCs�i}ybx[td|�D]I}y|jdd�\}}Wntk rRqnX|j�||<qWWntk r{nX|S(Ns/proc/%d/statust:i(topentsplitR]tstriptIOError(tpidtresult_dicttlinetkeytvalue((s./usr/lib/python2.7/site-packages/iotop/data.pytparse_proc_pid_status�s cCsDy|jd�SWn,tk r.|jd�Stk r?|SXdS(Nsutf-8t string_escape(tdecodetUnicodeDecodeErrortencodetAttributeError(ts((s./usr/lib/python2.7/site-packages/iotop/data.pytsafe_utf8_decode�s t ThreadInfocBs2eZdZd�Zd�Zd�Zd�ZRS(sStats for a single threadcCsC||_t|_d|_tjt�|_|j|�|_ dS(N( RBR/tmarktNonetstats_totalRR1tstats_deltaRCRE(RRBttaskstats_connection((s./usr/lib/python2.7/site-packages/iotop/data.pyR%�s cCstj|j�S(N(RtgetRB(R((s./usr/lib/python2.7/site-packages/iotop/data.pyt get_ioprio�scCstjtj|j||�S(N(Rt set_iopriotIOPRIO_WHO_PROCESSRB(Rtioprio_classtioprio_data((s./usr/lib/python2.7/site-packages/iotop/data.pyR��scCs8|js||_n|j|j|j�||_dS(N(R�R-R�(RR2((s./usr/lib/python2.7/site-packages/iotop/data.pytupdate_stats�s (RRRR%R�R�R�(((s./usr/lib/python2.7/site-packages/iotop/data.pyR~�s tProcessInfocBsqeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z d �Zd �Zd�Z RS(s�Stats for a single process (a single line in the output): if options.processes is set, it is a collection of threads, otherwise a single thread.cCsU||_d|_d|_i|_tj�|_tj�|_t j �|_ dS(N(RqR�RitusertthreadsRR4R�tstats_accumttimetstats_accum_timestamp(RRq((s./usr/lib/python2.7/site-packages/iotop/data.pyR%�s cCsO|jr)|jr)|j|jkr)tS|jrK|j�|jkrKtStS(N(tpidst processesRqR.RZtget_uidR/(RR8((s./usr/lib/python2.7/site-packages/iotop/data.pytis_monitored�scCss|jr|jSy!tjd|j�tj}Wntk rJd}nX||jkrod|_||_n|S(Ns/proc/%d(RitoststatRqtST_UIDRHR�R�(RRi((s./usr/lib/python2.7/site-packages/iotop/data.pyR� s ! cCsz|j�}|dk rm|jrmyttj|�j�|_Wqmttfk rit |�|_qmXn|jpydS(Ns{none}( R�R�R�R}R^tgetpwuidtpw_nameR`R{R(RRi((s./usr/lib/python2.7/site-packages/iotop/data.pytget_userscCsjy&td|j�}|jd�}Wntk r:dSXt|j�}|s|jdd�}|rud|}nd}|Sd}t|jd|j��}||jkr�t|�jdd�}|jdd�}||kr�|d |7}q�n|jd �} | djd�rG| dj d�d } | d| | d<ndj | �j�}t||�S(Ns/proc/%d/cmdlineis{no such process}tNamets[%s]s {no name}tTgids [%s]tit/it ( RmRqtreadRpRvR�R\Rnt startswithtrfindtjoinRoR}(Rtproc_cmdlinetcmdlinetproc_statustproc_status_nametsuffixttgidt tgid_nametthread_nametpartstfirst_command_char((s./usr/lib/python2.7/site-packages/iotop/data.pytget_cmdline#s2 cCsE|r|jj�Sx*|jj�D]}|jj�s$tSq$WtS(N(R�R0R�tvaluesR�R/R.(Rtaccumulatedtt((s./usr/lib/python2.7/site-packages/iotop/data.pytdid_some_ioBscCs?td�|jj�D��}t|�dkr;|j�SdS(Ncss|]}|j�VqdS(N(R�(t.0R�((s./usr/lib/python2.7/site-packages/iotop/data.pys <genexpr>Ksis?dif(tsetR�R�ROtpop(Rt priorities((s./usr/lib/python2.7/site-packages/iotop/data.pyR�Js cCs.x'|jj�D]}|j||�qWdS(N(R�R�R�(RR�R�RQ((s./usr/lib/python2.7/site-packages/iotop/data.pyR�PscCstj|j��S(N(Rtsort_keyR�(R((s./usr/lib/python2.7/site-packages/iotop/data.pytioprio_sort_keyTscCs>|jj|d�}|s:t||�}||j|<n|S(N(R�R�R�R~(RRBR�RQ((s./usr/lib/python2.7/site-packages/iotop/data.pyt get_threadWs cCs�tj�}x<|jj�D]+\}}|js|j|j|�qqWtg|jj�D]!\}}|js^||f^q^�|_t|j�}|s�t S|j |:_ |j|:_||_|jj|j|j�t S(N(RR4R�RKRR,R�tdictROR.RRR�R/(RR�RBRQt nr_threads((s./usr/lib/python2.7/site-packages/iotop/data.pyR�^s : (RRRR%R�R�R�R�R�R�R�R�R�R�(((s./usr/lib/python2.7/site-packages/iotop/data.pyR��s tProcessListcBsGeZd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cCsGi|_||_||_tj�|_tj�|_|j�dS(N(R�R�R8R�t timestampRRtupdate_process_counts(RR�R8((s./usr/lib/python2.7/site-packages/iotop/data.pyR%ss cCsQ|jj|d�}|s7t|�}||j|<n|j|j�rM|SdS(syEither get the specified PID from self.processes or build a new ProcessInfo if we see this PID for the first timeN(R�R�R�R�R�R8(RRqtprocess((s./usr/lib/python2.7/site-packages/iotop/data.pytget_process~scCs�|jjr|jjStjd�}|jjrng|D]2}d|dkoYdknr8t|�^q8Sg}xp|D]h}d|dko�dknr{y+|jtttjd|d���Wq�tk r�q�Xq{q{W|S(Ns/proct0it9s/proc/s/task( R8R�R�tlistdirR�R\textendtmapRH(RttgidsR�ttids((s./usr/lib/python2.7/site-packages/iotop/data.pyt list_tgids�s = + cCs�|jjs|gSy&ttttjd|���}Wntk rMgSX|jjr�tt |jj�j t |���}n|S(Ns /proc/%d/task(R8R�tlistR�R\R�R�RHR�R�tintersection(RR�R�((s./usr/lib/python2.7/site-packages/iotop/data.pyt list_tids�s& *c Cs�tj�}||j|_||_d}}x�|j�D]�}|j|�}|s]q<nx�|j|�D]o}|j||j�}|jj|�}|rm|j |�|j } || j7}|| j7}t |_qmqmWq<W||f|jj�fS(Ni(R�R�tdurationR�R�R�R�R�RXR�R�RRR.RRR-( Rt new_timestampt total_readttotal_writeR�R�RBRQR2R-((s./usr/lib/python2.7/site-packages/iotop/data.pyR��s$ cCs�x:|jj�D])}x |jj�D]}t|_q&WqW|j�}tg|jj�D]$\}}|j�r\||f^q\�|_|S(N( R�R�R�R/RR�R�RKR�(RR�RQttotal_read_and_writeRq((s./usr/lib/python2.7/site-packages/iotop/data.pytrefresh_processes�s$cCs i|_dS(N(R�(R((s./usr/lib/python2.7/site-packages/iotop/data.pytclear�s( RRR%R�R�R�R�R�R�(((s./usr/lib/python2.7/site-packages/iotop/data.pyR�rs (/t __future__RRIR�R R^R�RRbR�tpathtexiststioaccountingtiotop.vmstatRtvmstat_fR.tvm_event_countersR/RaRftiotopRRt iotop.netlinkRRRRtiotop.genetlinkRR tobjectR RR@RARLtTASKSTATS_TYPE_PIDRNR6RkRvR}R~R�R�(((s./usr/lib/python2.7/site-packages/iotop/data.pyt<module>sP " 5) �
/home/../lib/python2.7/site-packages/procfs/../iotop/data.pyc