/usr/lib64/python2.6/Tools/scripts
NameSizeModeActions
byext.py39190755editdlrm
byext.pyc44650644editdlrm
byext.pyo44650644editdlrm
byteyears.py16410755editdlrm
byteyears.pyc14160644editdlrm
byteyears.pyo14160644editdlrm
checkappend.py46610755editdlrm
checkappend.pyc49520644editdlrm
checkappend.pyo49520644editdlrm
checkpyc.py20140755editdlrm
checkpyc.pyc20110644editdlrm
checkpyc.pyo20110644editdlrm
classfix.py59560755editdlrm
classfix.pyc42540644editdlrm
classfix.pyo42540644editdlrm
cleanfuture.py85810755editdlrm
cleanfuture.pyc75100644editdlrm
cleanfuture.pyo74750644editdlrm
combinerefs.py43840755editdlrm
combinerefs.pyc42760644editdlrm
combinerefs.pyo42410644editdlrm
copytime.py6670755editdlrm
copytime.pyc9450644editdlrm
copytime.pyo9450644editdlrm
crlf.py6140755editdlrm
crlf.pyc8650644editdlrm
crlf.pyo8650644editdlrm
cvsfiles.py17900755editdlrm
cvsfiles.pyc21970644editdlrm
cvsfiles.pyo21970644editdlrm
db2pickle.py35740755editdlrm
db2pickle.pyc35520644editdlrm
db2pickle.pyo35520644editdlrm
diff.py20020644editdlrm
diff.pyc23580644editdlrm
diff.pyo23580644editdlrm
dutree.py16190755editdlrm
dutree.pyc22660644editdlrm
dutree.pyo22660644editdlrm
eptags.py14870755editdlrm
eptags.pyc18850644editdlrm
eptags.pyo18850644editdlrm
finddiv.py25210755editdlrm
finddiv.pyc33320644editdlrm
finddiv.pyo33320644editdlrm
findlinksto.py10730755editdlrm
findlinksto.pyc14430644editdlrm
findlinksto.pyo14430644editdlrm
findnocoding.py27110755editdlrm
findnocoding.pyc31480644editdlrm
findnocoding.pyo31480644editdlrm
fixcid.py99880755editdlrm
fixcid.pyc79690644editdlrm
fixcid.pyo79690644editdlrm
fixdiv.py139030755editdlrm
fixdiv.pyc141700644editdlrm
fixdiv.pyo140800644editdlrm
fixheader.py11930755editdlrm
fixheader.pyc14860644editdlrm
fixheader.pyo14860644editdlrm
fixnotice.py30540755editdlrm
fixnotice.pyc35280644editdlrm
fixnotice.pyo35280644editdlrm
fixps.py8970755editdlrm
fixps.pyc9770644editdlrm
fixps.pyo9770644editdlrm
ftpmirror.py128570755editdlrm
ftpmirror.pyc112910644editdlrm
ftpmirror.pyo112910644editdlrm
google.py5230755editdlrm
google.pyc8020644editdlrm
google.pyo8020644editdlrm
gprof2html.py21710755editdlrm
gprof2html.pyc23110644editdlrm
gprof2html.pyo23110644editdlrm
h2py.py57530755editdlrm
h2py.pyc43440644editdlrm
h2py.pyo43440644editdlrm
hotshotmain.py14870755editdlrm
hotshotmain.pyc18670644editdlrm
hotshotmain.pyo18670644editdlrm
ifdef.py37200755editdlrm
ifdef.pyc23310644editdlrm
ifdef.pyo23310644editdlrm
lfcr.py6220755editdlrm
lfcr.pyc8900644editdlrm
lfcr.pyo8900644editdlrm
linktree.py24280755editdlrm
linktree.pyc20550644editdlrm
linktree.pyo20550644editdlrm
lll.py7500755editdlrm
lll.pyc9630644editdlrm
lll.pyo9630644editdlrm
logmerge.py55790755editdlrm
logmerge.pyc51630644editdlrm
logmerge.pyo51630644editdlrm
mailerdaemon.py79200644editdlrm
mailerdaemon.pyc74450644editdlrm
mailerdaemon.pyo74450644editdlrm
md5sum.py23890755editdlrm
md5sum.pyc29560644editdlrm
md5sum.pyo29560644editdlrm
methfix.py54660755editdlrm
methfix.pyc41940644editdlrm
methfix.pyo41940644editdlrm
mkreal.py16310755editdlrm
mkreal.pyc19970644editdlrm
mkreal.pyo19970644editdlrm
ndiff.py38120755editdlrm
ndiff.pyc38910644editdlrm
ndiff.pyo38910644editdlrm
nm2def.py24470755editdlrm
nm2def.pyc29990644editdlrm
nm2def.pyo29990644editdlrm
objgraph.py60210755editdlrm
objgraph.pyc50160644editdlrm
objgraph.pyo50160644editdlrm
parseentities.py17230755editdlrm
parseentities.pyc20920644editdlrm
parseentities.pyo20920644editdlrm
patchcheck.py26440644editdlrm
patchcheck.pyc40330644editdlrm
patchcheck.pyo40330644editdlrm
pathfix.py48190755editdlrm
pathfix.pyc42610644editdlrm
pathfix.pyo42610644editdlrm
pdeps.py39400755editdlrm
pdeps.pyc32770644editdlrm
pdeps.pyo32770644editdlrm
pickle2db.py39460755editdlrm
pickle2db.pyc38750644editdlrm
pickle2db.pyo38750644editdlrm
pindent.py179000755editdlrm
pindent.pyc130200644editdlrm
pindent.pyo130200644editdlrm
ptags.py12280755editdlrm
ptags.pyc14200644editdlrm
ptags.pyo14200644editdlrm
pysource.py38500755editdlrm
pysource.pyc40570644editdlrm
pysource.pyo40570644editdlrm
redemo.py57690644editdlrm
redemo.pyc52800644editdlrm
redemo.pyo52800644editdlrm
reindent-rst.py8410755editdlrm
reindent-rst.pyc11490644editdlrm
reindent-rst.pyo11490644editdlrm
reindent.py104930755editdlrm
reindent.pyc89100644editdlrm
reindent.pyo88690644editdlrm
rgrep.py14960755editdlrm
rgrep.pyc19090644editdlrm
rgrep.pyo19090644editdlrm
setup.py4210644editdlrm
setup.pyc5500644editdlrm
setup.pyo5500644editdlrm
suff.py6250755editdlrm
suff.pyc9160644editdlrm
suff.pyo9160644editdlrm
svneol.py29340755editdlrm
svneol.pyc29270644editdlrm
svneol.pyo28440644editdlrm
texcheck.py92560644editdlrm
texcheck.pyc84830644editdlrm
texcheck.pyo84830644editdlrm
texi2html.py698270755editdlrm
texi2html.pyc838690644editdlrm
texi2html.pyo838690644editdlrm
treesync.py57870755editdlrm
treesync.pyc60730644editdlrm
treesync.pyo60730644editdlrm
untabify.py11880755editdlrm
untabify.pyc15710644editdlrm
untabify.pyo15710644editdlrm
which.py16340755editdlrm
which.pyc16590644editdlrm
which.pyo16590644editdlrm
win_add2path.py16200644editdlrm
win_add2path.pyc21390644editdlrm
win_add2path.pyo21390644editdlrm
xxci.py28010755editdlrm
xxci.pyc40650644editdlrm
xxci.pyo40650644editdlrm
Edit: /usr/lib64/python2.6/Tools/scripts/objgraph.py (6021B)
#! /usr/bin/env python2.6 # 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)