403 Forbidden


Disable Functions:
Path : /usr/libexec/perf-core/scripts/python/
File Upload :
Command :
Current File : //usr/libexec/perf-core/scripts/python/export-to-sqlite.pyo

�
G��dc@s�ddlZddlZddlZddlZddlTejjejdd�eZ	e
Ze
Zd�Z
eej�dkr�e
�nejdZeej�dkr�ejdZnd	ZedQkr�e
�ned
kZx_edeej��D]EZejedkr$eZqejedkr@eZqe
�qWd
�Zd�Zejj�GdGHe
Zy ee�Zej�eZWnnXer�eed��nejd�Zej e�ej�e!e�Z"ee"d�ee"d�ee"d�ee"d�ee"d�ee"d�ee"d�ee"d�ee"d�ee"d�er�ee"d�n
ee"d�es�er�ee"d�ner�ee"d�ne
Z#yee"d �eZ#WnnXd!�Z$ee"d"�ee"d#�ee"d$�ee"d%�ee"d&�es>erjee"d'e$d(�d)e$d*�d+�ner�ee"d,e$d-�d.�nee"d/e$d-�d0e$d1�d2�ee"d3�e!e�Z%e%j&d4�e!e�Z'e'j&d5�e!e�Z(e(j&d6�e!e�Z)e)j&d7�e!e�Z*e*j&d8�e!e�Z+e+j&d9�e!e�Z,e,j&d:�e!e�Z-e-j&d;�e!e�Z.er�e.j&d<�n
e.j&d=�es�er�e!e�Z/e/j&d>�nere!e�Z0e0j&d?�nd@�Z1dAa2dB�Z3dC�Z4dD�Z5dE�Z6dF�Z7dG�Z8dH�Z9dI�Z:dJ�Z;dK�Z<dL�Z=dM�Z>dN�Z?dO�Z@dP�ZAdS(Ri����N(t*tPERF_EXEC_PATHs./scripts/python/Perf-Trace-Util/lib/Perf/TracecCsDtjdIJtjdIJtjdIJtjdIJtd��dS(NsRUsage is: export-to-sqlite.py <database name> [<columns>] [<calls>] [<callchains>]s#where:	columns		'all' or 'branches's5		calls		'calls' => create calls and call_paths tables4		callchains	'callchains' => create call_paths tablesToo few arguments(tsyststderrt	Exception(((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pytusage?s




iiitalltbranchestcallst
callchainscCs3|j|�rdStd|j�j���dS(NsQuery failed: (texec_Rt	lastErrorttext(tqts((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pytdo_query]scCs0|j�rdStd|j�j���dS(NsQuery failed: (R
RRR(R
((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pyt	do_query_bssCreating database...s already existstQSQLITEsPRAGMA journal_mode = OFFsBEGIN TRANSACTIONsRCREATE TABLE selected_events (id		integer		NOT NULL	PRIMARY KEY,name		varchar(80))s^CREATE TABLE machines (id		integer		NOT NULL	PRIMARY KEY,pid		integer,root_dir 	varchar(4096))svCREATE TABLE threads (id		integer		NOT NULL	PRIMARY KEY,machine_id	bigint,process_id	bigint,pid		integer,tid		integer)sHCREATE TABLE comms (id		integer		NOT NULL	PRIMARY KEY,comm		varchar(16))s]CREATE TABLE comm_threads (id		integer		NOT NULL	PRIMARY KEY,comm_id	bigint,thread_id	bigint)s�CREATE TABLE dsos (id		integer		NOT NULL	PRIMARY KEY,machine_id	bigint,short_name	varchar(256),long_name	varchar(4096),build_id	varchar(64))s�CREATE TABLE symbols (id		integer		NOT NULL	PRIMARY KEY,dso_id		bigint,sym_start	bigint,sym_end	bigint,binding	integer,name		varchar(2048))sOCREATE TABLE branch_types (id		integer		NOT NULL	PRIMARY KEY,name		varchar(80))sPCREATE TABLE samples (id		integer		NOT NULL	PRIMARY KEY,evsel_id	bigint,machine_id	bigint,thread_id	bigint,comm_id	bigint,dso_id		bigint,symbol_id	bigint,sym_offset	bigint,ip		bigint,time		bigint,cpu		integer,to_dso_id	bigint,to_symbol_id	bigint,to_sym_offset	bigint,to_ip		bigint,branch_type	integer,in_tx		boolean,call_path_id	bigint)s�CREATE TABLE samples (id		integer		NOT NULL	PRIMARY KEY,evsel_id	bigint,machine_id	bigint,thread_id	bigint,comm_id	bigint,dso_id		bigint,symbol_id	bigint,sym_offset	bigint,ip		bigint,time		bigint,cpu		integer,to_dso_id	bigint,to_symbol_id	bigint,to_sym_offset	bigint,to_ip		bigint,period		bigint,weight		bigint,transaction_	bigint,data_src	bigint,branch_type	integer,in_tx		boolean,call_path_id	bigint)shCREATE TABLE call_paths (id		integer		NOT NULL	PRIMARY KEY,parent_id	bigint,symbol_id	bigint,ip		bigint)s�CREATE TABLE calls (id		integer		NOT NULL	PRIMARY KEY,thread_id	bigint,comm_id	bigint,call_path_id	bigint,call_time	bigint,return_time	bigint,branch_count	bigint,call_id	bigint,return_id	bigint,parent_call_path_id	bigint,flags		integer)sSELECT printf("") FROM machinescCstrd|dS|SdS(Ns
printf("%x", t)(tsqlite_has_printf(tx((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pytemit_to_hex�ss�CREATE VIEW machines_view AS SELECT id,pid,root_dir,CASE WHEN id=0 THEN 'unknown' WHEN pid=-1 THEN 'host' ELSE 'guest' END AS host_or_guest FROM machiness�CREATE VIEW dsos_view AS SELECT id,machine_id,(SELECT host_or_guest FROM machines_view WHERE id = machine_id) AS host_or_guest,short_name,long_name,build_id FROM dsoss�CREATE VIEW symbols_view AS SELECT id,name,(SELECT short_name FROM dsos WHERE id=dso_id) AS dso,dso_id,sym_start,sym_end,CASE WHEN binding=0 THEN 'local' WHEN binding=1 THEN 'global' ELSE 'weak' END AS binding FROM symbolss�CREATE VIEW threads_view AS SELECT id,machine_id,(SELECT host_or_guest FROM machines_view WHERE id = machine_id) AS host_or_guest,process_id,pid,tid FROM threadss�CREATE VIEW comm_threads_view AS SELECT comm_id,(SELECT comm FROM comms WHERE id = comm_id) AS command,thread_id,(SELECT pid FROM threads WHERE id = thread_id) AS pid,(SELECT tid FROM threads WHERE id = thread_id) AS tid FROM comm_threadss+CREATE VIEW call_paths_view AS SELECT c.id,sc.ips� AS ip,c.symbol_id,(SELECT name FROM symbols WHERE id = c.symbol_id) AS symbol,(SELECT dso_id FROM symbols WHERE id = c.symbol_id) AS dso_id,(SELECT dso FROM symbols_view  WHERE id = c.symbol_id) AS dso_short_name,c.parent_id,sp.ipsE AS parent_ip,p.symbol_id AS parent_symbol_id,(SELECT name FROM symbols WHERE id = p.symbol_id) AS parent_symbol,(SELECT dso_id FROM symbols WHERE id = p.symbol_id) AS parent_dso_id,(SELECT dso FROM symbols_view  WHERE id = p.symbol_id) AS parent_dso_short_name FROM call_paths c INNER JOIN call_paths p ON p.id = c.parent_ids�CREATE VIEW calls_view AS SELECT calls.id,thread_id,(SELECT pid FROM threads WHERE id = thread_id) AS pid,(SELECT tid FROM threads WHERE id = thread_id) AS tid,(SELECT comm FROM comms WHERE id = comm_id) AS command,call_path_id,tipss AS ip,symbol_id,(SELECT name FROM symbols WHERE id = symbol_id) AS symbol,call_time,return_time,return_time - call_time AS elapsed_time,branch_count,call_id,return_id,CASE WHEN flags=1 THEN 'no call' WHEN flags=2 THEN 'no return' WHEN flags=3 THEN 'no call/return' ELSE '' END AS flags,parent_call_path_id FROM calls INNER JOIN call_paths ON call_paths.id = call_path_idsCREATE VIEW samples_view AS SELECT id,time,cpu,(SELECT pid FROM threads WHERE id = thread_id) AS pid,(SELECT tid FROM threads WHERE id = thread_id) AS tid,(SELECT comm FROM comms WHERE id = comm_id) AS command,(SELECT name FROM selected_events WHERE id = evsel_id) AS event,s� AS ip_hex,(SELECT name FROM symbols WHERE id = symbol_id) AS symbol,sym_offset,(SELECT short_name FROM dsos WHERE id = dso_id) AS dso_short_name,tto_ips AS to_ip_hex,(SELECT name FROM symbols WHERE id = to_symbol_id) AS to_symbol,to_sym_offset,(SELECT short_name FROM dsos WHERE id = to_dso_id) AS to_dso_short_name,(SELECT name FROM branch_types WHERE id = branch_type) AS branch_type_name,in_tx FROM samplessEND TRANSACTIONs)INSERT INTO selected_events VALUES (?, ?)s%INSERT INTO machines VALUES (?, ?, ?)s*INSERT INTO threads VALUES (?, ?, ?, ?, ?)sINSERT INTO comms VALUES (?, ?)s)INSERT INTO comm_threads VALUES (?, ?, ?)s'INSERT INTO dsos VALUES (?, ?, ?, ?, ?)s-INSERT INTO symbols VALUES (?, ?, ?, ?, ?, ?)s&INSERT INTO branch_types VALUES (?, ?)sQINSERT INTO samples VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)s]INSERT INTO samples VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)s*INSERT INTO call_paths VALUES (?, ?, ?, ?)s:INSERT INTO calls VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)cCs�tjj�GdGHttd�tdd�tddd�tddddd�tdd�tddddd�t	dddddd�t
dddddddddddddddddddddd�ts�tr�t
dddd�ndS(NsWriting records...sBEGIN TRANSACTIONitunknowni����t(tdatetimettodayRtquerytevsel_tablet
machine_tabletthread_tablet
comm_tablet	dso_tabletsymbol_tabletsample_tabletperf_db_export_callstperf_db_export_callchainstcall_path_table(((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pyttrace_beginzs


IicCsnttd�tjj�GdGHtr5ttd�ntrXtjj�GdGtGdGHntjj�GdGHdS(NsEND TRANSACTIONsAdding indexess5CREATE INDEX pcpid_idx ON calls (parent_call_path_id)s	Warning: s unhandled eventstDone(RRRRR$tunhandled_count(((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pyt	trace_end�s
cCstd7adS(Ni(R)(t
event_nametcontexttevent_fields_dict((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pyttrace_unhandled�scGsdS(N((R((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pytsched__sched_switch�scCs9x(|d|!D]}|jt|��qWt|�dS(Ni(taddBindValuetstrR(R
tnRtxx((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pyt	bind_exec�scGsttd|�dS(Ni(R4tevsel_query(R((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pyR�scGsttd|�dS(Ni(R4t
machine_query(R((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pyR�scGsttd|�dS(Ni(R4tthread_query(R((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pyR�scGsttd|�dS(Ni(R4t
comm_query(R((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pyR �scGsttd|�dS(Ni(R4tcomm_thread_query(R((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pytcomm_thread_table�scGsttd|�dS(Ni(R4t	dso_query(R((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pyR!�scGsttd|�dS(Ni(R4tsymbol_query(R((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pyR"�scGsttd|�dS(Ni(R4tbranch_type_query(R((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pytbranch_type_table�scGs}trix(|dd!D]}tjt|��qWx(|dd!D]}tjt|��q?Wtt�nttd|�dS(Niiii(Rtsample_queryR0R1RR4(RR3((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pyR#�s
cGsttd|�dS(Ni(R4tcall_path_query(R((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pyR&�scGsttd|�dS(Ni(R4t
call_query(R((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pytcall_return_table�s(sallsbranches(BtosRtstructRtPySide.QtSqltpathtappendtenvirontTruetperf_db_export_modetFalseR$R%RtlentargvtdbnametcolumnsRtrangetiRRRt	db_existstopentftcloseRtQSqlDatabasetaddDatabasetdbtsetDatabaseNamet	QSqlQueryRRRR5tprepareR6R7R8R9R;R<R=R?R@RAR'R)R*R.R/R4RRRR R:R!R"R>R#R&RB(((s9/usr/libexec/perf-core/scripts/python/export-to-sqlite.pyt<module>
s�"
	


				
















	




		&

#









														
	

404 Not Found
[ LogOut ]