Commit graph

18 commits

Author SHA1 Message Date
Devon Carew a3256e6b2f [pkg/vm_snapshot_analysis] switch to using package:lints
Change-Id: Ia36b1bf1127e0b78e0294422cff78338ef19ec26
TEST=this CL updates static analysis settings and address associated warnings
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204640
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-06-24 17:07:48 +00:00
Vyacheslav Egorov f72a31695c [vm_snapshot_analysis] Bump version number
TBR=alexmarkov@google.com
TEST=ci

Change-Id: Id7a6afc3df6d971372712707896d9976ecb038cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196493
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2021-04-22 20:55:46 +00:00
Vyacheslav Egorov 458be23fa7 [vm_snapshot_analysis] Migrate to null-safety
Fixes https://github.com/dart-lang/sdk/issues/45683

TEST=pkg-*-try bots

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-mac-release-try,pkg-win-release-try
Change-Id: Ie10f313da9778d001f9c4fb618997e3b3c781dd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195263
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-04-15 12:03:47 +00:00
jonahwilliams 48e952470a [vm_snapshot_analysis] bump dependency constraints
Flutter cannot update args dependency due to <2.0.0 constraint in package:vm_snapshot_analysis.

TEST=pkg-linux-release-try

Fixes #77856

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try
Change-Id: I93a057d023efe95a13a9a95d85b9405bf9de5ece
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191988
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
2021-03-18 21:18:53 +00:00
Vyacheslav Egorov 6d3f07f252 [vm_snapshot_analysis] Publish a new version
Issue flutter/flutter#76313

TBR=alexmarkov@google.com
TEST=not needed

Change-Id: I2a2fd49dff3dabaade8bbb8adf1f55b95956bc33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186144
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-02-22 09:16:01 +00:00
Kenzie Schmoll 42dfb9d304 Add generateCallGraphWithDominators method to generate a CallGraph from a precompiler trace.
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>
2020-09-02 16:24:42 +00:00
Kenzie Schmoll dabc54edb8 [vm_snapshot_analysis] modify -d flag and add -s flag for summary command
Change-Id: Ibaa017ffc80d674f439af1f2097729df50755fe7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158368
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-08-13 15:32:59 +00:00
Kenzie Schmoll 0a291a5d8f [vm_snapshot_analysis] Bump version to 0.5.4
Change-Id: Iedafbff367544b430329fbfb7f4470b9621cea69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158362
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
2020-08-12 21:46:29 +00:00
Peter Lee 9b185c9dd3 [vm_snapshot_analysis] Add compareProgramInfo helper method
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>
2020-08-06 15:49:49 +00:00
Kenzie Schmoll 99a233505f [vm_snapshot_analysis] Add partsForPath util to split google3 paths
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>
2020-08-04 22:30:50 +00:00
Kenzie Schmoll 6607655382 [vm_snapshot_analysis] move command/* lib files out of bin
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>
2020-07-15 20:06:47 +00:00
Kenzie Schmoll 845d0bdc09 [vm_snapshot_analysis] Move utils.dart into bin/commands/
Change-Id: Ib5471b3effb223795f0cdcc6fcf7f2e7d487e1f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154345
Reviewed-by: Jacob Richman <jacobr@google.com>
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
2020-07-15 00:34:03 +00:00
Vyacheslav Egorov 5d47c5f278 [vm_snapshot_analysis] Improve compare command
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>
2020-07-09 09:43:32 +00:00
Vyacheslav Egorov 69ec1a9965 [vm/aot] Add machine readable precompiler trace
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>
2020-07-03 09:29:10 +00:00
Vyacheslav Egorov 28a3cd2039 [vm_snapshot_analysis] Add buildComparisonTreemap
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>
2020-07-02 11:35:49 +00:00
Vyacheslav Egorov 4079c373c0 [vm/snapshot_analysis] Extract treemap from snapshot
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>
2020-06-25 12:58:28 +00:00
Vyacheslav Egorov e148167747 [vm/snapshot_analysis] Fix a minor bug in attribution of node sizes.
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>
2020-06-24 11:03:55 +00:00
Vyacheslav Egorov 117df0e98b [vm/tools] Move snapshot analysis tool to its own package.
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>
2020-06-23 13:14:41 +00:00