Commit Graph

713 Commits

Author SHA1 Message Date
Ryan Macnak e67dd9c2c5 Reapply "[vm, service] Gather used and capacity from various mallocs."
Avoid weak linking on iOS.

TEST=ci
Change-Id: Iafcb5bfdea0520d50363486e67031e1d5302d32b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161461
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-04-14 21:50:31 +00:00
Ryan Macnak f54bb55244 Reland "[vm, service, observatory] Add ability to retrieve the set of all instances of a class, implementation hierarchy or interface hierarchy as an array."
Filter Class::direct_subclasses/implementors_ to remove tree-shaken classes.

TEST=ci, manual UI interaction
Bug: https://github.com/dart-lang/sdk/issues/45564
Change-Id: Ia2a46e9701745ce88dffa95a86b7756f3ab0921d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194110
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-04-14 19:40:20 +00:00
Ryan Macnak fb181e87b9 [vm, service] Fill in more field names in retaining paths.
TEST=manual, runtime/observatory/tests/ui/inspector.dart
Bug: https://github.com/flutter/flutter/issues/79605#issuecomment-814342601
Change-Id: I1532dff15620835805cd2a8e9ddab693864f6eb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194112
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-04-07 23:05:58 +00:00
Ben Konyi 2a2d83e9e9 [ VM / Service ] Add support for enabling/disabling breakpoints
This change adds a `setBreakpointState` RPC which allows for breakpoints
to be enabled or disabled without needing to remove and recreate
breakpoints.

Fixes https://github.com/dart-lang/sdk/issues/45336.

TEST=set_breakpoint_state_test.dart

Change-Id: I1a04e6028d4e4560fdb8d3d26420c9a05da06b4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193896
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-04-06 22:16:06 +00:00
Alexander Aprelev abdca81fa0 Revert "[vm, service, observatory] Add ability to retrieve the set of all instances of a class, implementation hierarchy or interface hierarchy as an array."
This reverts commit 170bda2b74 as it breaks ffi test.

See https://github.com/dart-lang/sdk/issues/45564

TEST=rollback

Change-Id: Ie27cfa7c3bc093c1e8d46722942d1f2e5e3cb77e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193882
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-04-02 16:46:11 +00:00
Ryan Macnak 170bda2b74 [vm, service, observatory] Add ability to retrieve the set of all instances of a class, implementation hierarchy or interface hierarchy as an array.
Allows developers to perform arbitrary filtering or analysis of instances, such as finding the largest strings, degreeses of duplication, histograms of various properties, etc.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/44479
Change-Id: I0b4005b5778038945e5f1b2d7858806c8e0dbbff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176381
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-04-01 20:53:22 +00:00
Ben Konyi 5e88959488 [ Service ] Deprecate CpuSamples.timeSpan
The implementation of CpuSamples.timeSpan has never matched the
specification and has never been returned properly from the service
(returned as 'timespan' instead of 'timeSpan'). Since timeSpan is
effectively the same value as timeExtentMicros, timeExtendMicros should
be used instead.

Fixes https://github.com/dart-lang/sdk/issues/45276

TEST=N/A

Change-Id: I3a1fda81e199718824ad80eb955adb3214ae192c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192780
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-03-23 21:23:31 +00:00
Jens Johansen 3f8cbc96d9 [observatory] Make Multi-line evaluation work
Before this CL, if enabling multi-line expression evaluation, clicking
`Evaluate` would crash because of - essentially - a null pointer
exception.

TEST=Existing test suites.

Change-Id: Ibe517870dee33ff9d3edd427601d724b151e9699
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186293
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-02-24 10:41:50 +00:00
Jens Johansen bbb24d3364 [observatory] Properly handle expression compile time errors
In observatory there are two different ways to do expression evaluation.
One calls `evaluateInFrame` and catches the ServerRpcException thrown
when there's a compilation error. Another calls `evaluate` and does not
catch the ServerRpcException thrown when there's a compilation error.

This means, for instance, if evaluting an expression on an instance
and makes a typo there's suddenly a big box with scrambled javascript
on the top-right of the screen.

This CL:
* Handles the ServerRpcException thrown when there's a compilation error
  for `evaluate` as well.
* Makes both `evaluate` and `evaluateInFrame` unpack the `details` sent
  by the VM instead of printing out the textual representation of a map.
  This means that you get an error message like

```
org-dartlang-debug:synthetic_debug_expression:1:1: Error: Getter not found: 'test'.
test
^^^^
```

