scripts: codemap[d3].py: Added --tile-* for tiling by stack/ctx/etc

This replaces the previous fallback-to-what's-available behavior with
explicit flags:

- --tile-code - Tile based on code size (the default)
- --tile-stack - Tile based on stack limits
- --tile-frames - Tile based on stack frames
- --tile-ctx - Tile based on function context
- --tile-1 - Tile functions evenly

This has the benefit of 1. being easier to toggle, 2. being explicit,
and 3. allowing code/stack/ctx in punescapes (titles, labels, etc).

There is an interesting question if --no-stack should be implicit, since
showing two stack treemaps may be confusing, but I think that's trying
to be too clever. Instead I just added the -S/--no-stack shortform to
make it easier to toggle.

Also updated ctx.py's description string. Probably need to check what
else is out of date in other scripts as well.
This commit is contained in:
Christopher Haster
2025-04-16 02:23:27 -05:00
parent 7c26bfc0a3
commit ea535faaba
3 changed files with 96 additions and 18 deletions

View File

@@ -1392,7 +1392,7 @@ if __name__ == "__main__":
import argparse
import sys
parser = argparse.ArgumentParser(
description="Find struct sizes.",
description="Find the overhead of function contexts.",
allow_abbrev=False)
parser.add_argument(
'obj_paths',