Commit Graph

31 Commits

Author SHA1 Message Date
Ryan Macnak a4f3b53fe8 Reapply "Partial static mode changes for vm-service and tests (part 3)."
Remove use of castTo, which is not yet available in the prebuilt SDK used to build Observatory.

Bug: https://github.com/dart-lang/sdk/issues/31587
Change-Id: Ia118710a2c4dca1851935d284e1a78a9c6517256
Reviewed-on: https://dart-review.googlesource.com/34022
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-01-11 01:31:17 +00:00
Jens Johansen 37c28f8661 Revert "Reapply "Partial static mode changes for vm-service and tests (part 3).""
This reverts commit c9f6e8695d.

Reason for revert: Change brakes Observatory:

```
$ out/ReleaseX64/dart --observe hello.dart
Observatory listening on http://127.0.0.1:8181/
Hello, world!
vm-service: isolate(348927110)  'hello.dart:main()' has no debugger attached and is paused at exit.  Connect to Observatory at http://127.0.0.1:8181/ to debug.
```

Going to the website I get
```
Unexpected exception:

NoSuchMethodError: method not found: 'castTo'
Receiver: ""
Arguments: [Instance of 'it']

StackTrace:

main.dart.js 2017:3     Object.f
main.dart.js 2203:30    Object.qn
main.dart.js 21316:11   b3.aQ
main.dart.js 20634:6    b3.c2
main.dart.js 20643:8    TZ.$1
main.dart.js 36992:29   UB.$0
main.dart.js 36982:9    Ux.nq
main.dart.js 36990:30   UC.$1
main.dart.js 36992:29   UB.$0
main.dart.js 36982:9    Ux.nq
===== asynchronous gap ===========================
main.dart.js 4840:12    Zh.e4
main.dart.js 3930:17    L.lK
main.dart.js 3932:28    L.ad
main.dart.js 20621:12   b3.dart.ba.lE
main.dart.js 20621:112  b3.dart.ba.lE
main.dart.js 20603:22   b3.cD
===== asynchronous gap ===========================
main.dart.js 4840:12    Zh.e4
main.dart.js 3930:17    L.lK
main.dart.js 3932:28    L.ad
main.dart.js 20621:12   ms.dart.ba.lE
main.dart.js 20621:112  ms.dart.ba.lE
main.dart.js 15829:10   Y4.bs
```

and Observatory is completely broken.

From https://github.com/dart-lang/sdk/issues/31397 it seems that Observatory uses an "old" sdk, i.e. we cannot use new stuff as castTo.

Original change's description:
> Reapply "Partial static mode changes for vm-service and tests (part 3)."
>
> Fix dynamic mode static warnings.
>
> Bug: https://github.com/dart-lang/sdk/issues/31587
> Change-Id: I966349f5409f911efacd11f08ffd469373bcd434
> Reviewed-on: https://dart-review.googlesource.com/33540
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=rmacnak@google.com,asiva@google.com

Change-Id: I775544cb5ab212cc836bc63181bdce31d19380b8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/31587
Reviewed-on: https://dart-review.googlesource.com/33800
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-10 12:21:53 +00:00
Ryan Macnak c9f6e8695d Reapply "Partial static mode changes for vm-service and tests (part 3)."
Fix dynamic mode static warnings.

Bug: https://github.com/dart-lang/sdk/issues/31587
Change-Id: I966349f5409f911efacd11f08ffd469373bcd434
Reviewed-on: https://dart-review.googlesource.com/33540
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-01-10 01:28:39 +00:00
Ryan Macnak e8d9d945f3 Revert "Partial static mode changes for vm-service and tests (part 3)."
This reverts commit 6ccd7b8ac2.

Reason for revert: analyzer failures

Original change's description:
> Partial static mode changes for vm-service and tests (part 3).
> 
> Bug: https://github.com/dart-lang/sdk/issues/31587
> Change-Id: I812fd4cd8e74875ce7ada9886035137af2fef73a
> Reviewed-on: https://dart-review.googlesource.com/33100
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=rmacnak@google.com,asiva@google.com