instead of

```
{details: org-dartlang-debug:synthetic_debug_expression:1:1: Error: Getter not found: 'test'.
test
^^^^}
```

TEST=Existing test suites.

Change-Id: I2dc3f19f024e918e8d0e9b0f4166a4ef2c6cbd9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186292
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-02-24 10:34:35 +00:00
Ben Konyi 3e83400e0f [ VM / Service ] Added getAllocationTraces and setTraceClassAllocation RPCs and identity hash support
This change adds two new RPCs and various new properties:
  - getAllocationTraces
  - setTraceClassAllocation
  - classId and identityHashCode properties in CpuSample
  - traceAllocations property in Class

TEST=get_allocation_traces_test.dart

package:vm_service has been regenerated for 3.43 of the service protocol
and is ready for a 6.1.0 release.
Change-Id: Ia8ed055423798d7d17fe9f5fd74efb4239b875fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182666
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-02-12 21:15:35 +00:00
Ben Konyi 565dc5b6a2 Reland "[ VM / Service ] Report identity hash codes of objects at end of heap snapshot"
This reverts commit 7083692624 in order to
reland commit 8d99d295da.

TEST=N/A

Change-Id: I06c80a666a9307caf0313fef1fde212ec801203c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182600
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-03 19:13:40 +00:00
Ben Konyi 7083692624 [ package:vm_service ] Prepare for 6.0.1 stable null-safe release
There is no diff between this version and 6.0.1-nullsafety.1.

This temporarily reverts commit 8d99d295da.

TEST=None

Change-Id: I3597b3543c9ea9122865604b9ba07c99683a5355
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182580
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-03 18:16:27 +00:00
Ben Konyi 8d99d295da [ VM / Service ] Report identity hash codes of objects at end of heap
snapshot

TEST=pkg/vm_service/test/object_graph_identity_hash_test.dart

Change-Id: I71eff4e8bb2153d8ef1117bc90d078f678f358ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180484
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-02-01 22:37:21 +00:00
Regis Crelier b3bca1821c [VM/runtime] Decouple representation of function signatures from Function objects.
This fixes issue https://github.com/dart-lang/sdk/issues/43088

This CL improves on https://dart-review.googlesource.com/c/sdk/+/166920 by keeping the names of type parameters.

See go/dart-vm-signatures for motivation for this change.

TEST=existing suites

Change-Id: Ia82f1d322f72d07b2fb253cf914f9b868025c71e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176981
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-07 23:45:37 +00:00
Ryan Macnak c899945e2f [observatory] Remove dead import of package:usage.
TEST=build
Change-Id: I19d145b90e87e7977c4983d22e4bc4555529b6cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177661
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-05 22:19:18 +00:00
Stephen Adams 7e3b19e111 Observatory: at least 3 digits for a size
Add extra digit after period when there is only one before.
"1.21GB" is more helpful than "1.2GB", where an 8% change is needed to
make a visible difference.

TEST=Manual

Change-Id: Ib3e645245f57459fbdb0dc9cba2194fd8e634865
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176840
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-12-22 04:57:30 +00:00
Ryan Macnak e3a9d70591 [vm, service] Remove unsafe querying across threads during Isolate::PrintJSON.
Note this would be unsafe even if under a safepoint operation because not all of the queried threads participate in safepoints.

TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/44304
Bug: https://github.com/dart-lang/sdk/issues/44385
Change-Id: I8156e8c6049165e5c53b66c3391f3e8a496ddaaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175000
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-12-08 00:36:38 +00:00
Ben Konyi 89de1e82d9 [ VM / Service ] Add optional 'limit' parameter to getStack RPC
Allows for clients to request the top N frames of the current stack.

Fixes https://github.com/dart-lang/sdk/issues/43826

Change-Id: Ia8d38e6317373024382a5e857faff73c89a0d2c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169980
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-03 21:39:37 +00:00
Ben Konyi d5118d5fc8 Reland "[ Service / dart:isolate ] Added getPorts RPC and 'debugName' optional"
This reverts commit f78c40e32a.

Change-Id: Id838b39afcb371d3b50f0009322ecf0fb2080894
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169461
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-10-29 02:52:03 +00:00
Alexander Markov 7588ed86de Remove bytecode mode from the VM
Change-Id: Ief167b7ffc128105a03cc225ab750234c9a6a7a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169147
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-10-28 17:42:35 +00:00
Tess Strickland f78c40e32a Revert "Reland "[ Service / dart:isolate ] Added getPorts RPC and 'debugName' optional""
This reverts commit a5d4511847.

