Commit graph

164 commits

Author SHA1 Message Date
Ben Konyi 15de818977 [ Service ] Add new InstanceKind "UserTag"
Also adds a new "label" property to @Instance

TEST=pkg/vm_service/test/get_object_rpc_test.dart

Change-Id: I746d56909a55e0158896e1034665147c469109bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290920
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-23 17:51:03 +00:00
Derek Xu 67f3e1f4a0 [VM/Service] Add support for class modifiers
TEST=CI

Fixes https://github.com/dart-lang/sdk/issues/50742
Fixes https://github.com/dart-lang/sdk/issues/50743
Fixes https://github.com/dart-lang/sdk/issues/51296
Fixes https://github.com/dart-lang/sdk/issues/51297
Change-Id: I52de34219883ca8680b1a8968ac9f4183fc5e970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285360
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-27 21:07:41 +00:00
Derek Xu 35e9a34c3f [VM/Service] Fix SERVICE_PROTOCOL_MINOR_VERSION
TEST=CI

Change-Id: I1e67c0a8f4148aac0f70f777eb8211cbb64044b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285401
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-24 19:05:01 +00:00
Derek Xu 68c0ebe48a [VM/Service] Add optional parameters to getInstances
This CL updates the VM Service spec to v4.1 and adds the optional
`includeSubclasses` and `includeImplementers` parameters to the
`getInstances` service procedure.

This CL also adds `pkg/vm_service/test/get_instances_rpc_test.dart`
which is based on
`runtime/observatory/tests/service/get_instances_as_array_rpc_test.dart`

TEST=CI

Fixes https://github.com/dart-lang/sdk/issues/51003
Change-Id: Ia1ebec0ebeb6cba274621853e6486bab7cb7eb78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279201
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-01 22:04:29 +00:00
Derek Xu e738858aae [3.0 alpha][VM/Service] Update VM Service spec to v4.0
This is a reland of commit c21f7c847c,
BUT the `setExceptionPauseMode` procedure is no longer deleted in this
commit. We are not ready to delete that procedure yet, because deleting
it breaks IDE support: https://github.com/flutter/flutter/issues/117526.

TEST=CI

Original change's description:
> [3.0 alpha][VM/Service] Update VM Service spec to v4.0
>
> This CL updates the VM Service spec to version 4.0 in order to add
> support for records. Some deprecated procedures and properties will also
> be removed in v4.0.
>
> As described in service.md's changelog, this CL:
> Adds `Record` and `RecordType` `InstanceKind`s, adds a deprecation
> notice to the `decl` property of `BoundField`, adds `name` property to
> `BoundField`, adds a deprecation notice to the `parentListIndex`
> property of `InboundReference`, changes the type of the `parentField`
> property of `InboundReference` from `@Field` to `@Field|string|int`,
> adds a deprecation notice to the `parentListIndex` property of
> `RetainingObject`, changes the type of the `parentField` property of
> `RetainingObject` from `string` to `string|int`, removes the deprecated
> `setExceptionPauseMode` procedure, removes the deprecated `timeSpan`
> property from `CpuSamples`, and removes the deprecated `timeSpan`
> property from `CpuSamplesEvent.
>
> TEST=CI
>
> Issue: https://github.com/dart-lang/sdk/issues/49725
> Change-Id: I7bf61c1ba11a0c7fd95a10c9c02c14282062b802
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268521
> Commit-Queue: Derek Xu <derekx@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

Change-Id: Ieb96d426b622745e653afd6ca8c9718b1deae0a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278160
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-01-03 16:16:18 +00:00
Siva Annamalai dcaf392d34 Revert "[3.0 alpha][VM/Service] Update VM Service spec to v4.0"
This reverts commit c21f7c847c.

Reason for revert: Appears to cause issues when flutter app is launched with VSCode or Android Studio, please see https://github.com/flutter/flutter/issues/117526

Original change's description:
> [3.0 alpha][VM/Service] Update VM Service spec to v4.0
>
> This CL updates the VM Service spec to version 4.0 in order to add
> support for records. Some deprecated procedures and properties will also
> be removed in v4.0.
>
> As described in service.md's changelog, this CL:
> Adds `Record` and `RecordType` `InstanceKind`s, adds a deprecation
> notice to the `decl` property of `BoundField`, adds `name` property to
> `BoundField`, adds a deprecation notice to the `parentListIndex`
> property of `InboundReference`, changes the type of the `parentField`
> property of `InboundReference` from `@Field` to `@Field|string|int`,
> adds a deprecation notice to the `parentListIndex` property of
> `RetainingObject`, changes the type of the `parentField` property of
> `RetainingObject` from `string` to `string|int`, removes the deprecated
> `setExceptionPauseMode` procedure, removes the deprecated `timeSpan`
> property from `CpuSamples`, and removes the deprecated `timeSpan`
> property from `CpuSamplesEvent.
>
> TEST=CI
>
> Issue: https://github.com/dart-lang/sdk/issues/49725
> Change-Id: I7bf61c1ba11a0c7fd95a10c9c02c14282062b802
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268521
> Commit-Queue: Derek Xu <derekx@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Issue: https://github.com/dart-lang/sdk/issues/49725
Change-Id: Ieb2a09653192e165ea8cf68965647e346e3a318b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277181
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Auto-Submit: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-12-22 20:19:00 +00:00
Derek Xu c21f7c847c [3.0 alpha][VM/Service] Update VM Service spec to v4.0
This CL updates the VM Service spec to version 4.0 in order to add
support for records. Some deprecated procedures and properties will also
be removed in v4.0.

