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.7/__pycache__/profile.cpython-37.pyc
B

{aV@spdZddlZddlZddlZdddgZGdddZdd	dZdd
dZGdddZdd
Z	e
dkrle	dS)z Class for profiling Python code.NrunrunctxProfilec@s0eZdZdZddZddZddZdd	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.7/profile.py__init__/sz_Utils.__init__cCsF|}z(y||Wntk
r,YnXWd||||XdS)N)rr
SystemExit_show)r	statementfilenamesortprofrrr	r2s
z
_Utils.runcCsJ|}z,y||||Wntk
r0YnXWd||||XdS)N)rrrr)rr
globalslocalsrrrrrr	r;s
z
_Utils.runctxcCs"|dk	r||n
||dS)N)
dump_statsprint_stats)rrrrrrr	rDsz_Utils._showN)__name__
__module____qualname____doc__r
rrrrrrr	r)s
		rcCstt|||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)r
rrrrr	rPscCstt|||||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)r
rrrrrrr	r]sc@seZdZdZdZd4ddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
ee
e
ee
e
dZddZGdddZGdddZddZdd Zd5d"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd6d0d1Zd2d3ZdS)7raProfiler 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.
    rNcCsi|_d|_d|_d|_|dkr&|j}||_|sHtj|_|_|j	|_
nl||_|}yt|}Wn"tk
r||_|j	|_
Yn0X|dkr|j
|_
n|j|_
|tfdd}||_||_|ddS)NcSs
||S)Nr)timersumrrr	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,lengthrrrr	r
s0


zProfile.__init__cCs|j}|}|d|d|j|j}|dkr8|j|_|j||||rd|}|d|d|_n|}|d|d||_dS)Nrc_call)rr,r#rr"dispatch)rframeeventargrr,rrrr	r*szProfile.trace_dispatchcCsT|j}||j|j}|dkr(|j|_|j||||rD||_n|||_dS)Nr0)rr,r#rr"r1)rr2r3r4rr,rrr	r&s
zProfile.trace_dispatch_icCs`|j}|d|j|j}|dkr,|j|_|j||||rL|d|_n|d||_dS)NgN@r0)rr,r#rr"r1)rr2r3r4rr,rrr	trace_dispatch_macszProfile.trace_dispatch_maccCsT|j}||j|j}|dkr(|j|_|j||||rD||_n|||_dS)Nr0)r%r,r#rr"r1)rr2r3r4r%r,rrr	r+s
zProfile.trace_dispatch_lc	CsD|j\}}}}}}||k	r*|r*|||S|||||||f|_dS)Nr/)r trace_dispatch_return)	rr2r,rptritretrfnrframercurrrr	trace_dispatch_exceptions
z Profile.trace_dispatch_exceptioncCs|jr|j|jdk	r|j\}}}}}}t|tjs|j|jksXtd|||j||jf||d|jdks|j|jdkstd|jdf|j}	|	j|	j	|	j
f}
|dd|
||jf|_|j}|
|kr||
\}}
}}}||
d|||f||
<nddddif||
<dS)NzBad callrr/)r f_back
isinstancer
fake_frameAssertionErrorr7f_codeco_filenameco_firstlinenoco_namer)rr2r,r8r9r:r;r<r=Zfcodefnrccnsttctcallersrrr	trace_dispatch_calls&
zProfile.trace_dispatch_callc
Csndd|jf}|dd|||jf|_|j}||krX||\}}}}}	||d|||	f||<nddddif||<dS)Nrrr/)r"r r)
rr2r,rIrrJrKrLrMrNrrr	trace_dispatch_c_callszProfile.trace_dispatch_c_callcCs||jdk	rB||jdjks0td|jdf||jdd|j\}}}}}}||}||}|\}	}
}}}
}|	|
|||||
|f|_|j}||\}}}}}|s||}|d}||kr||d||<nd||<||d||||f||<dS)Nr?z
Bad returnr@rr/)r rArDr7r)rr2r,r8r9r:r;r=Zframe_totalZpptZpitZpetZpfnpframeZpcurrrJrKrLrMrNrrr	r7!s$"zProfile.trace_dispatch_return)callZ	exceptionreturnr0Zc_exceptionZc_returncCs"|jdrdS||_||dS)Nr)r r!r-)rr!rrr	set_cmdWs
zProfile.set_cmdc@seZdZddZddZdS)zProfile.fake_codecCs||_||_||_d|_dS)Nr)rFco_linerHrG)rrlinenamerrr	r
]szProfile.fake_code.__init__cCst|j|j|jfS)N)reprrFrUrH)rrrr	__repr__cszProfile.fake_code.__repr__N)rrrr
rYrrrr		fake_code\srZc@seZdZddZdS)zProfile.fake_framecCs||_||_dS)N)rErA)rcodeZpriorrrr	r
gszProfile.fake_frame.__init__N)rrrr
rrrr	rCfsrCcCsF|dd|}|jr |jd}nd}|||}|jd||ddS)NZprofilerr?rR)rZr rCr1)rrWr[rQr2rrr	r-kszProfile.simulate_callcCsN|j}||j}x*|jdr<|jd||jd|d}qW|||_dS)NrrSr?r)r%r,r r1)rr%r,rrr	simulate_cmd_completewszProfile.simulate_cmd_completercCs$ddl}|||dS)Nr)pstatsZStatsZ
strip_dirsZ
sort_statsr)rrr]rrr	rszProfile.print_statsc	Cs0t|d}|t|j|WdQRXdS)Nwb)opencreate_statsmarshaldumpstats)rfilefrrr	rszProfile.dump_statscCs||dS)N)r\snapshot_stats)rrrr	r`szProfile.create_statsc	Csfi|_xZ|jD]L\}\}}}}}|}d}x|D]}||7}q:W|||||f|j|<qWdS)Nr)rcritemscopyvalues)	rfuncrJrKrLrMrNZncZcallcntrrr	rfszProfile.snapshot_statscCsddl}|j}||||S)Nr)__main____dict__r)rr!rkdictrrr	rszProfile.runc	Cs8||t|jzt|||WdtdX|S)N)rTsys
setprofiler'exec)rr!rrrrr	rs
zProfile.runctxc	Os6|t|t|jz
|||StdXdS)N)rTrXrnror')rrjargskwrrr	runcalls

