HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.5/__pycache__/profile.cpython-35.pyc


FaV@sdZddlZddlZddlZddlZddlmZdddgZGdddZdd	d
dZ	dd	ddZ
GdddZd
dZe
dkredS)z Class for profiling Python code.N)OptionParserrunrunctxProfilec@sFeZdZdZddZddZddZdd	Zd
S)_UtilszSupport class for utility functions which are shared by
    profile.py and cProfile.py modules.
    Not supposed to be used directly.
    cCs
||_dS)N)profiler)selfrr	/usr/lib/python3.5/profile.py__init__1sz_Utils.__init__cCsQ|j}z*y|j|Wntk
r4YnXWd|j|||XdS)N)rr
SystemExit_show)r	statementfilenamesortprofr	r	r
r4s
	z
_Utils.runcCsW|j}z0y|j|||Wntk
r:YnXWd|j|||XdS)N)rrrr
)rrglobalslocalsrrrr	r	r
r=s
	z
_Utils.runctxcCs-|dk	r|j|n
|j|dS)N)
dump_statsprint_stats)rrrrr	r	r
r
Fsz_Utils._showN)__name__
__module____qualname____doc__rrrr
r	r	r	r
r+s
		rcCsttj|||S)aRun statement under profiler optionally saving results in filename

    This function takes a single argument that can be passed to the
    "exec" statement, and an optional file name.  In all cases this
    routine attempts to "exec" its first argument and gather profiling
    statistics from the execution. If no file name is present, then this
    function automatically prints a simple profiling report, sorted by the
    standard name string (file/line/function-name) that is presented in
    each line.
    )rrr)rrrr	r	r
rRscCsttj|||||S)zRun statement under profiler, supplying your own globals and locals,
    optionally saving results in filename.

    statement and filename have the same semantics as profile.run
    )rrr)rrrrrr	r	r
r_sc@steZdZdZdZddddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
dede
de
dede
de
iZddZGdddZGd d!d!Zd"d#Zd$d%Zd9d'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zdd5d6Zd7d8ZdS):raProfiler class.

    self.cur is always a tuple.  Each such tuple corresponds to a stack
    frame that is currently active (self.cur[-2]).  The following are the
    definitions of its members.  We use this external "parallel stack" to
    avoid contaminating the program that we are profiling. (old profiler
    used to write into the frames local dictionary!!) Derived classes
    can change the definition of some entries, as long as they leave
    [-2:] intact (frame and previous tuple).  In case an internal error is
    detected, the -3 element is used as the function name.

    [ 0] = Time that needs to be charged to the parent frame's function.
           It is used so that a function call will not have to access the
           timing data for the parent frame.
    [ 1] = Total time spent in this frame's function, excluding time in
           subfunctions (this latter is tallied in cur[2]).
    [ 2] = Total time spent in subfunctions, excluding time executing the
           frame's function (this latter is tallied in cur[1]).
    [-3] = Name of the function that corresponds to this frame.
    [-2] = Actual frame that we correspond to (used to sync exception handling).
    [-1] = Our parent 6-tuple (corresponds to frame.f_back).

    Timing data for each function is stored as a 5-tuple in the dictionary
    self.timings[].  The index is always the name stored in self.cur[-3].
    The following are the definitions of the members:

    [0] = The number of times this function was called, not counting direct
          or indirect recursion,
    [1] = Number of times this function appears on the stack, minus one
    [2] = Total time spent internal to this function
    [3] = Cumulative time that this function was present on the stack.  In
          non-recursive functions, this is the total execution time from start
          to finish of each invocation of a function, including time spent in
          all subfunctions.
    [4] = A dictionary indicating for each function name, the number of times
          it was called by us.
    rNcCsi|_d|_d|_d|_|dkr9|j}||_|sjtj|_|_|j	|_
