403 Forbidden


Disable Functions:
Path : /usr/libexec/perf-core/scripts/python/
File Upload :
Command :
Current File : //usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyo

�
G��dc@s�ddlZddlTddlTddlTddlTddd��YZdefd��YZdefd��YZ	e
d	kr�eej�d
kr�ej
dIJed��nejd
ZeZy8ee�Zejd�dkr�eZnej�WnnXerejd�Znejd�Zej�Zx�eD]�Zdekrejd�Zeddkr�ejed
�qeddkr�ejeed
��qeddkr�ej ed
�qeddkr�ej!ed
�qeddkred
Zqq?eZq?Wej"e�ej�s`ededej#�j$���ne%ej�Z&e	ee�Z'e'j(�e&j)�Z*ej�ej+e*�ndS(i����N(t*tTreeItemcBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�ZRS(cCs�||_||_||_t|_d|_g|_dddddddg|_d|_d|_	d|_
d|_d|_|s�|j
�ndS(Niti(tdbtrowtparent_itemtFalset
query_donetchild_counttchild_itemstdatatcomm_idt	thread_idtcall_path_idtbranch_countttimet	setUpRoot(tselfRRR((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyt__init__As											cCs�t|_t|j�}|jd�}|sLtd|j�j���nx~|j�r�|j	d�spqOnt
|j|j|�}|jj
|�|jd7_|j|j	d�|j	d��qOWdS(NsSELECT id, comm FROM commssQuery failed: ii(tTrueRt	QSqlQueryRtexec_t	Exceptiont	lastErrorttexttnexttvalueRRR	tappendtsetUpLevel1(Rtquerytrett
child_item((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyRQs	cCs�t|_||_||jd<g|_d|_t|j�}|jdt	|��}|s~t
d|j�j���nxx|j
�r�t|j|j|�}|jj|�|jd7_|j||jd�|jd�|jd��q�WdS(Nis�SELECT thread_id, ( SELECT pid FROM threads WHERE id = thread_id ), ( SELECT tid FROM threads WHERE id = thread_id ) FROM comm_threads WHERE comm_id = sQuery failed: ii(RRRR
R	RRRRtstrRRRRRRtsetUpLevel2R(RRtcommRRR((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyR_s		
		cCs7||_||_t|�dt|�|jd<dS(Nt:i(RRR R
(RRRtpidttid((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyR!os		cCs|j|S(N(R	(RR((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pytgetChildItemtscCs|jS(N(R(R((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyt
getParentItemwscCs|jS(N(R(R((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pytgetRowzscCsC|js
dS|td�|j}t|jtd�dt��S(Ns0.0ids.1trounding(RtDecimalR tquantizet
ROUND_HALF_UP(Rtbtx((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyttimePercent}s	cCsC|js
dS|td�|j}t|jtd�dt��S(Ns0.0ids.1R)(RR*R R+R,(RR-R.((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyt
branchPercent�s	cCst|j|j|�}|j|_|j|_||_||_||_||jd<|dkrmd}n||jd<t	|�|jd<t	|�|jd<|j
|�|jd<t	|�|jd<|j|�|jd	<|jj
|�|jd7_dS(
Nis[kernel.kallsyms]s[kernel]iiiiii(RRRRRR
RRR
R R/R0R	R(RR
tnametdsotcountRRR((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pytaddChild�s"			
	
cCs�t|_t|j�}|jdt|j�dt|j�dt|j�d�}|st	d|j
�j���nd}d}d}d}d}d}d}	d}
x�|j�r�|j
d�|kr|d7}||j
d	�7}|	|j
d
�|j
d�7}	q�|r8|j|||||	|�n|j
d�}|j
d�}|j
d
�}d}||7}|
|	7}
|j
d	�}|j
d
�|j
d�}	q�W|r�|j|||||	|�n||7}|
|	7}
||jkr;||_|jr;x-|jD]}|j|j�|jd
<qWq;n|
|jkr�|
|_|jr�x-|jD]}|j|j�|jd
<qfWq�ndS(Ns�SELECT id, call_path_id, branch_count, call_time, return_time, ( SELECT name FROM symbols WHERE id = ( SELECT symbol_id FROM call_paths WHERE id = call_path_id ) ), ( SELECT short_name FROM dsos WHERE id = ( SELECT dso_id FROM symbols WHERE id = ( SELECT symbol_id FROM call_paths WHERE id = call_path_id ) ) ), ( SELECT ip FROM call_paths where id = call_path_id ) FROM calls WHERE parent_call_path_id = s AND comm_id = s AND thread_id = s ORDER BY call_path_idsQuery failed: iRiiiiii(RRRRRR R
RRRRRRRR4RR	R0R
RR/(RRRtlast_call_path_idR1R2R3Rttotal_branch_countRt
total_timeR((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pytselectCalls�sX	2

#

 

		#		cCs|js|j�n|jS(N(RR8R(R((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyt
childCount�s	
cCsdS(Ni((R((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pytcolumnCount�scCs#dddddddg}||S(Ns	Call PathtObjectsCount s
Time (ns) s	Time (%) s
Branch Count sBranch Count (%) ((Rtcolumntheaders((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pytcolumnHeader�scCs|j|S(N(R
(RR<((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pytgetData�s(t__name__t
__module__RRRR!R&R'R(R/R0R4R8R9R:R>R?(((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyR?s											3			t	TreeModelcBsJeZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(cCs8tt|�j|�||_t|dd�|_dS(Ni(tsuperRBRRRtNonetroot(RRtparent((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyR�s	cCs
|jj�S(N(RER:(RRF((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyR:�scCs.|j�r|j�}n	|j}|j�S(N(tisValidtinternalPointerRER9(RRFR((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pytrowCount�s	cCs[|tjkr%|dkr%tjSn|tjkr8dS|tjkrKdS|jj|�S(Ni(tQttTextAlignmentRolet
AlignRighttDisplayRoleRDt
HorizontalRER>(Rtsectiontorientationtrole((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyt
headerData�s
cCsG|j�}||jkr"t�S|j�}|j|j�d|�S(Ni(RHREtQModelIndexR'tcreateIndexR((RtchildRR((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyRF�s
cCsF|j�r|j�}n	|j}|j|�}|j|||�S(N(RGRHRER&RT(RRR<RFRR((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pytindexs
	cCs]|tjkr+|j�dkr+tjSn|tjkr>dS|j�}|j|j��S(Ni(RJRKR<RLRMRDRHR?(RRVRQt
index_item((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyR
s
N(
R@RARDRR:RIRRRFRVR
(((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyRB�s			
		t
MainWindowcBseZdd�ZRS(cCs�tt|�j|�|jd�|jd|�|jdd�|jdd�|j�}|jt	j
�}|j|�t|�|_
t�|_|jj|j
�|j|j�dS(NRXsCall Graph: idi iX(RCRXRt
setObjectNametsetWindowTitletmovetresizetstyletstandardIcontQStyletSP_MessageBoxInformationt
setWindowIconRBtmodelt	QTreeViewtviewtsetModeltsetCentralWidget(RRtdbnameRFR]ticon((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyRs

N(R@RARDR(((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyRXst__main__is0Usage is: call-graph-from-sql.py <database name>sToo few argumentsiisSQLite format 3tQSQLITEtQPSQLt=ithostnametporttusernametpasswordRgsFailed to open database s error: ((,tsyst
PySide.QtCoretPySide.QtGuitPySide.QtSqltdecimalRtQAbstractItemModelRBtQMainWindowRXR@tlentargvtstderrRRgRt
is_sqlite3topentftreadRtclosetQSqlDatabasetaddDatabaseRtsplittoptstopttsetHostNametsetPorttinttsetUserNametsetPasswordtsetDatabaseNameRRtQApplicationtapptwindowtshowRterrtexit(((s</usr/libexec/perf-core/scripts/python/call-graph-from-sql.pyt<module>9s^



�3

	


'



404 Not Found
[ LogOut ]