Reason for revert: Failure in test standalone_2/io/unix_socket_test on reload bots, see https://github.com/dart-lang/sdk/issues/43952.

Original change's description:
> Reland "[ Service / dart:isolate ] Added getPorts RPC and 'debugName' optional"
>
> This reverts commit b71477a2a6.
>
> Change-Id: Iba11c41e43ec8c08b48147bbd07b71a151c3d1e6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169243
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

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

Change-Id: I2ac1f18fef03d29bf74df4f49a91406a26f1ce26
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169323
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-10-28 10:51:40 +00:00
Ben Konyi a5d4511847 Reland "[ Service / dart:isolate ] Added getPorts RPC and 'debugName' optional"
This reverts commit b71477a2a6.

Change-Id: Iba11c41e43ec8c08b48147bbd07b71a151c3d1e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169243
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-10-28 00:49:11 +00:00
Ben Konyi b71477a2a6 Revert "[ Service / dart:isolate ] Added getPorts RPC and 'debugName' optional"
This reverts commit 5bf9163e1b.

Reason for revert: Tests failing on bots.

Original change's description:
> [ Service / dart:isolate ] Added getPorts RPC and 'debugName' optional
> parameter for ReceivePort and RawReceivePort
>
> This change collects additional information related to ReceivePort
> allocation locations and an optional debug name that will be displayed
> by tooling. ReceivePort is now a special InstanceKind and a ReceivePort
> @Instance will include the port ID, allocation stack trace, and debug
> name.
>
> Change-Id: I003cfff2b7649218e37d9b653c0e953df5d992e7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167902
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

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

Change-Id: I39c3abb07c8c40c158eb4549749b076399bccce9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169160
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-10-27 03:14:30 +00:00
Ben Konyi 5bf9163e1b [ Service / dart:isolate ] Added getPorts RPC and 'debugName' optional
parameter for ReceivePort and RawReceivePort

This change collects additional information related to ReceivePort
allocation locations and an optional debug name that will be displayed
by tooling. ReceivePort is now a special InstanceKind and a ReceivePort
@Instance will include the port ID, allocation stack trace, and debug
name.

