/usr/lib64/python2.6
NameSizeModeActions
bsddb/-0755rm
compiler/-0755rm
config/-0755rm
ctypes/-0755rm
curses/-0755rm
Demo/-0755rm
distutils/-0755rm
Doc/-0755rm
email/-0755rm
encodings/-0755rm
hotshot/-0755rm
idlelib/-0755rm
json/-0755rm
lib-dynload/-0755rm
lib-tk/-0755rm
lib2to3/-0755rm
logging/-0755rm
multiprocessing/-0755rm
plat-linux2/-0755rm
site-packages/-0755rm
sqlite3/-0755rm
test/-0755rm
Tools/-0755rm
wsgiref/-0755rm
xml/-0755rm
abc.py70340644editdlrm
abc.pyc60710644editdlrm
abc.pyo60130644editdlrm
aifc.py331880644editdlrm
aifc.pyc295640644editdlrm
aifc.pyo295640644editdlrm
anydbm.py26200644editdlrm
anydbm.pyc27750644editdlrm
anydbm.pyo27750644editdlrm
ast.py113470644editdlrm
ast.pyc127800644editdlrm
ast.pyo127800644editdlrm
asynchat.py114020644editdlrm
asynchat.pyc87370644editdlrm
asynchat.pyo87370644editdlrm
asyncore.py200610644editdlrm
asyncore.pyc184520644editdlrm
asyncore.pyo184520644editdlrm
atexit.py17050644editdlrm
atexit.pyc22150644editdlrm
atexit.pyo22150644editdlrm
audiodev.py75970644editdlrm
audiodev.pyc85370644editdlrm
audiodev.pyo85370644editdlrm
base64.py113350755editdlrm
base64.pyc110030644editdlrm
base64.pyo110030644editdlrm
BaseHTTPServer.py219740644editdlrm
BaseHTTPServer.pyc215750644editdlrm
BaseHTTPServer.pyo215750644editdlrm
Bastion.py57440644editdlrm
Bastion.pyc66670644editdlrm
Bastion.pyo66670644editdlrm
bdb.py205970644editdlrm
bdb.pyc185670644editdlrm
bdb.pyo185670644editdlrm
binhex.py148780644editdlrm
binhex.pyc158750644editdlrm
binhex.pyo158750644editdlrm
bisect.py26620644editdlrm
bisect.pyc31730644editdlrm
bisect.pyo31730644editdlrm
calendar.py231100644editdlrm
calendar.pyc281650644editdlrm
calendar.pyo281650644editdlrm
cgi.py344780755editdlrm
cgi.pyc328180644editdlrm
cgi.pyo328180644editdlrm
CGIHTTPServer.py127730644editdlrm
CGIHTTPServer.pyc108200644editdlrm
CGIHTTPServer.pyo108200644editdlrm
cgitb.py121550644editdlrm
cgitb.pyc124610644editdlrm
cgitb.pyo124610644editdlrm
chunk.py53720644editdlrm
chunk.pyc56450644editdlrm
chunk.pyo56450644editdlrm
cmd.py149620644editdlrm
cmd.pyc139540644editdlrm
cmd.pyo139540644editdlrm
code.py102170644editdlrm
code.pyc104270644editdlrm
code.pyo104270644editdlrm
codecs.py352660644editdlrm
codecs.pyc367210644editdlrm
codecs.pyo367210644editdlrm
codeop.py59990644editdlrm
codeop.pyc66360644editdlrm
codeop.pyo66360644editdlrm
collections.py137300644editdlrm
collections.pyc144620644editdlrm
collections.pyo144090644editdlrm
colorsys.py34590644editdlrm
colorsys.pyc40410644editdlrm
colorsys.pyo40410644editdlrm
commands.py25430644editdlrm
commands.pyc24890644editdlrm
commands.pyo24890644editdlrm
compileall.py52850644editdlrm
compileall.pyc49970644editdlrm
compileall.pyo49970644editdlrm
ConfigParser.py259890644editdlrm
ConfigParser.pyc238650644editdlrm
ConfigParser.pyo238650644editdlrm
contextlib.py41360644editdlrm
contextlib.pyc41510644editdlrm
contextlib.pyo41510644editdlrm
Cookie.py250540644editdlrm
Cookie.pyc221450644editdlrm
Cookie.pyo221450644editdlrm
cookielib.py647260644editdlrm
cookielib.pyc553700644editdlrm
cookielib.pyo551790644editdlrm
copy.py111770644editdlrm
copy.pyc116750644editdlrm
copy.pyo115790644editdlrm
copy_reg.py68000644editdlrm
copy_reg.pyc51780644editdlrm
copy_reg.pyo51320644editdlrm
cProfile.py63370755editdlrm
cProfile.pyc62390644editdlrm
cProfile.pyo62390644editdlrm
crypt.py22290644editdlrm
crypt.pyc30550644editdlrm
crypt.pyo30550644editdlrm
csv.py157300644editdlrm
csv.pyc132260644editdlrm
csv.pyo132260644editdlrm
dbhash.py5350644editdlrm
dbhash.pyc7600644editdlrm
dbhash.pyo7600644editdlrm
decimal.py1992730644editdlrm
decimal.pyc1556810644editdlrm
decimal.pyo1556150644editdlrm
difflib.py810800644editdlrm
difflib.pyc611930644editdlrm
difflib.pyo611390644editdlrm
dircache.py11260644editdlrm
dircache.pyc15840644editdlrm
dircache.pyo15840644editdlrm
dis.py64490644editdlrm
dis.pyc63660644editdlrm
dis.pyo63660644editdlrm
doctest.py1015160644editdlrm
doctest.pyc809940644editdlrm
doctest.pyo807060644editdlrm
DocXMLRPCServer.py105990644editdlrm
DocXMLRPCServer.pyc99570644editdlrm
DocXMLRPCServer.pyo98490644editdlrm
dumbdbm.py88200644editdlrm
dumbdbm.pyc65850644editdlrm
dumbdbm.pyo65850644editdlrm
dummy_thread.py44180644editdlrm
dummy_thread.pyc54130644editdlrm
dummy_thread.pyo54130644editdlrm
dummy_threading.py28040644editdlrm
dummy_threading.pyc12970644editdlrm
dummy_threading.pyo12970644editdlrm
filecmp.py94700644editdlrm
filecmp.pyc96320644editdlrm
filecmp.pyo96320644editdlrm
fileinput.py141430644editdlrm
fileinput.pyc149280644editdlrm
fileinput.pyo149280644editdlrm
fnmatch.py32390644editdlrm
fnmatch.pyc35790644editdlrm
fnmatch.pyo35790644editdlrm
formatter.py149110644editdlrm
formatter.pyc193030644editdlrm
formatter.pyo193030644editdlrm
fpformat.py46990644editdlrm
fpformat.pyc47350644editdlrm
fpformat.pyo47350644editdlrm
fractions.py200730644editdlrm
fractions.pyc181190644editdlrm
fractions.pyo181190644editdlrm
ftplib.py291970644editdlrm
ftplib.pyc285030644editdlrm
ftplib.pyo285030644editdlrm
functools.py21620644editdlrm
functools.pyc19270644editdlrm
functools.pyo19270644editdlrm
genericpath.py30200644editdlrm
genericpath.pyc32920644editdlrm
genericpath.pyo32920644editdlrm
getopt.py73280644editdlrm
getopt.pyc67300644editdlrm
getopt.pyo66830644editdlrm
getpass.py55340644editdlrm
getpass.pyc47540644editdlrm
getpass.pyo47540644editdlrm
gettext.py199680644editdlrm
gettext.pyc157600644editdlrm
gettext.pyo157600644editdlrm
glob.py22490644editdlrm
glob.pyc24090644editdlrm
glob.pyo24090644editdlrm
gzip.py167540644editdlrm
gzip.pyc143860644editdlrm
gzip.pyo143860644editdlrm
hashlib.py44270644editdlrm
hashlib.pyc39810644editdlrm
hashlib.pyo39810644editdlrm
heapq.py159950644editdlrm
heapq.pyc126940644editdlrm
heapq.pyo126940644editdlrm
hmac.py45310644editdlrm
hmac.pyc45090644editdlrm
hmac.pyo45090644editdlrm
htmlentitydefs.py180540644editdlrm
htmlentitydefs.pyc63710644editdlrm
htmlentitydefs.pyo63710644editdlrm
htmllib.py128690644editdlrm
htmllib.pyc203840644editdlrm
htmllib.pyo203840644editdlrm
HTMLParser.py135760644editdlrm
HTMLParser.pyc122580644editdlrm
HTMLParser.pyo119500644editdlrm
httplib.py487970644editdlrm
httplib.pyc377320644editdlrm
httplib.pyo375360644editdlrm
ihooks.py174520644editdlrm
ihooks.pyc208370644editdlrm
ihooks.pyo207580644editdlrm
imaplib.py477710644editdlrm
imaplib.pyc452250644editdlrm
imaplib.pyo424750644editdlrm
imghdr.py35440644editdlrm
imghdr.pyc49050644editdlrm
imghdr.pyo49050644editdlrm
imputil.py260090644editdlrm
imputil.pyc160370644editdlrm
imputil.pyo158650644editdlrm
inspect.py381890644editdlrm
inspect.pyc371650644editdlrm
inspect.pyo371650644editdlrm
io.py661650644editdlrm
io.pyc630420644editdlrm
io.pyo630420644editdlrm
keyword.py19970755editdlrm
keyword.pyc21170644editdlrm
keyword.pyo21170644editdlrm
linecache.py41280644editdlrm
linecache.pyc32680644editdlrm
linecache.pyo32680644editdlrm
locale.py826740644editdlrm
locale.pyc466760644editdlrm
locale.pyo466760644editdlrm
macpath.py62530644editdlrm
macpath.pyc77070644editdlrm
macpath.pyo77070644editdlrm
macurl2path.py32750644editdlrm
macurl2path.pyc28250644editdlrm
macurl2path.pyo28250644editdlrm
mailbox.py758240644editdlrm
mailbox.pyc760690644editdlrm
mailbox.pyo760200644editdlrm
mailcap.py84020644editdlrm
mailcap.pyc80790644editdlrm
mailcap.pyo80790644editdlrm
markupbase.py143500644editdlrm
markupbase.pyc94640644editdlrm
markupbase.pyo92700644editdlrm
md5.py4100644editdlrm
md5.pyc3780644editdlrm
md5.pyo3780644editdlrm
mhlib.py334340644editdlrm
mhlib.pyc341370644editdlrm
mhlib.pyo341370644editdlrm
mimetools.py71680644editdlrm
mimetools.pyc83200644editdlrm
mimetools.pyo83200644editdlrm
mimetypes.py188220644editdlrm
mimetypes.pyc168720644editdlrm
mimetypes.pyo168720644editdlrm
MimeWriter.py64820644editdlrm
MimeWriter.pyc73830644editdlrm
MimeWriter.pyo73830644editdlrm
mimify.py150240755editdlrm
mimify.pyc122190644editdlrm
mimify.pyo122190644editdlrm
modulefinder.py242830644editdlrm
modulefinder.pyc190070644editdlrm
modulefinder.pyo189190644editdlrm
multifile.py48200644editdlrm
multifile.pyc54790644editdlrm
multifile.pyo54350644editdlrm
mutex.py18660644editdlrm
mutex.pyc25260644editdlrm
mutex.pyo25260644editdlrm
netrc.py41110644editdlrm
netrc.pyc36020644editdlrm
netrc.pyo36020644editdlrm
new.py7060644editdlrm
new.pyc9100644editdlrm
new.pyo9100644editdlrm
nntplib.py214700644editdlrm
nntplib.pyc211790644editdlrm
nntplib.pyo211790644editdlrm
ntpath.py177520644editdlrm
ntpath.pyc116200644editdlrm
ntpath.pyo115730644editdlrm
nturl2path.py22390644editdlrm
nturl2path.pyc17770644editdlrm
nturl2path.pyo17770644editdlrm
numbers.py102710644editdlrm
numbers.pyc139640644editdlrm
numbers.pyo139640644editdlrm
opcode.py52480644editdlrm
opcode.pyc59170644editdlrm
opcode.pyo59170644editdlrm
optparse.py608490644editdlrm
optparse.pyc542390644editdlrm
optparse.pyo541570644editdlrm
ordereddict.py360644editdlrm
ordereddict.pyc1850644editdlrm
ordereddict.pyo1850644editdlrm
os.py258020644editdlrm
os.pyc258080644editdlrm
os.pyo258080644editdlrm
os2emxpath.py46030644editdlrm
os2emxpath.pyc45360644editdlrm
os2emxpath.pyo45360644editdlrm
pdb.doc78990644editdlrm
pdb.py453330755editdlrm
pdb.pyc438130644editdlrm
pdb.pyo438130644editdlrm
pickle.py448110644editdlrm
pickle.pyc386450644editdlrm
pickle.pyo384400644editdlrm
pickletools.py743480644editdlrm
pickletools.pyc571430644editdlrm
pickletools.pyo562460644editdlrm
pipes.py96470644editdlrm
pipes.pyc94600644editdlrm
pipes.pyo94600644editdlrm
pkgutil.py200010644editdlrm
pkgutil.pyc190200644editdlrm
pkgutil.pyo190200644editdlrm
platform.py526300755editdlrm
platform.pyc387970644editdlrm
platform.pyo387970644editdlrm
plistlib.py158060644editdlrm
plistlib.pyc200500644editdlrm
plistlib.pyo199600644editdlrm
popen2.py84160644editdlrm
popen2.pyc90640644editdlrm
popen2.pyo90200644editdlrm
poplib.py128250644editdlrm
poplib.pyc134180644editdlrm
poplib.pyo134180644editdlrm
posixfile.py80030644editdlrm
posixfile.pyc77240644editdlrm
posixfile.pyo77240644editdlrm
posixpath.py131190644editdlrm
posixpath.pyc111880644editdlrm
posixpath.pyo111880644editdlrm
pprint.py119320644editdlrm
pprint.pyc103940644editdlrm
pprint.pyo102190644editdlrm
profile.py235100755editdlrm
profile.pyc166800644editdlrm
profile.pyo164350644editdlrm
pstats.py273100644editdlrm
pstats.pyc253400644editdlrm
pstats.pyo253400644editdlrm
pty.py48690644editdlrm
pty.pyc49190644editdlrm
pty.pyo49190644editdlrm
pyclbr.py132820644editdlrm
pyclbr.pyc97320644editdlrm
pyclbr.pyo97320644editdlrm
pydoc.py924320755editdlrm
pydoc.pyc910520644editdlrm
pydoc.pyo909840644editdlrm
pydoc_topics.py4231260644editdlrm
pydoc_topics.pyc4075880644editdlrm
pydoc_topics.pyo4075880644editdlrm
py_compile.py56330644editdlrm
py_compile.pyc65540644editdlrm
py_compile.pyo65540644editdlrm
Queue.py85740644editdlrm
Queue.pyc94470644editdlrm
Queue.pyo94470644editdlrm
quopri.py69720755editdlrm
quopri.pyc66880644editdlrm
quopri.pyo66880644editdlrm
random.py319660644editdlrm
random.pyc251060644editdlrm
random.pyo251060644editdlrm
re.py129660644editdlrm
re.pyc131640644editdlrm
re.pyo131640644editdlrm
repr.py42960644editdlrm
repr.pyc54340644editdlrm
repr.pyo54340644editdlrm
rexec.py201520644editdlrm
rexec.pyc242200644editdlrm
rexec.pyo242200644editdlrm
rfc822.py332950644editdlrm
rfc822.pyc321100644editdlrm
rfc822.pyo321100644editdlrm
rlcompleter.py58660644editdlrm
rlcompleter.pyc60730644editdlrm
rlcompleter.pyo60730644editdlrm
robotparser.py70140644editdlrm
robotparser.pyc78520644editdlrm
robotparser.pyo78520644editdlrm
runpy.py54130644editdlrm
runpy.pyc39790644editdlrm
runpy.pyo39790644editdlrm
sched.py50910644editdlrm
sched.pyc50050644editdlrm
sched.pyo50050644editdlrm
sets.py190500644editdlrm
sets.pyc169970644editdlrm
sets.pyo169970644editdlrm
sgmllib.py178840644editdlrm
sgmllib.pyc155980644editdlrm
sgmllib.pyo155980644editdlrm
sha.py4450644editdlrm
sha.pyc4210644editdlrm
sha.pyo4210644editdlrm
shelve.py80780644editdlrm
shelve.pyc102960644editdlrm
shelve.pyo102960644editdlrm
shlex.py111370644editdlrm
shlex.pyc77100644editdlrm
shlex.pyo77100644editdlrm
shutil.py86320644editdlrm
shutil.pyc95550644editdlrm
shutil.pyo95550644editdlrm
SimpleHTTPServer.py74220644editdlrm
SimpleHTTPServer.pyc77660644editdlrm
SimpleHTTPServer.pyo77660644editdlrm
SimpleXMLRPCServer.py219920644editdlrm
SimpleXMLRPCServer.pyc196330644editdlrm
SimpleXMLRPCServer.pyo196330644editdlrm
site.py191870644editdlrm
site.pyc188250644editdlrm
site.pyo188250644editdlrm
smtpd.py189200755editdlrm
smtpd.pyc161880644editdlrm
smtpd.pyo161880644editdlrm
smtplib.py309240755editdlrm
smtplib.pyc297370644editdlrm
smtplib.pyo297370644editdlrm
sndhdr.py59730644editdlrm
sndhdr.pyc74200644editdlrm
sndhdr.pyo74200644editdlrm
socket.py201490644editdlrm
socket.pyc161290644editdlrm
socket.pyo160440644editdlrm
SocketServer.py223260644editdlrm
SocketServer.pyc231430644editdlrm
SocketServer.pyo231430644editdlrm
sre.py3840644editdlrm
sre.pyc5190644editdlrm
sre.pyo5190644editdlrm
sre_compile.py165070644editdlrm
sre_compile.pyc114830644editdlrm
sre_compile.pyo113700644editdlrm
sre_constants.py71370644editdlrm
sre_constants.pyc60930644editdlrm
sre_constants.pyo60930644editdlrm
sre_parse.py268780644editdlrm
sre_parse.pyc196960644editdlrm
sre_parse.pyo196960644editdlrm
ssl.py166770644editdlrm
ssl.pyc142760644editdlrm
ssl.pyo142760644editdlrm
stat.py17180644editdlrm
stat.pyc27030644editdlrm
stat.pyo27030644editdlrm
statvfs.py8980644editdlrm
statvfs.pyc6200644editdlrm
statvfs.pyo6200644editdlrm
string.py207450644editdlrm
string.pyc200660644editdlrm
string.pyo200660644editdlrm
StringIO.py106210644editdlrm
StringIO.pyc115320644editdlrm
StringIO.pyo115320644editdlrm
stringold.py124490644editdlrm
stringold.pyc125930644editdlrm
stringold.pyo125930644editdlrm
stringprep.py135220644editdlrm
stringprep.pyc145260644editdlrm
stringprep.pyo144520644editdlrm
struct.py820644editdlrm
struct.pyc2390644editdlrm
struct.pyo2390644editdlrm
subprocess.py579450644editdlrm
subprocess.pyc410710644editdlrm
subprocess.pyo410140644editdlrm
sunau.py165370644editdlrm
sunau.pyc180720644editdlrm
sunau.pyo180720644editdlrm
sunaudio.py13990644editdlrm
sunaudio.pyc19970644editdlrm
sunaudio.pyo19970644editdlrm
symbol.py20500755editdlrm
symbol.pyc30250644editdlrm
symbol.pyo30250644editdlrm
symtable.py79110644editdlrm
symtable.pyc126090644editdlrm
symtable.pyo124790644editdlrm
tabnanny.py113390755editdlrm
tabnanny.pyc83330644editdlrm
tabnanny.pyo83330644editdlrm
tarfile.py877860644editdlrm
tarfile.pyc739220644editdlrm
tarfile.pyo739220644editdlrm
telnetlib.py218080644editdlrm
telnetlib.pyc199130644editdlrm
telnetlib.pyo199130644editdlrm
tempfile.py177740644editdlrm
tempfile.pyc195710644editdlrm
tempfile.pyo195710644editdlrm
textwrap.py168890644editdlrm
textwrap.pyc117920644editdlrm
textwrap.pyo117000644editdlrm
this.py10020644editdlrm
this.pyc12410644editdlrm
this.pyo12410644editdlrm
threading.py318080644editdlrm
threading.pyc281520644editdlrm
threading.pyo260800644editdlrm
timeit.py120030644editdlrm
timeit.pyc118270644editdlrm
timeit.pyo118270644editdlrm
toaiff.py31420644editdlrm
toaiff.pyc31340644editdlrm
toaiff.pyo31340644editdlrm
token.py29470755editdlrm
token.pyc38400644editdlrm
token.pyo38400644editdlrm
tokenize.py163260644editdlrm
tokenize.pyc140180644editdlrm
tokenize.pyo139250644editdlrm
trace.py303250644editdlrm
trace.pyc230510644editdlrm
trace.pyo229890644editdlrm
traceback.py112110644editdlrm
traceback.pyc116770644editdlrm
traceback.pyo116770644editdlrm
tty.py8790644editdlrm
tty.pyc13170644editdlrm
tty.pyo13170644editdlrm
types.py23230644editdlrm
types.pyc26200644editdlrm
types.pyo26200644editdlrm
unittest.py311570644editdlrm
unittest.pyc348620644editdlrm
unittest.pyo348620644editdlrm
urllib.py590220644editdlrm
urllib.pyc513480644editdlrm
urllib.pyo512540644editdlrm
urllib2.py508660644editdlrm
urllib2.pyc458130644editdlrm
urllib2.pyo457190644editdlrm
urlparse.py156180644editdlrm
urlparse.pyc147770644editdlrm
urlparse.pyo147770644editdlrm
user.py16270644editdlrm
user.pyc17360644editdlrm
user.pyo17360644editdlrm
UserDict.py57780644editdlrm
UserDict.pyc88920644editdlrm
UserDict.pyo88920644editdlrm
UserList.py36440644editdlrm
UserList.pyc66030644editdlrm
UserList.pyo66030644editdlrm
UserString.py96910755editdlrm
UserString.pyc149220644editdlrm
UserString.pyo149220644editdlrm
uu.py59420755editdlrm
uu.pyc42370644editdlrm
uu.pyo42370644editdlrm
uuid.py209440644editdlrm
uuid.pyc212790644editdlrm
uuid.pyo212790644editdlrm
warnings.py141720644editdlrm
warnings.pyc130420644editdlrm
warnings.pyo122050644editdlrm
wave.py179520644editdlrm
wave.pyc194360644editdlrm
wave.pyo194360644editdlrm
weakref.py100870644editdlrm
weakref.pyc133750644editdlrm
weakref.pyo133750644editdlrm
webbrowser.py210730644editdlrm
webbrowser.pyc187550644editdlrm
webbrowser.pyo187080644editdlrm
whichdb.py33530644editdlrm
whichdb.pyc22470644editdlrm
whichdb.pyo22470644editdlrm
xdrlib.py55130644editdlrm
xdrlib.pyc91570644editdlrm
xdrlib.pyo91570644editdlrm
xmllib.py348650644editdlrm
xmllib.pyc272740644editdlrm
xmllib.pyo272740644editdlrm
xmlrpclib.py477750644editdlrm
xmlrpclib.pyc414960644editdlrm
xmlrpclib.pyo413130644editdlrm
zipfile.py530920644editdlrm
zipfile.pyc376520644editdlrm
zipfile.pyo376520644editdlrm
_abcoll.py142420644editdlrm
_abcoll.pyc215910644editdlrm
_abcoll.pyo215910644editdlrm
_LWPCookieJar.py65530644editdlrm
_LWPCookieJar.pyc56010644editdlrm
_LWPCookieJar.pyo56010644editdlrm
_MozillaCookieJar.py58090644editdlrm
_MozillaCookieJar.pyc45170644editdlrm
_MozillaCookieJar.pyo44760644editdlrm
_strptime.py197540644editdlrm
_strptime.pyc149660644editdlrm
_strptime.pyo149660644editdlrm
_threading_local.py71140644editdlrm
_threading_local.pyc63850644editdlrm
_threading_local.pyo63850644editdlrm
__future__.py43800644editdlrm
__future__.pyc42330644editdlrm
__future__.pyo42330644editdlrm
__phello__.foo.py640644editdlrm
__phello__.foo.pyc1250644editdlrm
__phello__.foo.pyo1250644editdlrm
Edit: /usr/lib64/python2.6/profile.py (23510B)
#! /usr/bin/env python2.6 # # Class for profiling python code. rev 1.0 6/2/94 # # Based on prior profile module by Sjoerd Mullender... # which was hacked somewhat by: Guido van Rossum """Class for profiling Python code.""" # Copyright 1994, by InfoSeek Corporation, all rights reserved. # Written by James Roskind # # Permission to use, copy, modify, and distribute this Python software # and its associated documentation for any purpose (subject to the # restriction in the following sentence) without fee is hereby granted, # provided that the above copyright notice appears in all copies, and # that both that copyright notice and this permission notice appear in # supporting documentation, and that the name of InfoSeek not be used in # advertising or publicity pertaining to distribution of the software # without specific, written prior permission. This permission is # explicitly restricted to the copying and modification of the software # to remain in Python, compiled Python, or other languages (such as C) # wherein the modified or derived code is exclusively imported into a # Python module. # # INFOSEEK CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS # SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND # FITNESS. IN NO EVENT SHALL INFOSEEK CORPORATION BE LIABLE FOR ANY # SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER # RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF # CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. import sys import os import time import marshal from optparse import OptionParser __all__ = ["run", "runctx", "help", "Profile"] # Sample timer for use with #i_count = 0 #def integer_timer(): # global i_count # i_count = i_count + 1 # return i_count #itimes = integer_timer # replace with C coded timer returning integers #************************************************************************** # The following are the static member functions for the profiler class # Note that an instance of Profile() is *not* needed to call them. #************************************************************************** def run(statement, filename=None, sort=-1): """Run 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. """ prof = Profile() try: prof = prof.run(statement) except SystemExit: pass if filename is not None: prof.dump_stats(filename) else: return prof.print_stats(sort) def runctx(statement, globals, locals, filename=None): """Run statement under profiler, supplying your own globals and locals, optionally saving results in filename. statement and filename have the same semantics as profile.run """ prof = Profile() try: prof = prof.runctx(statement, globals, locals) except SystemExit: pass if filename is not None: prof.dump_stats(filename) else: return prof.print_stats() # Backwards compatibility. def help(): print "Documentation for the profile module can be found " print "in the Python Library Reference, section 'The Python Profiler'." if os.name == "mac": import MacOS def _get_time_mac(timer=MacOS.GetTicks): return timer() / 60.0 if hasattr(os, "times"): def _get_time_times(timer=os.times): t = timer() return t[0] + t[1] # Using getrusage(3) is better than clock(3) if available: # on some systems (e.g. FreeBSD), getrusage has a higher resolution # Furthermore, on a POSIX system, returns microseconds, which # wrap around after 36min. _has_res = 0 try: import resource resgetrusage = lambda: resource.getrusage(resource.RUSAGE_SELF) def _get_time_resource(timer=resgetrusage): t = timer() return t[0] + t[1] _has_res = 1 except ImportError: pass class Profile: """Profiler 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. """ bias = 0 # calibration constant def __init__(self, timer=None, bias=None): self.timings = {} self.cur = None self.cmd = "" self.c_func_name = "" if bias is None: bias = self.bias self.bias = bias # Materialize in local dict for lookup speed. if not timer: if _has_res: self.timer = resgetrusage self.dispatcher = self.trace_dispatch self.get_time = _get_time_resource elif os.name == 'mac': self.timer = MacOS.GetTicks self.dispatcher = self.trace_dispatch_mac self.get_time = _get_time_mac elif hasattr(time, 'clock'): self.timer = self.get_time = time.clock self.dispatcher = self.trace_dispatch_i elif hasattr(os, 'times'): self.timer = os.times self.dispatcher = self.trace_dispatch self.get_time = _get_time_times else: self.timer = self.get_time = time.time self.dispatcher = self.trace_dispatch_i else: self.timer = timer t = self.timer() # test out timer function try: length = len(t) except TypeError: self.get_time = timer self.dispatcher = self.trace_dispatch_i else: if length == 2: self.dispatcher = self.trace_dispatch else: self.dispatcher = self.trace_dispatch_l # This get_time() implementation needs to be defined # here to capture the passed-in timer in the parameter # list (for performance). Note that we can't assume # the timer() result contains two values in all # cases. def get_time_timer(timer=timer, sum=sum): return sum(timer()) self.get_time = get_time_timer self.t = self.get_time() self.simulate_call('profiler') # Heavily optimized dispatch routine for os.times() timer def trace_dispatch(self, frame, event, arg): timer = self.timer t = timer() t = t[0] + t[1] - self.t - self.bias if event == "c_call": self.c_func_name = arg.__name__ if self.dispatch[event](self, frame,t): t = timer() self.t = t[0] + t[1] else: r = timer() self.t = r[0] + r[1] - t # put back unrecorded delta # Dispatch routine for best timer program (return = scalar, fastest if # an integer but float works too -- and time.clock() relies on that). def trace_dispatch_i(self, frame, event, arg): timer = self.timer t = timer() - self.t - self.bias if event == "c_call": self.c_func_name = arg.__name__ if self.dispatch[event](self, frame, t): self.t = timer() else: self.t = timer() - t # put back unrecorded delta # Dispatch routine for macintosh (timer returns time in ticks of # 1/60th second) def trace_dispatch_mac(self, frame, event, arg): timer = self.timer t = timer()/60.0 - self.t - self.bias if event == "c_call": self.c_func_name = arg.__name__ if self.dispatch[event](self, frame, t): self.t = timer()/60.0 else: self.t = timer()/60.0 - t # put back unrecorded delta # SLOW generic dispatch routine for timer returning lists of numbers def trace_dispatch_l(self, frame, event, arg): get_time = self.get_time t = get_time() - self.t - self.bias if event == "c_call": self.c_func_name = arg.__name__ if self.dispatch[event](self, frame, t): self.t = get_time() else: self.t = get_time() - t # put back unrecorded delta # In the event handlers, the first 3 elements of self.cur are unpacked # into vrbls w/ 3-letter names. The last two characters are meant to be # mnemonic: # _pt self.cur[0] "parent time" time to be charged to parent frame # _it self.cur[1] "internal time" time spent directly in the function # _et self.cur[2] "external time" time spent in subfunctions def trace_dispatch_exception(self, frame, t): rpt, rit, ret, rfn, rframe, rcur = self.cur if (rframe is not frame) and rcur: return self.trace_dispatch_return(rframe, t) self.cur = rpt, rit+t, ret, rfn, rframe, rcur return 1 def trace_dispatch_call(self, frame, t): if self.cur and frame.f_back is not self.cur[-2]: rpt, rit, ret, rfn, rframe, rcur = self.cur if not isinstance(rframe, Profile.fake_frame): assert rframe.f_back is frame.f_back, ("Bad call", rfn, rframe, rframe.f_back, frame, frame.f_back) self.trace_dispatch_return(rframe, 0) assert (self.cur is None or \ frame.f_back is self.cur[-2]), ("Bad call", self.cur[-3]) fcode = frame.f_code fn = (fcode.co_filename, fcode.co_firstlineno, fcode.co_name) self.cur = (t, 0, 0, fn, frame, self.cur) timings = self.timings if fn in timings: cc, ns, tt, ct, callers = timings[fn] timings[fn] = cc, ns + 1, tt, ct, callers else: timings[fn] = 0, 0, 0, 0, {} return 1 def trace_dispatch_c_call (self, frame, t): fn = ("", 0, self.c_func_name) self.cur = (t, 0, 0, fn, frame, self.cur) timings = self.timings if fn in timings: cc, ns, tt, ct, callers = timings[fn] timings[fn] = cc, ns+1, tt, ct, callers else: timings[fn] = 0, 0, 0, 0, {} return 1 def trace_dispatch_return(self, frame, t): if frame is not self.cur[-2]: assert frame is self.cur[-2].f_back, ("Bad return", self.cur[-3]) self.trace_dispatch_return(self.cur[-2], 0) # Prefix "r" means part of the Returning or exiting frame. # Prefix "p" means part of the Previous or Parent or older frame. rpt, rit, ret, rfn, frame, rcur = self.cur rit = rit + t frame_total = rit + ret ppt, pit, pet, pfn, pframe, pcur = rcur self.cur = ppt, pit + rpt, pet + frame_total, pfn, pframe, pcur timings = self.timings cc, ns, tt, ct, callers = timings[rfn] if not ns: # This is the only occurrence of the function on the stack. # Else this is a (directly or indirectly) recursive call, and # its cumulative time will get updated when the topmost call to # it returns. ct = ct + frame_total cc = cc + 1 if pfn in callers: callers[pfn] = callers[pfn] + 1 # hack: gather more # stats such as the amount of time added to ct courtesy # of this specific call, and the contribution to cc # courtesy of this call. else: callers[pfn] = 1 timings[rfn] = cc, ns - 1, tt + rit, ct, callers return 1 dispatch = { "call": trace_dispatch_call, "exception": trace_dispatch_exception, "return": trace_dispatch_return, "c_call": trace_dispatch_c_call, "c_exception": trace_dispatch_return, # the C function returned "c_return": trace_dispatch_return, } # The next few functions play with self.cmd. By carefully preloading # our parallel stack, we can force the profiled result to include # an arbitrary string as the name of the calling function. # We use self.cmd as that string, and the resulting stats look # very nice :-). def set_cmd(self, cmd): if self.cur[-1]: return # already set self.cmd = cmd self.simulate_call(cmd) class fake_code: def __init__(self, filename, line, name): self.co_filename = filename self.co_line = line self.co_name = name self.co_firstlineno = 0 def __repr__(self): return repr((self.co_filename, self.co_line, self.co_name)) class fake_frame: def __init__(self, code, prior): self.f_code = code self.f_back = prior def simulate_call(self, name): code = self.fake_code('profile', 0, name) if self.cur: pframe = self.cur[-2] else: pframe = None frame = self.fake_frame(code, pframe) self.dispatch['call'](self, frame, 0) # collect stats from pending stack, including getting final # timings for self.cmd frame. def simulate_cmd_complete(self): get_time = self.get_time t = get_time() - self.t while self.cur[-1]: # We *can* cause assertion errors here if # dispatch_trace_return checks for a frame match! self.dispatch['return'](self, self.cur[-2], t) t = 0 self.t = get_time() - t def print_stats(self, sort=-1): import pstats pstats.Stats(self).strip_dirs().sort_stats(sort). \ print_stats() def dump_stats(self, file): f = open(file, 'wb') self.create_stats() marshal.dump(self.stats, f) f.close() def create_stats(self): self.simulate_cmd_complete() self.snapshot_stats() def snapshot_stats(self): self.stats = {} for func, (cc, ns, tt, ct, callers) in self.timings.iteritems(): callers = callers.copy() nc = 0 for callcnt in callers.itervalues(): nc += callcnt self.stats[func] = cc, nc, tt, ct, callers # The following two methods can be called by clients to use # a profiler to profile a statement, given as a string. def run(self, cmd): import __main__ dict = __main__.__dict__ return self.runctx(cmd, dict, dict) def runctx(self, cmd, globals, locals): self.set_cmd(cmd) sys.setprofile(self.dispatcher) try: exec cmd in globals, locals finally: sys.setprofile(None) return self # This method is more useful to profile a single function call. def runcall(self, func, *args, **kw): self.set_cmd(repr(func)) sys.setprofile(self.dispatcher) try: return func(*args, **kw) finally: sys.setprofile(None) #****************************************************************** # The following calculates the overhead for using a profiler. The # problem is that it takes a fair amount of time for the profiler # to stop the stopwatch (from the time it receives an event). # Similarly, there is a delay from the time that the profiler # re-starts the stopwatch before the user's code really gets to # continue. The following code tries to measure the difference on # a per-event basis. # # Note that this difference is only significant if there are a lot of # events, and relatively little user code per event. For example, # code with small functions will typically benefit from having the # profiler calibrated for the current platform. This *could* be # done on the fly during init() time, but it is not worth the # effort. Also note that if too large a value specified, then # execution time on some functions will actually appear as a # negative number. It is *normal* for some functions (with very # low call counts) to have such negative stats, even if the # calibration figure is "correct." # # One alternative to profile-time calibration adjustments (i.e., # adding in the magic little delta during each event) is to track # more carefully the number of events (and cumulatively, the number # of events during sub functions) that are seen. If this were # done, then the arithmetic could be done after the fact (i.e., at # display time). Currently, we track only call/return events. # These values can be deduced by examining the callees and callers # vectors for each functions. Hence we *can* almost correct the # internal time figure at print time (note that we currently don't # track exception event processing counts). Unfortunately, there # is currently no similar information for cumulative sub-function # time. It would not be hard to "get all this info" at profiler # time. Specifically, we would have to extend the tuples to keep # counts of this in each frame, and then extend the defs of timing # tuples to include the significant two figures. I'm a bit fearful # that this additional feature will slow the heavily optimized # event/time ratio (i.e., the profiler would run slower, fur a very # low "value added" feature.) #************************************************************** def calibrate(self, m, verbose=0): if self.__class__ is not Profile: raise TypeError("Subclasses must override .calibrate().") saved_bias = self.bias self.bias = 0 try: return self._calibrate_inner(m, verbose) finally: self.bias = saved_bias def _calibrate_inner(self, m, verbose): get_time = self.get_time # Set up a test case to be run with and without profiling. Include # lots of calls, because we're trying to quantify stopwatch overhead. # Do not raise any exceptions, though, because we want to know # exactly how many profile events are generated (one call event, + # one return event, per Python-level call). def f1(n): for i in range(n): x = 1 def f(m, f1=f1): for i in range(m): f1(100) f(m) # warm up the cache # elapsed_noprofile <- time f(m) takes without profiling. t0 = get_time() f(m) t1 = get_time() elapsed_noprofile = t1 - t0 if verbose: print "elapsed time without profiling =", elapsed_noprofile # elapsed_profile <- time f(m) takes with profiling. The difference # is profiling overhead, only some of which the profiler subtracts # out on its own. p = Profile() t0 = get_time() p.runctx('f(m)', globals(), locals()) t1 = get_time() elapsed_profile = t1 - t0 if verbose: print "elapsed time with profiling =", elapsed_profile # reported_time <- "CPU seconds" the profiler charged to f and f1. total_calls = 0.0 reported_time = 0.0 for (filename, line, funcname), (cc, ns, tt, ct, callers) in \ p.timings.items(): if funcname in ("f", "f1"): total_calls += cc reported_time += tt if verbose: print "'CPU seconds' profiler reported =", reported_time print "total # calls =", total_calls if total_calls != m + 1: raise ValueError("internal error: total calls = %d" % total_calls) # reported_time - elapsed_noprofile = overhead the profiler wasn't # able to measure. Divide by twice the number of calls (since there # are two profiler events per call in this test) to get the hidden # overhead per event. mean = (reported_time - elapsed_noprofile) / 2.0 / total_calls if verbose: print "mean stopwatch overhead per profile event =", mean return mean #**************************************************************************** def Stats(*args): print 'Report generating functions are in the "pstats" module\a' def main(): usage = "profile.py [-o output_file_path] [-s sort] scriptfile [arg] ..." parser = OptionParser(usage=usage) parser.allow_interspersed_args = False parser.add_option('-o', '--outfile', dest="outfile", help="Save stats to ", default=None) parser.add_option('-s', '--sort', dest="sort", help="Sort order when printing to stdout, based on pstats.Stats class", default=-1) if not sys.argv[1:]: parser.print_usage() sys.exit(2) (options, args) = parser.parse_args() if (len(args) > 0): sys.argv[:] = args sys.path.insert(0, os.path.dirname(sys.argv[0])) run('execfile(%r)' % (sys.argv[0],), options.outfile, options.sort) else: parser.print_usage() return parser # When invoked as main program, invoke the profiler on a script if __name__ == '__main__': main()