dart-sdk/tools
Martin Kustermann ed5ad5c087 Add CLI tool for analyzing Dart VM heapsnapshots
This CL adds an interactive command line tool to analyze
heapsnapshots generated by the Dart VM.

The tool works by operating on sets of objects. It supports operations
like users, transitive closure, union, ...

An example usage that loads snapshot, finds all live objects, finds
the empty lists in them and prints retainers of the empty lists:

    ```
    % dart bin/explore.dart

    (hsa) load foo.heapsnapshot

    (hsa) all = closure roots
    (hsa) stat all
          size       count     class
      --------   --------  --------
       43861 kb    8371    _Uint8List dart:typed_data
         ...
      --------   --------  --------
      108904 kb  400745

    (hsa) empty-lists = dfilter (filter all _List) ==0
    (hsa) empty-growable-lists = filter (users empty-lists) _GrowableList

    (hsa) retain empty-growable-lists
    There are 5632 retaining paths of
    _GrowableList (dart:core)
    ⮑ ・UnlinkedLibraryImportDirective.configurations (package:analyzer/src/dart/analysis/unlinked_data.dart)
        ⮑ ﹢_List (dart:core)
            ⮑ ・...
    ```

For now the tool lives only in dart-lang/sdk.

TEST=pkg/heapsnapshot/test/*_test.dart

Change-Id: I671c2e3ca770e1a5aa3e590e850a5694070b4c3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261100
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-09-30 14:15:01 +00:00
..
bots [dart2wasm] Implement Wasm FfiNative support 2022-09-23 09:41:22 +00:00
buildtools [tools] Allow update.py to run on mac arm machines 2022-05-03 20:29:17 +00:00
dart2js Change : to = in tools/ and DOM templates. 2022-08-24 14:21:01 +00:00
dom Remove dynamic invocations from custom elements in html_dart2js. 2022-09-20 16:16:06 +00:00
fuchsia [infra] Migrate scripts to python3 2021-04-15 10:10:20 +00:00
linux_dist_support [build] Switch builds to the ninja in DEPS 2022-09-27 11:24:03 +00:00
package_deps Change : to = in tools/ and DOM templates. 2022-08-24 14:21:01 +00:00
patches [3xH] Use gclient wrapper script to invoke gclient correctly 2022-03-01 09:39:45 +00:00
sdks [infra] Upload RISCV64 SDK. 2022-03-30 22:18:50 +00:00
spec_parser Update spec_parser to handle new features (super, anywhere, records) 2022-09-27 14:10:53 +00:00
test_generators Change "dartfmt" -> "dart format" in test generator. 2021-10-04 17:11:27 +00:00
testing
verify_docs [pkg] prefer 'any' deps for package dev dependencies 2022-05-27 01:34:59 +00:00
.gitignore
3xhead_flutter_hooks.sh
addlatexhash.dart [deps] rev package:file 2022-05-10 00:08:42 +00:00
analysis_options.yaml [repo] improve the analysis of the tools/ directory 2022-02-17 19:09:52 +00:00
build.py [build] Switch builds to the ninja in DEPS 2022-09-27 11:24:03 +00:00
canary.dart
copy_dart.py [infra] Migrate scripts to python3 2021-04-15 10:10:20 +00:00
copy_tree.py [infra] Migrate scripts to python3 2021-04-15 10:10:20 +00:00
create_pkg_manifest.py [tools] Update all iteritems -> items 2021-05-20 11:36:52 +00:00
diff_results.dart Migrate several files in tools/. 2022-06-10 16:31:04 +00:00
download_chromium_sysroot.sh [infra] Remove wheezy left overs from SDK 2020-06-04 18:32:29 +00:00
experimental_features.yaml Unnamed libraries 2022-09-23 05:37:39 +00:00
FAKE_COMMITS [infra] Trigger mac builds now that the snoopy service is installed. 2022-05-25 11:14:55 +00:00
find_depot_tools.py [infra] Migrate scripts to python3 2021-04-15 10:10:20 +00:00
gen_fuchsia_test_manifest.py [infra] Migrate scripts to python3 2021-04-15 10:10:20 +00:00
generate_buildfiles.py [infra] Migrate scripts to python3 2021-04-15 10:10:20 +00:00
generate_experimental_flags.dart [tools] migrate the rest of tools/ to null safety 2022-06-24 16:38:39 +00:00
generate_idefiles.py [build] Switch builds to the ninja in DEPS 2022-09-27 11:24:03 +00:00
generate_package_config.dart Add CLI tool for analyzing Dart VM heapsnapshots 2022-09-30 14:15:01 +00:00
generate_package_config.py [infra] re-land work to auto-generate .dart_tool/package_config.json 2022-04-12 17:21:02 +00:00
generate_sdk_version_file.py [sdk] Generate a version file for the unpatched SDK 2022-05-05 10:36:05 +00:00
get_dot_git_folder.py [infra] Migrate scripts to python3 2021-04-15 10:10:20 +00:00
git_cl_try.sh [vm] Update bot list in tools/git_cl_try.sh 2022-04-22 15:35:20 +00:00
gn.py [vm] Add a stub simx64. 2022-07-29 18:11:01 +00:00
gn_helpers.py
line_doc_comments.dart Fix typos 2022-06-15 11:08:28 +00:00
list_dart_files.py [infra] Migrate scripts to python3 2021-04-15 10:10:20 +00:00
list_dart_files_as_depfile.py Reapply "[build] Track glob dependencies via depfiles, instead of always re-executing scripts at GN time." 2021-05-12 00:27:28 +00:00
make_version.py [vm] Rename clustered_snapshot.h/cc to app_snapshot.h/cc. 2021-09-16 00:13:34 +00:00
manage_deps.dart Allow depot_tools to update in tools/manage_deps.dart 2022-03-30 12:00:50 +00:00
minidump.py [tool] Fixes crash in tools/minidump.py 2021-05-17 10:30:30 +00:00
opt_out_files.dart [repo] improve the analysis of the tools/ directory 2022-02-17 19:09:52 +00:00
OWNERS [owners] ecosystem can review tools/ changes 2022-05-09 17:38:29 +00:00
OWNERS_ANALYZER [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
OWNERS_BUILD [infra] Give VM engineers OWNERS over tools/gn.py et al. 2022-04-25 17:47:23 +00:00
OWNERS_CFE [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
OWNERS_ECOSYSTEM [owners] add mosum@ to the OWNERS_ECOSYSTEM file 2022-09-16 17:51:55 +00:00
OWNERS_ENG add a tools/OWNERS_GOOGLE3 owners file 2022-04-19 21:31:07 +00:00
OWNERS_FOUNDATION [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
OWNERS_GOOGLE3 add a tools/OWNERS_GOOGLE3 owners file 2022-04-19 21:31:07 +00:00
OWNERS_INFRA [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
OWNERS_PRODUCT [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
OWNERS_PUB Add OWNERS_PUB 2022-03-07 13:33:42 +00:00
OWNERS_VM [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
OWNERS_WASM OWNERS files for dart2wasm 2022-02-17 09:26:23 +00:00
OWNERS_WEB [owners] Add Nate to OWNERS_WEB 2022-06-09 16:47:43 +00:00
presubmit.sh
promote.py [infra] Rely on the default ACL when uploading release artifacts. 2021-11-26 11:34:04 +00:00
publish_pkg.py [infra] Migrate scripts to python3 2021-04-15 10:10:20 +00:00
rev_sdk_deps.dart [tools] use comments in the DEPS file to prevent auto-reving of deps 2022-06-19 19:11:11 +00:00
run_offsets_extractor.sh [vm] Support RISC-V. 2022-01-20 00:57:57 +00:00
run_with_coredumps_enabled.py [gardening] Add coredump archiving support to iso-stress builder. 2021-10-04 08:49:28 +00:00
set_ia32_sysroot.sh
set_x64_sysroot.sh
spec_parse.py Migrate tools/spec_parse.py to use python3 2021-04-19 15:33:38 +00:00
task_kill.py [infra] Migrate scripts to python3 2021-04-15 10:10:20 +00:00
test.dart [tools] migrate the rest of tools/ to null safety 2022-06-24 16:38:39 +00:00
test.py [infra] Migrate scripts to python3 2021-04-15 10:10:20 +00:00
utils.py build: recognize python architecture for Windows on Arm ("ARM64") 2022-08-08 16:08:30 +00:00
validate_test_matrix.dart Migrate several files in tools/. 2022-06-10 16:31:04 +00:00
VERSION [release] Bump version to 2.19 2022-07-14 14:14:55 +00:00
write_dartdoc_options_file.py Update dartdoc to 1.0.0 and lock down dartdoc warnings. 2021-06-29 19:31:28 +00:00
write_revision_file.py [infra] Migrate scripts to python3 2021-04-15 10:10:20 +00:00
write_version_file.py [infra] Migrate scripts to python3 2021-04-15 10:10:20 +00:00
yaml2json.dart [repo] improve the analysis of the tools/ directory 2022-02-17 19:09:52 +00:00