Change-Id: I003cfff2b7649218e37d9b653c0e953df5d992e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167902
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-10-26 23:09:47 +00:00
Ryan Macnak 37ed87b038 [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
Port the service tests and Observatory to Dart 3.

Change-Id: I8a8b20d8f90acd3b5f741c93f10ba99971aa0c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154825
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-10-14 18:16:27 +00:00
Ryan Macnak d373ff5557 Revert "[vm, service] Gather used and capacity from various mallocs."
This reverts commit 84f9eee652.

Reason for revert: Weak linking does not work on iOS

Original change's description:
> [vm, service] Gather used and capacity from various mallocs.
> 
> Change-Id: I9d397b3b865a804252d1adc90c03a369bf88aff3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159186
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

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

Change-Id: I6c9e17783ee5a3296296677cad11d036aa8fa060
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160401
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-08-26 21:32:36 +00:00
Ryan Macnak 84f9eee652 [vm, service] Gather used and capacity from various mallocs.
Change-Id: I9d397b3b865a804252d1adc90c03a369bf88aff3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159186
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-08-26 20:13:05 +00:00
Ben Konyi e44c0b2264 [ Service ] Add 'is_system_isolate' option to Dart_IsolateFlags
Provides a general way to designate an isolate as a 'system isolate'
(formerly known as 'VM internal isolates').

Initial fix for https://github.com/dart-lang/sdk/issues/42875

Change-Id: I8798a3a1c51df1db8008d602f6303df13c958cba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158063
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-08-21 21:44:50 +00:00
Ben Konyi 8b7594b9ee [ Observatory ] Disable 'getWebSocketTarget' connection flow while DDS
is disabled

Invoking 'getWebSocketTarget' as an HTTP request seems to cause failures
with Flutter, resulting in a 403 response. Disabling this flow while DDS
is turned off in both the standalone VM and flutter_tools to resolve https://github.com/flutter/flutter/issues/64333

Change-Id: I862e616e622efd3701f10ed0616562cbd2663109
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159643
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-08-21 18:46:30 +00:00
Ben Konyi 54546e2681 [ Observatory ] Remove unused analytics codes
Change-Id: I6aba9a0fbf06fd575da280864c2c856ac361c691
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157002
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-08-04 02:38:43 +00:00
Ben Konyi 6a66061703 [ Service ] Add getWebSocketTarget RPC to allow for Observatory to
connect to DDS without relying on a redirect.

Some WebSocket implementations (particularly dart:html's) don't follow
redirects and don't provide the user with the message returned by the
server.

This CL adds 'getWebSocketTarget' as an RPC which returns the
URI that should be used by the client to connect directly to the proper
web socket target. In addition, the "implicit-redirect" forwarding has
been removed.

Change-Id: Iaf88c965f6fedfa6f63c28a08860a3c80388797c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156485
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-08-03 22:06:41 +00:00
Ben Konyi 8dc4833e86 [ VM/ DDS ] Temporarily disable DDS for beta release
https://github.com/dart-lang/sdk/issues/42727 isn't expected to be fixed
before the next beta release. Disabling DDS temporarily until a proper
fix has been landed.

Change-Id: Ib3233e75a115caa9625f1e96d136b0f6abc5f72e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156343
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-07-30 01:11:51 +00:00
Ryan Macnak d159c8283d [observatory] Run dartfmt.
Change-Id: I1a54fff6203b62fa195e69a056a57db8ce47d1db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152593
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-07-27 22:42:16 +00:00
Daco Harkes 202e32afeb [vm] Native API: Introduce Dart_FinalizableHandle
Introduces Dart_NewFinalizableHandle which does auto delete itself,
but does not allow accessing the weak referenced object.

Issue: https://github.com/dart-lang/sdk/issues/42312

Change-Id: I24ea732925122c453213c4fa3f629761c352f838
Cq-Include-Trybots:dart/try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try,analyzer-nnbd-linux-release-try,front-end-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154695
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-07-23 11:30:39 +00:00
Ryan Macnak f3e0e4ad9a Reland "[observatory] Avoid confusion of RSS for the VM's memory usage."
Don't assert that RSS > VM memory as VM memory might not be all resident.

Change-Id: Ie00c3e382d7b219fdb462a6e61d649f4d5276964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155140
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-07-21 20:14:55 +00:00
Ben Konyi 157ebfe50f Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
This reverts commit 7e373831ce.

Change-Id: Ib94d793a5753ec6352cd9a65e35f726a63336368
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154830
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-07-21 16:23:18 +00:00
Alexander Markov e75dca3d2e Revert "[observatory] Avoid confusion of RSS for the VM's memory usage."
This reverts commit 7aa9c226ce.

Reason for revert: service/vm_test failed on multiple vm-kernel-precomp-* bots.

Original change's description:
> [observatory] Avoid confusion of RSS for the VM's memory usage.
> 
> Separate the attributes of the process from the attributes of the VM.
> 
> Bug: b/154912152
> Change-Id: Id0dec4cd311bbd1daeb3b3f52834f26f402e64b5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154703
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

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

Change-Id: I93b34aeb3a89347f1e43de96270d853ba5d92ce3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/154912152
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155080
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-07-20 21:46:22 +00:00
Ryan Macnak 7aa9c226ce [observatory] Avoid confusion of RSS for the VM's memory usage.
Separate the attributes of the process from the attributes of the VM.

Bug: b/154912152
Change-Id: Id0dec4cd311bbd1daeb3b3f52834f26f402e64b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154703
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-07-20 20:45:21 +00:00
Alexander Aprelev 7e373831ce Revert "Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process""
This reverts commit bc4cb123a8.

Reason for revert: breaks crossword simarm tests https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-linux-debug-simarm_x64/2619

Original change's description:
> Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
> 
> This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.
> 
> By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:
> 
> VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
> Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
> Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/42092)
> 
> This reverts commit 3849b5061c.
> 
> Change-Id: I4fd3ba33840771a9f284d733c4a25fac6cde64ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154706
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I649d94c668417f2edbfd7039fa5c876e10dc32fe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154800
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-07-17 04:37:48 +00:00
Ben Konyi bc4cb123a8 Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.

By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:

VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/42092)

This reverts commit 3849b5061c.

Change-Id: I4fd3ba33840771a9f284d733c4a25fac6cde64ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154706
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-07-17 00:54:11 +00:00
Ben Konyi 3849b5061c Revert "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
This reverts commit ffe258d2d4.

Reason for revert: Failures on bots

Original change's description:
> [ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process
> 
> This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.
> 
> By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:
> 
> VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
> Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
> Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/41978)
> 
> Change-Id: I1c6b1425831b691ad20284716aa80f817dbaf607
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152588
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

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