Change-Id: Ic368fc23f58e02cafbaf6ae81dbcbffc3dcced13
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/31587
Reviewed-on: https://dart-review.googlesource.com/33240
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-01-09 02:37:56 +00:00
Ryan Macnak 6ccd7b8ac2 Partial static mode changes for vm-service and tests (part 3).
Bug: https://github.com/dart-lang/sdk/issues/31587
Change-Id: I812fd4cd8e74875ce7ada9886035137af2fef73a
Reviewed-on: https://dart-review.googlesource.com/33100
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-01-09 01:40:10 +00:00
Ryan Macnak 9f4ffb64ef Partial static mode changes for vm-service and tests (part 2).
Bug: https://github.com/dart-lang/sdk/issues/31587
Change-Id: Ie2605f5043b9f5d2f9156928e3cd39f74e726853
Reviewed-on: https://dart-review.googlesource.com/30681
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-12-20 00:45:28 +00:00
Carlo Bernaschina baffc87a7e Update memory dashboard
- Fix crash related to missing nodes in Heap Snapshot
- Disabled update on GC. With the new idle GC the page was updating too
  often.

Change-Id: I8a3aaf9540ff224a5e8119303c8e8ef79e8a73f1
Reviewed-on: https://dart-review.googlesource.com/5327
Commit-Queue: Carlo Bernaschina <cbernaschina@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-09-14 02:43:20 +00:00
Ryan Macnak b7a0458196 [observatory] Add an "ownership" analysis for the heap snapshot.
An object A is said to be owned by object B if all direct references to A come from B. In particular, an object that holds unshared lists and maps will own the heap size of those lists and maps, as well as any unshared elements. We hope a table of owned sizes will be more useful than a table of shallow sizes, since the latter typically says the heap is mostly lists.

R=cbernaschina@google.com

Review-Url: https://codereview.chromium.org/3009743003 .
2017-08-30 09:50:57 -07:00
Ryan Macnak 48bc6e5d73 Add external sizes to the heap dominator tree.
Fixes #30381

R=cbernaschina@google.com

Review-Url: https://codereview.chromium.org/3008593002 .
2017-08-28 10:54:32 -07:00
Devon Carew 60a8ed5d47 Fix some observatory analysis issues.
BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2920603003 .
2017-06-08 23:59:26 -07:00
Jacob Richman 4360e99d18 Revert "Fix observatory tests broken by running dartfmt."
This reverts commit b1f7e6d94673b098c93c187fe3efc45c15f27edc.

BUG=

Committed: https://github.com/dart-lang/sdk/commit/62be0eacfbb36bdc92a05c7c35bb4506621b6a3a
Review-Url: https://codereview.chromium.org/2767533002 .
2017-03-21 10:07:26 -07:00
Jacob Richman 62be0eacfb Revert "Fix observatory tests broken by running dartfmt."
This reverts commit b1f7e6d94673b098c93c187fe3efc45c15f27edc.

BUG=

Review-Url: https://codereview.chromium.org/2767533002 .
2017-03-20 22:19:22 -07:00
Jacob Richman 88f8aacd5f Re-apply rolled back CL to apply dartfmt to runtime.
Fix observatory tests broken by running dartfmt due to line and column changes.
Temporarily reverted formatting for evaluate_activation_test.dart as dartfmt doesn't yet handle multitests.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2759973004 .
2017-03-20 21:44:59 -07:00
Ryan Macnak ea4744a06f Revert "Run dartfmt on all files under runtime."
This reverts commit 15f393f189.

The change caused many service test failures due to changed line numbers.

TBR=jacobr@google.com

Review-Url: https://codereview.chromium.org/2762583003 .
2017-03-20 13:42:55 -07:00
Jacob Richman 15f393f189 Run dartfmt on all files under runtime.
I've omitted files where the formatter output is significantly uglier
than the original code and I'll send those files in a separate CL
with options for how to make the code look reasonable while still
taking advantage of the formatter.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2751423005 .
2017-03-20 13:13:50 -07:00
Ryan Macnak 0cf02040f8 Add a version of heap snapshots that use only fields and stack frames as roots and only include instances.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2502283003 .
2016-11-28 16:00:06 -08:00
Ryan Macnak f5b1f158c0 Exclude all references into the VM isolate in heap snapshots.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2501343004 .
2016-11-15 11:03:25 -08:00
Ryan Macnak aa47407ab8 Observatory: Add view of dominator tree with siblings merged by class.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2480293003 .
2016-11-15 09:43:48 -08:00
John McCutchan 7fca076fbb Use dartfmt on Observatory code
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2345023003 .
2016-09-16 06:59:51 -07:00
Carlo Bernaschina 547d71add7 Converted Observatory heap-snapshot element
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2266343002 .
2016-08-23 12:55:43 -07:00
John McCutchan 6b22d8e97c Rewrite asyncStepOver to use await
- Add some documentation and use await instead of .then() in asyncStepOver.
- Analyzer fixes to service lib and tests.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1687293003 .
2016-02-11 14:19:03 -08:00
Ryan Macnak 5eb3bccaf1 Switch dominator algorithm from [1] to [2].
[1] has worse upper bound complexity than [2] but has lower
overhead. With [1] dart2js heaps would converge in ~10 iterations, but
with analyzer heaps would take ~10k iterations.

