Exposing this functionality makes it possible to use this logic in Dart DevTools.
This CL also includes some renames that make the code more readable. When there are both `ProgramInfoNode`s and `CallGraphNode`s in scope, the name "node" is ambiguous.
Bug: https://github.com/dart-lang/sdk/issues/43169
Change-Id: Ic8ef04e10c48db011cd28e1786bee34223766e47
Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160342
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Exposing this helper method will allow comparison between program info without using buildComparisonTreemap
Change-Id: Ib771801530dd34515ccecc4ec01e39cd4546e916
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157080
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Support splitting paths that look like: `package:foo.bar.baz/src/foobar.dart` as well
as "normal" paths (`package:foo/bar/baz/src/foobar.dart`).
Change-Id: I7816b7d6fd34d786a735bf74e3ea2a2606c27af5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157023
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
The files in `command/*` were moved as part of https://dart-review.googlesource.com/c/sdk/+/154360.
This CL responds to Slava's comment "FWIW having this files in bin violates pub layout guidelines and looks pretty different from all other packages we have: bin/ is a folder for scripts. Libraries should live in lib."
I verified in DevTools that with this change, we can still import files from package:vm_snapshot_analysis and run on the web (as long as we do not import files that depend on dart:io - lib/commands/utils.dart)
Change-Id: I8c4f2a55c9cf346260fa5b80116c21993ccfc249
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154481
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
Add breakdown by node type when this information is available.
Change-Id: If2d477d0720aff69e3a168b9520fc3c2ccd153c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153767
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This CL adds --trace-precompiler-to option which generates a machine readable
precompiler trace (list of all compiled functions and their dependencies).
It also expands package:vm_snapshot_analysis with tools for reading and
analysing this trace.
For example snapshot_analysis explain dynamic-calls command allows
to list all dynamic calls sorted by their impact on the size of the AOT
snapshot.
Issue https://github.com/dart-lang/sdk/issues/41249
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: Ie49143f4da375067991991e2ad20a41ec67bb1c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152851
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This helper method compares two size profiles and returns result
as a treemap.
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: I82e5617bc367a2b89d3685ce7f7babc01492b531
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152908
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
This also includes few other changes:
- Add ability to collapse leaf nodes in a treemap created from V8 snapshot
profile. This behavior is programmatically controlled by `TreemapFormat format`
parameter and from CLI via `--format` flag. The following options are available
- `collapsed` essentially renders `ProgramInfo` as a treemap, individual
snapshot nodes are ignored.
- `data-and-code` collapses snapshot nodes based on whether they represent
data or executable code.
- `object-type` collapses snapshot nodes based on their type only.
- When computing `ProgramInfo` from a V8 snapshot profile no longer create
`ProgramInfoNode` for `Code` nodes which are owned by a function - instead
directly attribute the `Code` node itself and all retained nodes into
`ProgramInfoNode` for the function itself. For stubs (including allocation
stubs) create an artificial `functionNode` instead of using `NodeType.other`.
The only remaining use of `NodeType.other` is for fields.
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: I18e5437a10dd9141adaed5dfd6f0a3545740e2a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152320
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Previously we given the info node and its corresponding snapshot node we
would attribute the size of snapshot node to the parent of the info node,
which is incorrect.
This CL also includes few other minor changes (all described in
CHANGELOG.md):
- `--help` output of the command,
the method for detecting executable name was not working correctly
under `pub global activate`: it printed snapshot name, instead of
`snapshot_analysis`;
- rename `README.dart` to `README.md` because `.dart` extension
confuses `pub` analysis.
- add documentation to `ProgramInfoNode.size`.
- add documentation on passing flags to AOT compiler
Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: I8e8f2e9b7b9bfb3fe688caa16c0490eb8ec60e7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152148
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
This code will be published on Pub so that Dev Tools can consume it.
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: Iddfbd3f0976af218d29ac20b452fbb139983a484
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152008
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>