/usr/lib64/python2.7/Tools/scripts
NameSizeModeActions
analyze_dxp.py42050755editdlrm
analyze_dxp.pyc47480644editdlrm
analyze_dxp.pyo47480644editdlrm
byext.py39440755editdlrm
byext.pyc45210644editdlrm
byext.pyo45210644editdlrm
byteyears.py16370755editdlrm
byteyears.pyc13980644editdlrm
byteyears.pyo13980644editdlrm
checkappend.py46570755editdlrm
checkappend.pyc48860644editdlrm
checkappend.pyo48860644editdlrm
checkpip.py7570755editdlrm
checkpip.pyc10440644editdlrm
checkpip.pyo10440644editdlrm
checkpyc.py20100755editdlrm
checkpyc.pyc19760644editdlrm
checkpyc.pyo19760644editdlrm
classfix.py59520755editdlrm
classfix.pyc41890644editdlrm
classfix.pyo41890644editdlrm
cleanfuture.py85770755editdlrm
cleanfuture.pyc73940644editdlrm
cleanfuture.pyo73610644editdlrm
combinerefs.py43800755editdlrm
combinerefs.pyc42560644editdlrm
combinerefs.pyo42230644editdlrm
copytime.py6630755editdlrm
copytime.pyc9370644editdlrm
copytime.pyo9370644editdlrm
crlf.py6100755editdlrm
crlf.pyc8550644editdlrm
crlf.pyo8550644editdlrm
cvsfiles.py17860755editdlrm
cvsfiles.pyc21630644editdlrm
cvsfiles.pyo21630644editdlrm
db2pickle.py35700755editdlrm
db2pickle.pyc34970644editdlrm
db2pickle.pyo34970644editdlrm
diff.py20660755editdlrm
diff.pyc23860644editdlrm
diff.pyo23860644editdlrm
dutree.py16150755editdlrm
dutree.pyc22300644editdlrm
dutree.pyo22300644editdlrm
eptags.py14830755editdlrm
eptags.pyc18760644editdlrm
eptags.pyo18760644editdlrm
finddiv.py25170755editdlrm
finddiv.pyc32960644editdlrm
finddiv.pyo32960644editdlrm
findlinksto.py10690755editdlrm
findlinksto.pyc14250644editdlrm
findlinksto.pyo14250644editdlrm
findnocoding.py28080755editdlrm
findnocoding.pyc32010644editdlrm
findnocoding.pyo32010644editdlrm
find_recursionlimit.py34730755editdlrm
find_recursionlimit.pyc56730644editdlrm
find_recursionlimit.pyo56730644editdlrm
fixcid.py99950755editdlrm
fixcid.pyc78510644editdlrm
fixcid.pyo78510644editdlrm
fixdiv.py138410755editdlrm
fixdiv.pyc138490644editdlrm
fixdiv.pyo137660644editdlrm
fixheader.py11890755editdlrm
fixheader.pyc14710644editdlrm
fixheader.pyo14710644editdlrm
fixnotice.py30510755editdlrm
fixnotice.pyc35000644editdlrm
fixnotice.pyo35000644editdlrm
fixps.py8930755editdlrm
fixps.pyc9690644editdlrm
fixps.pyo9690644editdlrm
google.py5190755editdlrm
google.pyc7920644editdlrm
google.pyo7920644editdlrm
gprof2html.py21670755editdlrm
gprof2html.pyc22770644editdlrm
gprof2html.pyo22770644editdlrm
h2py.py59530755editdlrm
h2py.pyc43920644editdlrm
h2py.pyo43920644editdlrm
hotshotmain.py14830755editdlrm
hotshotmain.pyc18630644editdlrm
hotshotmain.pyo18630644editdlrm
ifdef.py37180755editdlrm
ifdef.pyc22650644editdlrm
ifdef.pyo22650644editdlrm
lfcr.py6180755editdlrm
lfcr.pyc8800644editdlrm
lfcr.pyo8800644editdlrm
linktree.py24240755editdlrm
linktree.pyc20250644editdlrm
linktree.pyo20250644editdlrm
lll.py7420755editdlrm
lll.pyc9420644editdlrm
lll.pyo9420644editdlrm
logmerge.py55750755editdlrm
logmerge.pyc50830644editdlrm
logmerge.pyo50830644editdlrm
mailerdaemon.py79420755editdlrm
mailerdaemon.pyc73640644editdlrm
mailerdaemon.pyo73640644editdlrm
md5sum.py23850755editdlrm
md5sum.pyc29170644editdlrm
md5sum.pyo29170644editdlrm
methfix.py54620755editdlrm
methfix.pyc41250644editdlrm
methfix.pyo41250644editdlrm
mkreal.py16270755editdlrm
mkreal.pyc19800644editdlrm
mkreal.pyo19800644editdlrm
ndiff.py38080755editdlrm
ndiff.pyc38590644editdlrm
ndiff.pyo38590644editdlrm
nm2def.py24430755editdlrm
nm2def.pyc29600644editdlrm
nm2def.pyo29600644editdlrm
objgraph.py60170755editdlrm
objgraph.pyc49330644editdlrm
objgraph.pyo49330644editdlrm
parseentities.py17190755editdlrm
parseentities.pyc20770644editdlrm
parseentities.pyo20770644editdlrm
patchcheck.py76790755editdlrm
patchcheck.pyc91280644editdlrm
patchcheck.pyo91280644editdlrm
pathfix.py43290755editdlrm
pathfix.pyc38380644editdlrm
pathfix.pyo38380644editdlrm
pdeps.py39360755editdlrm
pdeps.pyc32200644editdlrm
pdeps.pyo32200644editdlrm
pickle2db.py39420755editdlrm
pickle2db.pyc38190644editdlrm
pickle2db.pyo38190644editdlrm
pindent.py171700755editdlrm
pindent.pyc115590644editdlrm
pindent.pyo115590644editdlrm
ptags.py12240755editdlrm
ptags.pyc14070644editdlrm
ptags.pyo14070644editdlrm
pysource.py38460755editdlrm
pysource.pyc40090644editdlrm
pysource.pyo40090644editdlrm
redemo.py57920755editdlrm
redemo.pyc52490644editdlrm
redemo.pyo52490644editdlrm
reindent-rst.py2780755editdlrm
reindent-rst.pyc4810644editdlrm
reindent-rst.pyo4810644editdlrm
reindent.py114170755editdlrm
reindent.pyc96290644editdlrm
reindent.pyo95900644editdlrm
rgrep.py14920755editdlrm
rgrep.pyc18810644editdlrm
rgrep.pyo18810644editdlrm
serve.py11470755editdlrm
serve.pyc15970644editdlrm
serve.pyo15970644editdlrm
setup.py4210644editdlrm
setup.pyc5480644editdlrm
setup.pyo5480644editdlrm
suff.py6210755editdlrm
suff.pyc9040644editdlrm
suff.pyo9040644editdlrm
svneol.py29300755editdlrm
svneol.pyc29040644editdlrm
svneol.pyo28250644editdlrm
texcheck.py92560644editdlrm
texcheck.pyc83760644editdlrm
texcheck.pyo83760644editdlrm
texi2html.py698250755editdlrm
texi2html.pyc833230644editdlrm
texi2html.pyo833230644editdlrm
treesync.py57830755editdlrm
treesync.pyc59900644editdlrm
treesync.pyo59900644editdlrm
untabify.py12150755editdlrm
untabify.pyc15830644editdlrm
untabify.pyo15830644editdlrm
which.py16300755editdlrm
which.pyc16320644editdlrm
which.pyo16320644editdlrm
win_add2path.py16200644editdlrm
win_add2path.pyc20690644editdlrm
win_add2path.pyo20690644editdlrm
xxci.py27970755editdlrm
xxci.pyc40170644editdlrm
xxci.pyo40170644editdlrm
Edit: /usr/lib64/python2.7/Tools/scripts/objgraph.py (6017B)
#! /usr/bin/python2.7 # objgraph # # Read "nm -o" input (on IRIX: "nm -Bo") of a set of libraries or modules # and print various interesting listings, such as: # # - which names are used but not defined in the set (and used where), # - which names are defined in the set (and where), # - which modules use which other modules, # - which modules are used by which other modules. # # Usage: objgraph [-cdu] [file] ... # -c: print callers per objectfile # -d: print callees per objectfile # -u: print usage of undefined symbols # If none of -cdu is specified, all are assumed. # Use "nm -o" to generate the input (on IRIX: "nm -Bo"), # e.g.: nm -o /lib/libc.a | objgraph import sys import os import getopt import re # Types of symbols. # definitions = 'TRGDSBAEC' externals = 'UV' ignore = 'Nntrgdsbavuc' # Regular expression to parse "nm -o" output. # matcher = re.compile('(.*):\t?........ (.) (.*)$') # Store "item" in "dict" under "key". # The dictionary maps keys to lists of items. # If there is no list for the key yet, it is created. # def store(dict, key, item): if dict.has_key(key): dict[key].append(item) else: dict[key] = [item] # Return a flattened version of a list of strings: the concatenation # of its elements with intervening spaces. # def flat(list): s = '' for item in list: s = s + ' ' + item return s[1:] # Global variables mapping defined/undefined names to files and back. # file2undef = {} def2file = {} file2def = {} undef2file = {} # Read one input file and merge the data into the tables. # Argument is an open file. # def readinput(fp): while 1: s = fp.readline() if not s: break # If you get any output from this line, # it is probably caused by an unexpected input line: if matcher.search(s) < 0: s; continue # Shouldn't happen (ra, rb), (r1a, r1b), (r2a, r2b), (r3a, r3b) = matcher.regs[:4] fn, name, type = s[r1a:r1b], s[r3a:r3b], s[r2a:r2b] if type in definitions: store(def2file, name, fn) store(file2def, fn, name) elif type in externals: store(file2undef, fn, name) store(undef2file, name, fn) elif not type in ignore: print fn + ':' + name + ': unknown type ' + type # Print all names that were undefined in some module and where they are # defined. # def printcallee(): flist = file2undef.keys() flist.sort() for filename in flist: print filename + ':' elist = file2undef[filename] elist.sort() for ext in elist: if len(ext) >= 8: tabs = '\t' else: tabs = '\t\t' if not def2file.has_key(ext): print '\t' + ext + tabs + ' *undefined' else: print '\t' + ext + tabs + flat(def2file[ext]) # Print for each module the names of the other modules that use it. # def printcaller(): files = file2def.keys() files.sort() for filename in files: callers = [] for label in file2def[filename]: if undef2file.has_key(label): callers = callers + undef2file[label] if callers: callers.sort() print filename + ':' lastfn = '' for fn in callers: if fn <> lastfn: print '\t' + fn lastfn = fn else: print filename + ': unused' # Print undefined names and where they are used. # def printundef(): undefs = {} for filename in file2undef.keys(): for ext in file2undef[filename]: if not def2file.has_key(ext): store(undefs, ext, filename) elist = undefs.keys() elist.sort() for ext in elist: print ext + ':' flist = undefs[ext] flist.sort() for filename in flist: print '\t' + filename # Print warning messages about names defined in more than one file. # def warndups(): savestdout = sys.stdout sys.stdout = sys.stderr names = def2file.keys() names.sort() for name in names: if len(def2file[name]) > 1: print 'warning:', name, 'multiply defined:', print flat(def2file[name]) sys.stdout = savestdout # Main program # def main(): try: optlist, args = getopt.getopt(sys.argv[1:], 'cdu') except getopt.error: sys.stdout = sys.stderr print 'Usage:', os.path.basename(sys.argv[0]), print '[-cdu] [file] ...' print '-c: print callers per objectfile' print '-d: print callees per objectfile' print '-u: print usage of undefined symbols' print 'If none of -cdu is specified, all are assumed.' print 'Use "nm -o" to generate the input (on IRIX: "nm -Bo"),' print 'e.g.: nm -o /lib/libc.a | objgraph' return 1 optu = optc = optd = 0 for opt, void in optlist: if opt == '-u': optu = 1 elif opt == '-c': optc = 1 elif opt == '-d': optd = 1 if optu == optc == optd == 0: optu = optc = optd = 1 if not args: args = ['-'] for filename in args: if filename == '-': readinput(sys.stdin) else: readinput(open(filename, 'r')) # warndups() # more = (optu + optc + optd > 1) if optd: if more: print '---------------All callees------------------' printcallee() if optu: if more: print '---------------Undefined callees------------' printundef() if optc: if more: print '---------------All Callers------------------' printcaller() return 0 # Call the main program. # Use its return value as exit status. # Catch interrupts to avoid stack trace. # if __name__ == '__main__': try: sys.exit(main()) except KeyboardInterrupt: sys.exit(1)