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
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
sdks
spec_parser Update spec_parser to handle new features (super, anywhere, records) 2022-09-27 14:10:53 +00:00
test_generators
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
build.py [build] Switch builds to the ninja in DEPS 2022-09-27 11:24:03 +00:00
canary.dart
copy_dart.py
copy_tree.py
create_pkg_manifest.py
diff_results.dart Migrate several files in tools/. 2022-06-10 16:31:04 +00:00
download_chromium_sysroot.sh
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
gen_fuchsia_test_manifest.py
generate_buildfiles.py
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
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
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
list_dart_files_as_depfile.py
make_version.py
manage_deps.dart
minidump.py
opt_out_files.dart
OWNERS [owners] ecosystem can review tools/ changes 2022-05-09 17:38:29 +00:00
OWNERS_ANALYZER
OWNERS_BUILD [infra] Give VM engineers OWNERS over tools/gn.py et al. 2022-04-25 17:47:23 +00:00
OWNERS_CFE
OWNERS_ECOSYSTEM [owners] add mosum@ to the OWNERS_ECOSYSTEM file 2022-09-16 17:51:55 +00:00
OWNERS_ENG
OWNERS_FOUNDATION
OWNERS_GOOGLE3
OWNERS_INFRA
OWNERS_PRODUCT
OWNERS_PUB
OWNERS_VM
OWNERS_WASM
OWNERS_WEB [owners] Add Nate to OWNERS_WEB 2022-06-09 16:47:43 +00:00
presubmit.sh
promote.py
publish_pkg.py
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
run_with_coredumps_enabled.py
set_ia32_sysroot.sh
set_x64_sysroot.sh
spec_parse.py
task_kill.py
test.dart [tools] migrate the rest of tools/ to null safety 2022-06-24 16:38:39 +00:00
test.py
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
write_revision_file.py
write_version_file.py
yaml2json.dart