403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/src/kernels/2.6.31.5-127.fc12.i686.PAE/scripts/tracing/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/src/kernels/2.6.31.5-127.fc12.i686.PAE/scripts/tracing/draw_functrace.pyc
Ñò
§(¨Jc@s‹dZddkZddkZddd„ƒYZdefd„ƒYZdefd„ƒYZd	„Zd
„Ze	djoeƒndS(
sH
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2

This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call stack by drawing textual but hierarchical tree of
calls. Only the functions's names and the the call time are provided.

Usage:
	Be sure that you have CONFIG_FUNCTION_TRACER
	# mount -t debugfs nodev /sys/kernel/debug
	# echo function > /sys/kernel/debug/tracing/current_tracer
	$ cat /sys/kernel/debug/tracing/trace_pipe > ~/raw_trace_func
	Wait some times but not too much, the script is a bit slow.
	Break the pipe (Ctrl + Z)
	$ scripts/draw_functrace.py < raw_trace_func > draw_functrace
	Then you have your drawn trace in draw_functrace
iÿÿÿÿNtCallTreecBsGeZdZdZddd„Zd„Zd„Zd„Zd„Z	RS(sÕ This class provides a tree representation of the functions
		call stack. If a function has no parent in the kernel (interrupt,
		syscall, kernel thread...) then it is attached to a virtual parent
		called ROOT.
	cCsE||_||_|djoti|_n
||_g|_dS(N(t_funct_timetNoneRtROOTt_parentt	_children(tselftfuncttimetparent((sM/usr/src/kernels/2.6.31.5-127.fc12.i686.PAE/scripts/tracing/draw_functrace.pyt__init__#s		
	cCs&t|||ƒ}|ii|ƒ|S(s¦ If a function calls another one, call this method to insert it
			into the tree at the appropriate place.
			@return: A reference to the newly created child node.
		(RRtappend(RRtcalltimetchild((sM/usr/src/kernels/2.6.31.5-127.fc12.i686.PAE/scripts/tracing/draw_functrace.pytcalls,scCse|}x.|tijo|i|jo
|i}q	W|tijotii|dƒ}|S|S(sÇ Retrieve the last parent of the current node that
			has the name given by func. If this function is not
			on a parent, then create it as new child of root
			@return: A reference to the parent.
		N(RRRRRR(RRttreeR((sM/usr/src/kernels/2.6.31.5-127.fc12.i686.PAE/scripts/tracing/draw_functrace.pyt	getParent5s cCs|idtƒS(Nt(t_CallTree__toStringtTrue(R((sM/usr/src/kernels/2.6.31.5-127.fc12.i686.PAE/scripts/tracing/draw_functrace.pyt__repr__CscCsó|idj	od||i|if}nd||if}d}|o|d d}nx|t|iƒjov|t|iƒdjo)|d|i|i|dtƒ7}n&|d|i|i|dtƒ7}|d7}qbW|S(	Ns%s----%s (%s)
s	%s----%s
iiÿÿÿÿt is%ss    |(RRRtlenRRtFalseR(Rtbrancht	lastChildtsti((sM/usr/src/kernels/2.6.31.5-127.fc12.i686.PAE/scripts/tracing/draw_functrace.pyt
__toStringFsN(
t__name__t
__module__t__doc__RRRRRRR(((sM/usr/src/kernels/2.6.31.5-127.fc12.i686.PAE/scripts/tracing/draw_functrace.pyRs					tBrokenLineExceptioncBseZdZRS(syIf the last line is not complete because of the pipe breakage,
	   we want to stop the processing and ignore this line.
	(RRR (((sM/usr/src/kernels/2.6.31.5-127.fc12.i686.PAE/scripts/tracing/draw_functrace.pyR!YstCommentLineExceptioncBseZdZRS(sY If the line is a comment (as in the beginning of the trace file),
	    just ignore it.
	(RRR (((sM/usr/src/kernels/2.6.31.5-127.fc12.i686.PAE/scripts/tracing/draw_functrace.pyR"_scCsw|iƒ}|idƒo
t‚ntid|ƒ}|djo
t‚n|idƒ|idƒ|idƒfS(Nt#s"[^]]+?\] +([0-9.]+): (\w+) <-(\w+)iii(tstript
startswithR"tretmatchRR!tgroup(tlinetm((sM/usr/src/kernels/2.6.31.5-127.fc12.i686.PAE/scripts/tracing/draw_functrace.pyt	parseLinefs


cCs¤tdddƒt_ti}xwtiD]l}yt|ƒ\}}}Wn)tj
oPntj
o
q(nX|i|ƒ}|i	||ƒ}q(WtiGHdS(NsRoot (Nowhere)(
RRRtsyststdinR+R!R"RR(RR)R
tcalleetcaller((sM/usr/src/kernels/2.6.31.5-127.fc12.i686.PAE/scripts/tracing/draw_functrace.pytmainps	
t__main__((
R R,R&Rt	ExceptionR!R"R+R0R(((sM/usr/src/kernels/2.6.31.5-127.fc12.i686.PAE/scripts/tracing/draw_functrace.pyt<module>s>	
	


Youez - 2016 - github.com/yon3zu
LinuXploit