zProfile.runcallcCs8|jtk	rtd|j}d|_z|||S||_XdS)Nz&Subclasses must override .calibrate().r)	__class__rr)r#_calibrate_inner)rmverboseZ
saved_biasrrr		calibrates
zProfile.calibratecCs"|j}dd}|fdd}|||}|||}||}|rLtd|t}	|}|	dtt|}||}
|rtd|
d}d}x>|	jD]0\\}
}}\}}}}}|d	kr||7}||7}qW|rtd
|td|||dkrtd
|||d|}|rtd||S)NcSsxt|D]}d}q
WdS)Nr/)range)nixrrr	f1sz$Profile._calibrate_inner.<locals>.f1cSsxt|D]}|dq
WdS)Nd)ry)rvr}r{rrr	resz#Profile._calibrate_inner.<locals>.fz elapsed time without profiling =zf(m)zelapsed time with profiling =g)rer}z!'CPU seconds' profiler reported =ztotal # calls =r/z internal error: total calls = %dg@z+mean stopwatch overhead per profile event =)	r%printrrrrrrg
ValueError)rrvrwr%r}reZt0Zt1Zelapsed_noprofilepZelapsed_profileZtotal_callsZ
reported_timerrVfuncnamerJrKrLrMrNZmeanrrr	rusB

"


zProfile._calibrate_inner)NN)r)r)rrrrr#r
r*r&r6r+r>rOrPr7r1rTrZrCr-r\rrr`rfrrrsrxrurrrr	rfs>%
''




1
c
	Cs
ddl}ddlm}d}||d}d|_|jdddd	dd
|jddd
ddd
tjddsp|td|	\}}|tjdd<t
|dkr|d}tjd|j
|t|d}t||d}WdQRX|dddd}	t||	d|j|jn||S)Nr)OptionParserz?profile.py [-o output_file_path] [-s sort] scriptfile [arg] ...)usageFz-oz	--outfileoutfilezSave stats to <outfile>)desthelpdefaultz-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classrr/rrbrprk)__file__r__package__
__cached__)osZoptparserZallow_interspersed_argsZ
add_optionrnargvZprint_usageexit
parse_argsr(pathinsertdirnamer_compilereadrrr)
rrrparserZoptionsrqZprognamefpr[Zglobsrrr	main(s6




rrk)Nr)Nr)rrnr$ra__all__rrrrrrrrrr	<module>	s

'

	E%