n||_|j}yt|}Wn'tk
r||_|j	|_
YnCX|dkr|j
|_
n|j|_
|tdd}||_|j|_|jddS)NcSs
||S)Nr	)timersumr	r	r
get_time_timersz(Profile.__init__.<locals>.get_time_timerr)timingscurcmdc_func_namebiastimeZprocess_timerget_timetrace_dispatch_i
dispatcherlen	TypeErrortrace_dispatchtrace_dispatch_lrt
simulate_call)rrr$r-Zlengthrr	r	r
rs0							
		zProfile.__init__cCs|j}|}|d|d|j|j}|dkrJ|j|_|j||||r|}|d|d|_n"|}|d|d||_dS)Nrrc_call)rr-r$rr#dispatch)rframeeventargrr-rr	r	r
r+s		 		zProfile.trace_dispatchcCst|j}||j|j}|dkr8|j|_|j||||r`||_n|||_dS)Nr/)rr-r$rr#r0)rr1r2r3rr-r	r	r
r's	zProfile.trace_dispatch_icCs|j}|d|j|j}|dkr<|j|_|j||||rh|d|_n|d||_dS)NgN@r/)rr-r$rr#r0)rr1r2r3rr-r	r	r
trace_dispatch_macs	zProfile.trace_dispatch_maccCst|j}||j|j}|dkr8|j|_|j||||r`||_n|||_dS)Nr/)r&r-r$rr#r0)rr1r2r3r&r-r	r	r
r,s	zProfile.trace_dispatch_lc	Cs`|j\}}}}}}||k	r=|r=|j||S|||||||f|_dS)Nr)r!trace_dispatch_return)	rr1r-rptritretrfnrframercurr	r	r
trace_dispatch_exceptions
z Profile.trace_dispatch_exceptioncCsz|jr|j|jdk	r|j\}}}}}}t|tjs|j|jkstd|||j||jf|j|d|jdks|j|jdkstd|jdf|j}	|	j|	j	|	j
f}
|dd|
||jf|_|j}|
|kr]||
\}}
}}}||
d|||f||
<nddddif||
<dS)	NrzBad callrrr?)r!f_back
isinstancer
fake_frameAssertionErrorr6f_codeco_filenameco_firstlinenoco_namer )rr1r-r7r8r9r:r;r<Zfcodefnr ccnsttctcallersr	r	r
trace_dispatch_calls&			 zProfile.trace_dispatch_callc
Csdd|jf}|dd|||jf|_|j}||kr~||\}}}}}	||d|||	f||<nddddif||<dS)Nrrr)r#r!r )
rr1r-rIr rJrKrLrMrNr	r	r
trace_dispatch_c_calls	 zProfile.trace_dispatch_c_callcCsO||jdk	rY||jdjksBtd|jdf|j|jd	d|j\}}}}}}||}||}|\}	}
}}}
}|	|
|||||
|f|_|j}||\}}}}}|s||}|d}||kr ||d||<n
d||<||d||||f||<dS)
Nrz
Bad returnr>rrr?r?r@r?)r!rArDr6r )rr1r-r7r8r9r:r<Zframe_totalZpptZpitZpetZpfnpframeZpcurr rJrKrLrMrNr	r	r
r6#s$/

#	


!zProfile.trace_dispatch_returncallZ	exceptionreturnr/Zc_exceptionZc_returncCs+|jdrdS||_|j|dS)Nr)r!r"r.)rr"r	r	r
set_cmdYs
	zProfile.set_cmdc@s(eZdZddZddZdS)zProfile.fake_codecCs(||_||_||_d|_dS)Nr)rFco_linerHrG)rrlinenamer	r	r
r_s			zProfile.fake_code.__init__cCst|j|j|jfS)N)reprrFrVrH)rr	r	r
__repr__eszProfile.fake_code.__repr__N)rrrrrZr	r	r	r
	fake_code^sr[c@seZdZddZdS)zProfile.fake_framecCs||_||_dS)N)rErA)rcodeZpriorr	r	r
ris	zProfile.fake_frame.__init__N)rrrrr	r	r	r
rChsrCcCsa|jdd|}|jr.|jd}nd}|j||}|jd||ddS)NZprofilerrrRr?)r[r!rCr0)rrXr\rQr1r	r	r
r.ms	zProfile.simulate_callcCse|j}||j}x5|jdrP|jd||jd|d}qW|||_dS)NrrSrrrTr?)r&r-r!r0)rr&r-r	r	r
simulate_cmd_completeys	
zProfile.simulate_cmd_completercCs2ddl}|j|jj|jdS)Nr)pstatsZStatsZ
strip_dirsZ
sort_statsr)rrr^r	r	r
rszProfile.print_statsc
Cs:t|d$}|jtj|j|WdQRXdS)Nwb)opencreate_statsmarshaldumpstats)rfilefr	r	r
rs
zProfile.dump_statscCs|j|jdS)N)r]snapshot_stats)rr	r	r
ras
zProfile.create_statsc	Csi|_x{|jjD]j\}\}}}}}|j}d}x|jD]}||7}qSW|||||f|j|<qWdS)Nr)rdr itemscopyvalues)	rfuncrJrKrLrMrNZncZcallcntr	r	r
rgs	+zProfile.snapshot_statscCs(ddl}|j}|j|||S)Nr)__main____dict__r)rr"rldictr	r	r
rs	zProfile.runcCsF|j|tj|jzt|||WdtjdX|S)N)rUsys
setprofiler(exec)rr"rrr	r	r
rs
zProfile.runctxcOsI|jt|tj|jz|||SWdtjdXdS)N)rUrYrorpr()rrkargskwr	r	r
runcalls
zProfile.runcallcCsR|jtk	rtd|j}d|_z|j||SWd||_XdS)Nz&Subclasses must override .calibrate().r)	__class__rr*r$_calibrate_inner)rmverboseZ
saved_biasr	r	r
	calibrates		zProfile.calibratecCs|j}dd}|dd}|||}|||}||}|rgtd|t}	|}|	jdtt|}||}
|rtd|
d}d}xU|	jjD]D\\}
}}\}}}}}|dkr||7}||7}qW|r<td|td|||d
kr\td|||d|}|rtd||S)NcSs!xt|D]}d}q
WdS)Nr)range)nixr	r	r
f1sz$Profile._calibrate_inner.<locals>.f1cSs%xt|D]}|dq
WdS)Nd)rz)rwr~r|r	r	r
rfsz#Profile._calibrate_inner.<locals>.fz elapsed time without profiling =zf(m)zelapsed time with profiling =grfr~z!'CPU seconds' profiler reported =ztotal # calls =rz internal error: total calls = %dg@z+mean stopwatch overhead per profile event =)rfr~)	r&printrrrrr rh
ValueError)rrwrxr&r~rfZt0Zt1Zelapsed_noprofilepZelapsed_profileZtotal_callsZ
reported_timerrWfuncnamerJrKrLrMrNZmeanr	r	r
rvsB	
	
	

			

1



zProfile._calibrate_innerrT)rrrrr$rr+r'r5r,r=rOrPr6r0rUr[rCr.r]rrrargrrrtryrvr	r	r	r
rhs>%''



1cCshd}td|}d|_|jdddddd	d
d|jdddd
ddd
dtjdds|jtjd|j\}}|tjdd<t|dkrZ|d}tj	j
dtj	j|t
|d}t|j|d}WdQRXd|ddddddi}t||d|j|jn
|j|S)Nz?profile.py [-o output_file_path] [-s sort] scriptfile [arg] ...usageFz-oz	--outfiledestoutfilehelpzSave stats to <outfile>defaultz-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classrrrrbrq__file__rrl__package__
__cached__rT)rZallow_interspersed_argsZ
add_optionroargvZprint_usageexit
parse_argsr)pathinsertosdirnamer`compilereadrrr)rparserZoptionsrrZprognamefpr\Zglobsr	r	r
main*s2	




rrl)rrorr%rbZoptparser__all__rrrrrrr	r	r	r
<module>	s
'
	"