Change-Id: Idb1d24a4524bdc3ccfb199a82710f3c0d9db539a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154702
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-07-16 19:50:57 +00:00
Ben Konyi ffe258d2d4 [ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process
This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.

By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:

VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/41978)

Change-Id: I1c6b1425831b691ad20284716aa80f817dbaf607
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152588
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-07-16 19:03:24 +00:00
Ryan Macnak 9bbadb82ed [observatory] Remove old custom element registration code.
Change-Id: Ie6aaf7f5bdea2f6d8c9ba5b2eb9c3212be3f560e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152590
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-06-25 22:45:32 +00:00
Ryan Macnak 9700d7ff63 [observatory] Include garbage and fragmentation in the heap snapshot view.
A few people have expressed confusion about why the top-level size shown in the heap snapshot view does not correspond to the total in the allocation table view. The missing size is now shown.

Change-Id: Idc7e53cb6098263f9809d4bb7c3154a97c4ba3e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152408
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-06-25 21:29:12 +00:00
Ryan Macnak f124f0fcfc [vm, service] Add getProcessMemory, which reports a tree of major ownership of memory known to the VM.
Removes the private extension to heap snapshots, which did not represent nesting.

Change-Id: I62e60922f094db68cf63bac037140e1a8b2b9fd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152424
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-06-25 19:51:12 +00:00
David Morgan 6bdf55f31f Revert "[vm, service, observatory] Bang Bang (My Type System Shot Me Down)."
This reverts commit 65e3c9d3b1.

Reason for revert: package:logging, package:stack_trace and package:usage need to be migrated first.

Original change's description:
> [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
> 
> Port the service tests and Observatory to Dart 3.
> 
> Changes from the original landing:
> 
>  - The old tests are copied to observatory_2 / service_2 so the service can still be tested when running a legacy mode program
>  - The test harness is taught about 'service_2'
>  - Observatory's package is added to front end's opt-in list
>  - Fixed some places in the bot configuration matrix so ensure 'service' runs on legacy bots and 'service_2' on weak-mode bots
> 
> The ported tests themselves are not changed.
> 
> Change-Id: I1d7e5cc61cdc044e1985e851bea7fd8a18f7d810
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149720
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

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

Change-Id: I43b72f149d8d7e9fe06006cdd8593fed1726aa3a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152004
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-06-23 08:06:00 +00:00
Ryan Macnak 65e3c9d3b1 [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
Port the service tests and Observatory to Dart 3.

Changes from the original landing:

 - The old tests are copied to observatory_2 / service_2 so the service can still be tested when running a legacy mode program
 - The test harness is taught about 'service_2'
 - Observatory's package is added to front end's opt-in list
 - Fixed some places in the bot configuration matrix so ensure 'service' runs on legacy bots and 'service_2' on weak-mode bots

The ported tests themselves are not changed.

Change-Id: I1d7e5cc61cdc044e1985e851bea7fd8a18f7d810
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149720
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-06-23 02:12:46 +00:00
Alexander Aprelev d315f906de Revert "[vm, service, observatory] Bang Bang (My Type System Shot Me Down)."
This reverts commit d806959461.

Reason for revert: multiple failures on service and other tests on various buildbots

Original change's description:
> [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
> 
> Port the service tests and Observatory to Dart 3.
> 
> Change-Id: Ia43b169a110e5209a9770aeda1b9a4007427f064
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143381
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

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

Change-Id: Id22f40dafa8c0fc3fb8c3052321629a48cb7dbc3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149684
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-06-02 03:03:57 +00:00
Ryan Macnak d806959461 [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
Port the service tests and Observatory to Dart 3.

Change-Id: Ia43b169a110e5209a9770aeda1b9a4007427f064
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143381
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-06-02 01:20:08 +00:00
Parker Lougheed 1fba93f7c7 [runtime/observatory] Clean up rewind command feedback
This check is also replicated later within [debugger.cc](https://github.com/dart-lang/sdk/blob/master/runtime/vm/debugger.cc#L4098), so it didn't necessarily matter that this check did not work.

Despite this, I think the earlier check does not hurt though, and I
also added feedback for when the supplied argument is not an int
rather than just throwing an error.

Bug: https://github.com/dart-lang/sdk/issues/38888
Change-Id: I8a7a237850957d13dbf0aa30873d3b9772eb6d1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148567
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-05-28 00:12:04 +00:00