As described in service.md's changelog, this CL:
Adds `Record` and `RecordType` `InstanceKind`s, adds a deprecation
notice to the `decl` property of `BoundField`, adds `name` property to
`BoundField`, adds a deprecation notice to the `parentListIndex`
property of `InboundReference`, changes the type of the `parentField`
property of `InboundReference` from `@Field` to `@Field|string|int`,
adds a deprecation notice to the `parentListIndex` property of
`RetainingObject`, changes the type of the `parentField` property of
`RetainingObject` from `string` to `string|int`, removes the deprecated
`setExceptionPauseMode` procedure, removes the deprecated `timeSpan`
property from `CpuSamples`, and removes the deprecated `timeSpan`
property from `CpuSamplesEvent.

TEST=CI

Issue: https://github.com/dart-lang/sdk/issues/49725
Change-Id: I7bf61c1ba11a0c7fd95a10c9c02c14282062b802
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268521
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-12-19 19:41:41 +00:00
Ryan Macnak 6ca6400cdc [vm, service] Report InstanceKind for Sets.
(The elements were already being populated.)

TEST=ci
Change-Id: I02cfa2f311e7871836f1eddd8ed131c282235d58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269383
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-14 18:38:09 +00:00
Liam Appelbe 00f032a641 [ VM / Service ] Add isolateGroupId to IsolateRef and Isolate
This will reduce the number of RPCs we need to do in package:coverage.

Benchmarked on a bunch of flutter test suites, and it halved the time
spent gathering coverage, bringing package:coverage's performance in
line with flutter's custom coverage collector. This unblocks migrating
flutter test to package:coverage.

Bug: https://github.com/flutter/flutter/issues/108313
Change-Id: I27651c7ce356d8b20c9c88444ad25d7677795a6d
TEST=Updated existing tests
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255720
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-08-24 18:40:49 +00:00
Ben Konyi 54d3d7e459 [ Service ] Add gcType to Event
Fixes https://github.com/dart-lang/sdk/issues/49319

TEST=N/A

Change-Id: I703f102e2003ec6a21166b03ec52d89a42f61ad3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251621
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-07-20 18:08:27 +00:00
Liam Appelbe 844a9f3808 Reland "[ VM / Service ] Add abstract flag to Function"
This reverts commit 9b02bdaa76.

With https://dart-review.googlesource.com/c/sdk/+/251443 this is a
non-breaking change.

Bug: https://github.com/dart-lang/coverage/pull/412
Change-Id: Iaa8a74ab8065380d2a7e8a8fc07fec3a4518d979
TEST=Added to get_object_rpc_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251480
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-07-15 18:30:20 +00:00
Alexander Aprelev 9b02bdaa76 Revert "Reland "[ VM / Service ] Add abstract flag to Function""
This reverts commit aa2e19827f.

Reason for revert: broken g3 bot

Original change's description:
> Reland "[ VM / Service ] Add abstract flag to Function"
>
> This reverts commit 6c542eca22.
>
> Switched vm_service from a minor version bump to a major one.
> See: https://buganizer.corp.google.com/issues/236964692#comment4
>
> Bug: https://github.com/dart-lang/coverage/issues/398
> Change-Id: I85f88d4a1cdcb878cbf77da283041458381e2a2b
> TEST=Added to get_object_rpc_test.dart
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250772
> Commit-Queue: Liam Appelbe <liama@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I6fbedfb146ee2157baf49162acd0c943402b6cbf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/coverage/issues/398
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250787
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-07-07 02:39:11 +00:00
Liam Appelbe aa2e19827f Reland "[ VM / Service ] Add abstract flag to Function"
This reverts commit 6c542eca22.

Switched vm_service from a minor version bump to a major one.
See: https://buganizer.corp.google.com/issues/236964692#comment4

Bug: https://github.com/dart-lang/coverage/issues/398
Change-Id: I85f88d4a1cdcb878cbf77da283041458381e2a2b
TEST=Added to get_object_rpc_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250772
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-07-06 22:32:22 +00:00
Emmanuel Pellereau 6c542eca22 Revert "[ VM / Service ] Add abstract flag to Function"
This reverts commit 921476edf3.

Reason for revert: breaks google3 (b/236964692).

Original change's description:
> [ VM / Service ] Add abstract flag to Function
>
> Bug: https://github.com/dart-lang/coverage/issues/398
> Change-Id: I1f6e16483e28fb7a77aebae079fd62abe9d16099
> TEST=Added to get_object_rpc_test.dart
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249421
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Liam Appelbe <liama@google.com>

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

Change-Id: I1733080dadd6f283766dddbdbe1390d821f91f64
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/coverage/issues/398
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249680
Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
2022-06-24 07:35:29 +00:00
Liam Appelbe 921476edf3 [ VM / Service ] Add abstract flag to Function
Bug: https://github.com/dart-lang/coverage/issues/398
Change-Id: I1f6e16483e28fb7a77aebae079fd62abe9d16099
TEST=Added to get_object_rpc_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249421
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2022-06-23 15:46:05 +00:00
Liam Appelbe a8a29cffbb [ VM / Service ] Add libraryFilters to getSourceReport RPC
Bug: https://github.com/dart-lang/sdk/issues/48754
Change-Id: I42519d7dd751aa024860f940cbf51d2e38f7ea69
Tested: CI and new integration test
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241180
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2022-05-10 18:08:43 +00:00
Dan Field fe30c3f235 [vm] Expose whether extension stream has listeners, guard postEvent
This avoids json encoding that was otherwise happening even in product mode. JSON encoding shows up CPU profiling as taking significant time, particularly on low end devices.

TEST=runtime/observatory/tests/service/developer_extension_test.dart

Bug: https://github.com/dart-lang/sdk/issues/48860
Change-Id: I2cf4d949e85c0b23de01ec2033b04527d40c76fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242081
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Dan Field <dnfield@google.com>
2022-04-26 07:53:43 +00:00
Ben Konyi 2db8f37cfa [ Service ] Add line/column information to SourceLocation objects
Removes the need for requesting a full Script object, which can be
extremely large when including source code. This change will have a
relatively small impact on response sizes.

Related issues: https://github.com/dart-lang/sdk/issues/47215, https://github.com/flutter/devtools/issues/3382

TEST=pkg/vm_service tests updated

Change-Id: I27999c4b1da65d4f0c643fa8db1a019c0fd1d689
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227640
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-01-12 02:09:24 +00:00
Ben Konyi ea48265725 Reland "[ VM / Service ] Omit private fields from service responses by default"
Adds better error handling in DDS to prevent google3 breakages due to
Flutter binary update lag times.

This reverts commit 28e958febb.

TEST=N/A

Change-Id: Ida454f0ef3caeedd1b0326c37fef58d4b73557d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227620
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-01-11 23:35:28 +00:00
Ivan Inozemtsev 28e958febb Revert "Reland "[ VM / Service ] Omit private fields from service responses by default""
This reverts commit 91a496e5db.

Reason for revert: breaks hot reloads internally

Original change's description:
> Reland "[ VM / Service ] Omit private fields from service responses by default"
>
> This reverts commit 7d39d2dd51.
>
> TEST=N/A
>
> Change-Id: I2119c841719c77be5380857ce209532ed036bd0e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226322
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I6e751343244a4788a1f080ea1aef5fdd18417109
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227503
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2022-01-11 14:06:04 +00:00
Ben Konyi 4475267f70 [ VM / Service ] Add --log_service_response_sizes=<log.csv> debug option
Providing `--log_service_response_sizes` will cause the VM to log VM service
response sizes to the provided file in CSV format.

Also added `--service_response_sizes_directory` to the service test
runner to allow for collecting response size data for the entire service
test suite.

TEST=Local

Change-Id: I7aaf4ba936e2593e67d46ff9052e2130374ef461
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226805
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-01-07 21:22:56 +00:00
Ben Konyi 91a496e5db Reland "[ VM / Service ] Omit private fields from service responses by default"
This reverts commit 7d39d2dd51.

TEST=N/A

Change-Id: I2119c841719c77be5380857ce209532ed036bd0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226322
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-01-06 18:05:36 +00:00
Ben Konyi 0c071662a7 [ VM / Service ] Add support for streaming CPU samples with specific
user tags

TEST=cpu_sample_streaming_test.dart

Change-Id: Ia983217ae2a5da8c3252fafbed8197b4f4a20e2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224040
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-12-17 00:15:09 +00:00
Michal Terepeta 7d39d2dd51 Revert "[ VM / Service ] Omit private fields from service responses by default"
This reverts commit 75abd86407.

Reason for revert: Breaks internal tests (http://b/207612278)

Original change's description:
> [ VM / Service ] Omit private fields from service responses by default
>
> Service responses and events previously could include "private"
> properties, which have names starting with "_". This change removes
> these properties from service objects unless explicitly requested via a
> private parameter.
>
> See go/smaller-dart-vm-service-responses for response size reduction
> data.
>
> TEST=Existing service suite
>
> Change-Id: Ia65b14872e798eaa843f7d180c57721b82371d0b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221143
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I0b015baadfcdf4211426efa9a92804b163f88649
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221280
Reviewed-by: Michal Terepeta <michalt@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
2021-11-25 10:28:33 +00:00
Ben Konyi 75abd86407 [ VM / Service ] Omit private fields from service responses by default
Service responses and events previously could include "private"
properties, which have names starting with "_". This change removes
these properties from service objects unless explicitly requested via a
private parameter.

See go/smaller-dart-vm-service-responses for response size reduction
data.

TEST=Existing service suite

Change-Id: Ia65b14872e798eaa843f7d180c57721b82371d0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221143
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-11-24 00:34:31 +00:00
Ben Konyi 46f9ae9568 [ VM / Service ] Stream light-weight version of CpuSamples for CPU
profiler events.

`Event.cpuSamples` is now a `CpuSamplesEvent` rather than a `CpuSamples`
object, where `CpuSamplesEvent` returns `(@Object|NativeFunction)[]` rather
than `(@Func|NativeFunction)[]`, resulting in a smaller JSON payload.

TEST=get_object_rpc_test.dart,get_cached_cpu_samples_test.dart

Change-Id: I1ad5e3df8840b8c41735d10c6c8669f6503e54a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219284
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-11-18 19:45:26 +00:00
Ben Konyi 0cad0e7224 Reland "[ VM / Service ] Add setIsolatePauseMode RPC"
This reverts commit 6ae9f31081.

TEST=N/A

Change-Id: I98dcee3002f9f0882b1bbd5ad461d28ba2c874f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220485
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-11-17 16:17:24 +00:00
asiva 3edd0832d6 [VM/Runtime] - Remove unused Dart C API function
Remove Dart_SetNativeServiceStreamCallback which is not in use by
any embedder.

TEST=cq

Change-Id: Ic6ecadb80d94b14cd2f89b5297d65c3ab7de75e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220131
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-11-16 16:59:13 +00:00
Ben Konyi 6ae9f31081 Revert "Reland "[ VM / Service ] Add setIsolatePauseMode RPC""
This reverts commit 5de4830a4e.

Reason for revert: Unable to roll into google3

Original change's description:
> Reland "[ VM / Service ] Add setIsolatePauseMode RPC"
>
> This reverts commit d21897b88d.
>
> Reason for revert: Reland before fixing failures in google3 (requires copybara update of package:vm_service which requires this change to have already been landed in the SDK).
>
> Original change's description:
> > Revert "[ VM / Service ] Add setIsolatePauseMode RPC"
> >
> > This reverts commit cad8a34d83.
> >
> > Reason for revert: broke the g3 cbuild, see cbuild logs
> > (Error: The method 'setIsolatePauseMode' isn't defined for the class 'VmServiceInterface')
> >
> > Original change's description:
> > > [ VM / Service ] Add setIsolatePauseMode RPC
> > >
> > > Allows for service clients to set pause behaviors on a per-isolate
> > > basis at runtime. setIsolatePauseMode is a more general version of
> > > setExceptionPauseMode and setExceptionPauseMode has been marked as deprecated.
> > >
> > > TEST=pause_on_exceptions_*_test.dart,should_pause_on_exit_test.dart
> > >
> > > Change-Id: I09d80aa2123791dd74d02441c162c19cc0486955
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219580
> > > Commit-Queue: Ben Konyi <bkonyi@google.com>
> > > Reviewed-by: Siva Annamalai <asiva@google.com>
> >
> > TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com
> >
> > Change-Id: Ic326c54e0fd682e382bd70e36d87467d4148c990
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220067
> > Reviewed-by: Siva Annamalai <asiva@google.com>
> > Commit-Queue: Siva Annamalai <asiva@google.com>
>
> # Not skipping CQ checks because this is a reland.
>
> Change-Id: I0e25654e1991b7246cd413454ef45594d36f4bde
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220127
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I9f1a2e81c99bfb90ddf0b4298bcb6c60e7e69dd3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220130
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-11-13 00:01:53 +00:00
Ben Konyi 5de4830a4e Reland "[ VM / Service ] Add setIsolatePauseMode RPC"
This reverts commit d21897b88d.

Reason for revert: Reland before fixing failures in google3 (requires copybara update of package:vm_service which requires this change to have already been landed in the SDK).

Original change's description:
> Revert "[ VM / Service ] Add setIsolatePauseMode RPC"
>
> This reverts commit cad8a34d83.
>
> Reason for revert: broke the g3 cbuild, see cbuild logs
> (Error: The method 'setIsolatePauseMode' isn't defined for the class 'VmServiceInterface')
>
> Original change's description:
> > [ VM / Service ] Add setIsolatePauseMode RPC
> >
> > Allows for service clients to set pause behaviors on a per-isolate
> > basis at runtime. setIsolatePauseMode is a more general version of
> > setExceptionPauseMode and setExceptionPauseMode has been marked as deprecated.
> >
> > TEST=pause_on_exceptions_*_test.dart,should_pause_on_exit_test.dart
> >
> > Change-Id: I09d80aa2123791dd74d02441c162c19cc0486955
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219580
> > Commit-Queue: Ben Konyi <bkonyi@google.com>
> > Reviewed-by: Siva Annamalai <asiva@google.com>
>
> TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com
>
> Change-Id: Ic326c54e0fd682e382bd70e36d87467d4148c990
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220067
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

# Not skipping CQ checks because this is a reland.

Change-Id: I0e25654e1991b7246cd413454ef45594d36f4bde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220127
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-11-12 23:24:08 +00:00
Siva Annamalai d21897b88d Revert "[ VM / Service ] Add setIsolatePauseMode RPC"
This reverts commit cad8a34d83.

Reason for revert: broke the g3 cbuild, see cbuild logs
(Error: The method 'setIsolatePauseMode' isn't defined for the class 'VmServiceInterface')

Original change's description:
> [ VM / Service ] Add setIsolatePauseMode RPC
>
> Allows for service clients to set pause behaviors on a per-isolate
> basis at runtime. setIsolatePauseMode is a more general version of
> setExceptionPauseMode and setExceptionPauseMode has been marked as deprecated.
>
> TEST=pause_on_exceptions_*_test.dart,should_pause_on_exit_test.dart
>
> Change-Id: I09d80aa2123791dd74d02441c162c19cc0486955
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219580
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: Ic326c54e0fd682e382bd70e36d87467d4148c990
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220067
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-11-11 23:32:42 +00:00
Ben Konyi cad8a34d83 [ VM / Service ] Add setIsolatePauseMode RPC
Allows for service clients to set pause behaviors on a per-isolate
basis at runtime. setIsolatePauseMode is a more general version of
setExceptionPauseMode and setExceptionPauseMode has been marked as deprecated.

TEST=pause_on_exceptions_*_test.dart,should_pause_on_exit_test.dart

Change-Id: I09d80aa2123791dd74d02441c162c19cc0486955
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219580
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-11-11 20:05:51 +00:00
asiva bbff4d9589 [VM/Runtime] - Add Dart C API function to toggle timeline categories.
Add Dart C API Function Dart_EnableTimelineCategory that enables
toggling of timeline categories at runtime.

https://github.com/dart-lang/sdk/issues/47601

TEST=Dart C API tests added

Change-Id: Ib38c8ab0a8d43c9180e9cb9ade107f8bad5f5e63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219943
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-11-11 01:25:04 +00:00
Siva Annamalai 68b6665e42 Revert "[VM/Runtime] - Add Dart C API function to toggle timeline categories."
This reverts commit 8e90a9ec86.

Reason for revert: Breaks PRODUCT builds

Original change's description:
> [VM/Runtime] - Add Dart C API function to toggle timeline categories.
>
> Add Dart C API Function Dart_EnableTimelineCategory that enables
> toggling of timeline categories at runtime.
>
> https://github.com/dart-lang/sdk/issues/47601
>
> TEST=Dart C API tests added
>
> Change-Id: I679e755d69d1375552e3a02e887ac00f828553d0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219860
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

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

Change-Id: Ib8198d1466d23fefac415088b5566a4e22ba2e91
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219941
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-11-10 23:33:15 +00:00
asiva 8e90a9ec86 [VM/Runtime] - Add Dart C API function to toggle timeline categories.
Add Dart C API Function Dart_EnableTimelineCategory that enables
toggling of timeline categories at runtime.

https://github.com/dart-lang/sdk/issues/47601

TEST=Dart C API tests added

Change-Id: I679e755d69d1375552e3a02e887ac00f828553d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219860
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-11-10 22:25:14 +00:00
Ben Konyi 7d3d835bc9 Reland "[ VM / Service ] Add lookupResolvedPackageUri and lookupPackageUri RPCs"
This reverts commit 711fdcc0de.

TEST=uri_mappings_lookup_test.dart

Change-Id: I0a548ef0b5f1f0f6bc23ec72e0fe7dafc244c5d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218520
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-10-28 17:16:49 +00:00
Siva Annamalai 711fdcc0de Revert "Reland "[ VM / Service ] Add lookupResolvedPackageUri and lookupPackageUri RPCs""
This reverts commit 6c6dd13b14.

Reason for revert: Still seeing test failures in some configurations

Original change's description:
> Reland "[ VM / Service ] Add lookupResolvedPackageUri and lookupPackageUri RPCs"
>
> This reverts commit aa25975644.
>
> TEST=uri_mappings_lookup_test.dart
>
> Change-Id: I311e3130bc14a392cfc4b5d81afb137505c5c202
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218324
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: Ia69d9cfd7b395f692679fdfd185ef757550104bf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218360
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-10-27 23:48:49 +00:00
Ben Konyi 6c6dd13b14 Reland "[ VM / Service ] Add lookupResolvedPackageUri and lookupPackageUri RPCs"
This reverts commit aa25975644.

TEST=uri_mappings_lookup_test.dart

Change-Id: I311e3130bc14a392cfc4b5d81afb137505c5c202
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218324
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-10-27 23:15:51 +00:00
Ben Konyi aa25975644 Revert "[ VM / Service ] Add lookupResolvedPackageUri and lookupPackageUri RPCs"
This reverts commit 3d0f937569.

Reason for revert: Failing AOT bots

Original change's description:
> [ VM / Service ] Add lookupResolvedPackageUri and lookupPackageUri RPCs
>
> Adds RPCs that allow for service clients to convert URIs from absolute
> paths to unresolved package URIs and vice-versa.
>
> Fixes https://github.com/dart-lang/sdk/issues/46631
>
> TEST=uri_mappings_lookup_test.dart
>
> Change-Id: I06e56e37dc0d4fe505527f8fb246c07caef5e058
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217744
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Jacob Richman <jacobr@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

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

Change-Id: If36248efe05cb6ee96b4b07b246dbbbd3d1b3368
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218322
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-10-27 20:21:52 +00:00
Ben Konyi 3d0f937569 [ VM / Service ] Add lookupResolvedPackageUri and lookupPackageUri RPCs
Adds RPCs that allow for service clients to convert URIs from absolute
paths to unresolved package URIs and vice-versa.

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

TEST=uri_mappings_lookup_test.dart

Change-Id: I06e56e37dc0d4fe505527f8fb246c07caef5e058
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217744
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-10-27 18:59:17 +00:00
Ben Konyi 4759cd95da [ Profiler ] Add safepoint checks in profiler code to improve sample
streaming performance

TEST=CI

Change-Id: Iae536901a41f4b34207e022ec1e6321cfc2d74b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213380
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-09-16 13:58:45 +00:00
Liam Appelbe 011068f824 [ VM / Service ] Add reportLines flag to getSourceReport RPC
Every known user of the coverage report just wants the line numbers. At
the moment they have to do a second RPC to get the Script object, so
they can translate the token positions into line numbers.

Slower test times with coverage are usually caused by the extra time it
takes to run the RPCs. So reporting the line number directly will halve
the time it takes to get coverage, for most users.

Bug: https://github.com/flutter/flutter/issues/86722
Change-Id: I7b8d436669713ebc7b7096790a02593b9cb94dda
TEST=CI
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211081
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-08-26 18:42:58 +00:00
Ben Konyi bfff8613b7 [ VM / Service ] Add function signature, type parameter information to the service protocol
Allows for function objects to be displayed in an understandable fashion
in developer tooling (e.g., a DevTools program structure inspector).

Also adds 'implicit' property to @Function which specifies whether or not a function was defined implicitly (e.g., getter/setter).

TEST=service/get_object_rpc_test.dart

Change-Id: I2da1aa15c58635046b905e205bfd29d654bbde2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203200
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-07-23 01:20:25 +00:00
Ben Konyi 4c9e322dd4 [ VM / Service ] Allow for CpuSamples to be streamed when samples are about to be overwritten.
TEST=pkg/vm_service/test/cpu_samples_stream_test.dart

Change-Id: I1fcb49b6a79cde725a1f0622d1327b9a86165ae9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206920
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-07-16 20:50:58 +00:00
Ben Konyi 3a4b3514bc [ VM / Service ] Add UserTag support to C-API and send UserTagChanged
events on Developer stream.

Also removes intrinsic implementations for UserTag_makeCurrent to allow
for service events to be sent on UserTag change.

TEST=DartAPI_UserTags,pkg/vm_service/test/user_tag_changed_test.dart

Change-Id: I5dc9ee77c0048590d3c6e33a652eee5bc3bf522a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204440
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-06-23 00:58:47 +00:00
Ben Konyi 2552ed0114 [ VM / Service ] Export list of show/hide names through LibraryDependency object
Fixes https://github.com/dart-lang/sdk/issues/46221

TEST=pkg/vm_service/test/library_dependency_test.dart

Change-Id: I5b0f63c0cc76ba3b2e507644fc1bfc33a961f656
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203447
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-06-15 17:46:23 +00:00
Ben Konyi fa5da6a944 [ VM / Service ] Move sourceLocation property to reference objects for Class, Function, and Field.
Token position and script reference information are cheap to provide and
make it possible to tie objects to scripts without requiring additional
requests for full objects.

TEST=Existing

Change-Id: I917714149a72a53081fee5626ccad858e86f5313
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201864
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-06-02 22:18:32 +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
Ben Konyi 3b49fd862b [ VM / Service ] Add identityHashCode to @Instance and Instance
responses

Allows for comparing @Instances and Instances with allocation traces and
heap snapshot entries.

TEST=pkg/vm_service/test/get_allocation_traces_test.dart

Change-Id: I6d021b0267f1595332475470961df6e35321ce80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188600
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-03-22 22:45:57 +00:00
Alexander Aprelev 7b94d56d67 [observatory] Provide isolate for send data events because observatory expects it for write events.
_ConsoleStreamPrinter::onEvent expects isolate on WriteEvent. It's absence causes exceptions in Observatory. This started with https://dart-review.googlesource.com/c/sdk/+/190303

TEST=updated capture_stdio_test with isolate expectations; run observatory to ensure to exceptions are generated

Change-Id: I73efe9c1ab5b0d779d9432fd64ad5ccc5fcc14ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191661
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-03-17 23:30:47 +00:00