This reduces the time to analyze the final heap of the analyzer
analyzing dart2js from ~30 minutes to 26 seconds.

Increases peak memory usage by 21N bytes plus O(2N) words.

[1] "A Simple, Fast Dominance Algorithm." Keith D. Cooper, Timothy
J. Harvey, and Ken Kennedy.
[2] "A Fast Algorithm for Finding Dominators in a Flowgraph."
T. Lengauer and R. E. Tarjan.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1449243002 .
2015-11-17 11:20:38 -08:00
Ryan Macnak 447e497ac9 Unpack the heap snapshot from a representation of var ints and addresses to a representation of fixed ints and node ids early in heap analysis. Somewhat increases speed finding the dominator tree and greatly increases speed grouping nodes by class.
On a 190MB pub heap,
Dominator tree (dart2js): 165s -> 64s
Grouping (dart2js): 159s -> 3s
Memory (dartium): 156MB -> 169MB

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1278653004 .
2015-08-07 12:51:04 -07:00
Ryan Macnak e3d7903862 Add timing prints to object group to get a baseline.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1272823006 .
2015-08-07 10:22:11 -07:00
Ryan Macnak 1ef2b68e65 Deal with Javascript integer limitations in heap snapshot processing to handle 64-bit target VMs.
R=turnidge@google.com

Review URL: https://codereview.chromium.org//1219103002 .
2015-07-13 17:27:55 -07:00
Ryan Macnak c6ebef9526 Address hints in the Observatory.
R=turnidge@google.com

Review URL: https://codereview.chromium.org//1161553013
2015-05-29 13:42:31 -07:00
Ryan Macnak bad1ccb2f7 Heap snapshot visualizations:
- Dominator tree with retained sizes
- Merge nodes by class

- Split snapshot into chunks so the browser's websockets implementation can handle them.
- Use TypedData indexed by node ids instead of lists of objects and a higher time complexity but more memory efficient algorithm to find the dominator tree (reduces memory usage to ~2X the size of the heap being analyzed from >10X).

R=johnmccutchan@google.com, koda@google.com

Review URL: https://codereview.chromium.org//1124153006
2015-05-26 14:46:28 -07:00
koda@google.com 98e2fafbf2 Rank most retaining instances for each class.
Keep a heap snapshot (object graph) in the isolate.
On request from a class view, show 10 most retaining instances.

Currently, a new snapshot is fetched every time a ranking is requested.
In the future, we will want more fine-grained management of snapshots,
with its own dedicated view/console.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//818733002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42754 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-09 21:31:14 +00:00
johnmccutchan@google.com 261200c587 Build Observatory as part of runtime
Relanding https://codereview.chromium.org/810623005/

Review URL: https://codereview.chromium.org//837723004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42645 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-06 21:59:42 +00:00
whesse@google.com aa5a986d5d Revert "Build Observatory with runtime"
This reverts commit 76df7b3c1bf83c08d3994d61df4c9c530fadb4e5.
This commit breaks dartium compilation.

BUG=
R=ricow@google.com

Review URL: https://codereview.chromium.org//839543002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42619 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-06 10:07:58 +00:00
johnmccutchan@google.com 9d6ac72b46 1) Remove prebuilt Observatory sources
2) Move observatory from runtime/bin/vmservice/observatory to runtime/observatory

3) Add two tools scripts:
- tools/run_pub.py (runs pub before SDK is built)
- tools/obs_tool.py (helper for get, build, and deploy stages)

4) Build Observatory with runtime:
- pub get --offline
- pub build
- deploy

5) Build artifacts are now in standard output directory, for example, out/DebugIA32/observatory.

6) Add a new 'dart_boostrap' host target (no snapshot, no observatory) that can be used as the Dart executable to run pub when building Observatory. This is behind a build.py flag --use-bootstrap-for-observatory because:

- It is only necessary on older Linux distributions that are incompatible with the prebuilt Dart testing executable.
- running pub build with the boostrap Debug build is significantly slower.

7) Detect if the prebuilt executable doesn't work and automatically switch to the 'dart_bootstrap' executable. Also, warn the user and provide a Wiki link with more information.

R=turnidge@google.com

Review URL: https://codereview.chromium.org//810623005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42614 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-05 21:26:52 +00:00