Classes | |
class | Trie |
Functions | |
def | GetSymbolTrie (target, nm_command, max_depth) |
def | MaybeAddColor (s, color) |
def | ReadableSize (num) |
def | PrintTrie (trie, prefix, max_depth, min_size, color) |
def | main (argv) |
A tool to inspect the binary size of a built binary file. This script prints out a tree of symbols and their corresponding sizes, using Linux's nm functionality. Usage: python binary_size.py -- \ --target=/path/to/your/target/binary \ [--nm_command=/path/to/your/custom/nm] \ [--max_depth=10] [--min_size=1024] \ [--color] \ To assist visualization, pass in '--color' to make the symbols color coded to green, assuming that you have a xterm connection that supports color.
def caffe2.python.binarysize.GetSymbolTrie | ( | target, | |
nm_command, | |||
max_depth | |||
) |
Gets a symbol trie with the passed in target. Args: target: the target binary to inspect. nm_command: the command to run nm. max_depth: the maximum depth to create the trie.
Definition at line 37 of file binarysize.py.
def caffe2.python.binarysize.MaybeAddColor | ( | s, | |
color | |||
) |
Wrap the input string to the xterm green color, if color is set.
Definition at line 86 of file binarysize.py.
def caffe2.python.binarysize.PrintTrie | ( | trie, | |
prefix, | |||
max_depth, | |||
min_size, | |||
color | |||
) |
Prints the symbol trie in a readable manner.
Definition at line 106 of file binarysize.py.
def caffe2.python.binarysize.ReadableSize | ( | num | ) |
Get a human-readable size.
Definition at line 95 of file binarysize.py.