Commit Graph

713 Commits

Author SHA1 Message Date
Ben Konyi b3c55f972f Added isolate + thread high watermark tracking to Observatory
Added tracking of memory usage inside of threads. In addition, the max memory usage is kept track of using a high watermark for both the threads and the isolates. Isolate high watermark information is updated when a thread exits the isolate. The isolate high watermark consists of the sum of all thread high watermarks (including the high watermark of the exiting thread). High watermark information for both threads and isolates is now visible in the isolate view in the Observatory.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2609253002 .
2017-01-04 15:08:02 -08:00
John McCutchan ebe7d148f3 Document some recent service protocol features
Document the `reloadSources` RPC.

Document the `PausePostRequest` pause event.

Document the 'IsolateReloaded' event.

BUG=
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2614643003 .
2017-01-04 13:45:27 -08:00
Ben Konyi 82cf4cc374 Added methods to surface number of zone and scoped handles for each isolate.
Added methods to surface number of zone and scoped handles in each isolate. These values are displayed in the isolate view page in the Observatory. These handle counts for the native IO isolate will be surfaced in another CL.

BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2601153002 .
2017-01-03 12:21:16 -08:00
Ben Konyi e28b3e3c60 Revert "Added isolate + thread high watermark tracking to Observatory"
This reverts commit 0a1a534fd9.

BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2605933003 .
2016-12-28 16:49:47 -08:00
Ben Konyi 0a1a534fd9 Added isolate + thread high watermark tracking to Observatory
Added tracking of memory usage inside of threads. In addition, the max memory usage is kept track of using a high watermark for both the threads and the isolates. Isolate high watermark information is updated when a thread exits the isolate. The isolate high watermark consists of the sum of all thread high watermarks (including the high watermark of the exiting thread). High watermark information for both threads and isolates is now visible in the isolate view in the Observatory.

BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2608463002 .
2016-12-28 14:59:22 -08:00
Ben Konyi 638a53e715 Added entry for thread information in the isolate view of the observatory. Current information shown is: -List of active threads w/ their associated ID and task kinds -All zones active under a given thread, including their allocated capacity and current usage.
BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2600533002 .
2016-12-22 10:25:54 -08:00
Kevin Millikin d9f80a9ac1 Turn the VM's dart:typed_data into a patch
Before, the VM's dart:typed_data was a complete replacement of the SDK's
dart:typed_data implementation instead of a patch.  This is unlike all
the other SDK libraries.  This difference requires special-casing for
dart:typed_data in tools that handle the SDK libraries (e.g., the
Analyzer's patching support, the GN build).

This change makes dart:typed_data back into a patch to the SDK's
implementation.  It reintroduces a distinction between abstract
interface and concrete implementation classes, so there are more
classes.

BUG=
R=fschneider@google.com, vegorov@google.com

Committed: https://github.com/dart-lang/sdk/commit/a9b906d319c32525a0600c75c008c92753591d86
Review-Url: https://codereview.chromium.org/2571563005 .
2016-12-22 10:57:21 +01:00
Kevin Millikin f97440848f Revert "Turn the VM's dart:typed_data into a patch"
This reverts commit a9b906d319.

A lot of things were broken by the changes to implementation class
names.

BUG=

Review-Url: https://codereview.chromium.org/2598603002 .
2016-12-21 12:28:33 +01:00
Kevin Millikin a9b906d319 Turn the VM's dart:typed_data into a patch
Before, the VM's dart:typed_data was a complete replacement of the SDK's
dart:typed_data implementation instead of a patch.  This is unlike all
the other SDK libraries.  This difference requires special-casing for
dart:typed_data in tools that handle the SDK libraries (e.g., the
Analyzer's patching support, the GN build).

This change makes dart:typed_data back into a patch to the SDK's
implementation.  It reintroduces a distinction between abstract
interface and concrete implementation classes, so there are more
classes.

BUG=
R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2571563005 .
2016-12-21 08:34:52 +01:00
Ben Konyi 5bf4fcee29 Added thread.dart and zone.dart to the observatory sources to resolve build issues.
BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2583313002 .
2016-12-19 12:36:36 -08:00
Ben Konyi f1de9b09d7 Revert "Added ability to request zone memory information for all isolates through the VM service and added tests."
This reverts commit 9622f1a2df.

BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2588083002 .
2016-12-19 10:31:29 -08:00
Ben Konyi 9622f1a2df Added ability to request zone memory information for all isolates through the VM service and added tests.
BUG=
R=johnmccutchan@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2574643003 .
2016-12-19 10:08:19 -08:00
John McCutchan f125cc7d0b Improve the casing of Stackmap and Stacktrace.
- [x] Stackmap -> StackMap
- [x] Stacktrace -> StackTrace

This makes us consistent with the Dart language (StackTrace) and
corrects the casing of StackMap.

BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2572563004 .
2016-12-12 14:51:30 -08:00
Todd Turnidge 4bb342a547 Fix a bug: observatory debugger can't expand instances.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2550623003 .
2016-12-02 13:24:16 -08:00
Todd Turnidge e0d350aa27 Implement rewind on all platforms except for dbc.
BUG=

Review URL: https://codereview.chromium.org/2534413005 .
2016-12-01 17:19:31 -08: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
Todd Turnidge 193ddba4db Revert "Implement rewind: drop one or more frames from the debugger."
This reverts commit af1875be91.

BUG=

Review URL: https://codereview.chromium.org/2521413002 .
2016-11-22 16:05:26 -08:00
Todd Turnidge af1875be91 Implement rewind: drop one or more frames from the debugger.
Not yet implemented on dbc.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2523053002 .
2016-11-22 15:26:08 -08:00
John McCutchan 8a7f7715f1 Add a complex reload test that rebases the root script path three times.
BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org/2518643002 .
2016-11-18 12:24:01 -08:00
Kevin Moore 4d75bf77a5 Fix a couple of links in runtime/observatory
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2513703002 .
2016-11-17 12:31:00 -08:00
Kevin Moore 4e17c8b1f8 Observatory: remove unused imports
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2505673002 .
2016-11-15 15:11:43 -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
Ryan Macnak 987165f022 Reload native extensions when starting from a snapshot.
Fixes #21180
Fixes #27574

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2475523002 .
2016-11-07 16:17:47 -08:00
Kevin Moore 35c09238d6 smaller observatory pngs
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2473293003 .
2016-11-07 07:08:53 -08:00
John McCutchan 63e4f69e5e Provide an API to dart:developer to control the web server hosting the Service Protocol
- [x] Add `ServiceProtocolnfo` class to dart:developer.
- [x] Add `Service` class to dart:developer.
- [x] Add `Service.getInfo` static method to dart:developer.
- [x] Add `Service.controlWebServer` static method to dart:developer.

API:

```dart

/// Information about the service protocol.
class ServiceProtocolInfo {
  /// The major version of the protocol.
  final int majorVersion;
  /// The minor version of the protocol.
  final int minorVersion;
  /// The Uri to access the service. If the web server is not running, this
  /// will be null.
  final Uri serverUri;
}

/// Access information about the service protocol and control the web server.
class Service {
  /// Get information about the service protocol.
  static Future<ServiceProtocolInfo> getInfo();

  /// Control the web server that the service protocol is accessed through.
  static Future<ServiceProtocolInfo> controlWebServer({bool enable: false});
}
```

... and add a randomly generated authentication token path prefix that must be passed in to access the service protocol.

Old base url:

Observatory listening on http://127.0.0.1:54804/

New base url:

Observatory listening on http://127.0.0.1:54804/<token>/

For example:

Observatory listening on http://127.0.0.1:54804/PTwjm8Ii8qg=/

Many tools will need to be updated.

Fixes #23320

BUG=
R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/2438613002 .
2016-10-31 12:32:23 -07:00
John McCutchan 8061bd5a8a Add local variable declaration token position to service protocol
- [x] Add three public fields to the "BoundVariable" service type: declarationTokenPos, visibleStartTokenPos, and visibleEndTokenPos. (naming suggestions welcome!)
- [x] Extend LocalVarDescriptors to hold the declaration token position (it already had the scope visibility boundaries).
- [x] Extend ContextScope to hold the declaration token position.
- [x] Add a unit test which verifies this works for local variables, function parameters, and closure captured variables.

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

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2419013004 .
2016-10-17 11:18:24 -07:00
John McCutchan a43d37be81 Fix reload_sources_test flake
BUG=

Review URL: https://codereview.chromium.org/2415183005 .
2016-10-14 15:33:55 -07:00
John McCutchan 2d0a08baf9 Make reloadSources service RPC public
- [x] Make `reloadSources` RPC public.
- [x] Add an optional 'pause' parameter to `reloadSources`. When set to true, the isolate will enter the debug pause loop immediately after reloading sources and before resuming execution. This makes it possible for debugger clients to set breakpoints before resuming.
- [x] Add reload_sources_test which tests pausing after reload.
- [x] Fix a bug in `GetVarDescriptors` where a null code object could be used.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/2411153002 .
2016-10-13 07:45:56 -07:00
John McCutchan 48c6f19600 Respect setLibraryDebuggable
- [x] Mark all libraries debuggable by default
- [x] Mark all dart:_* libraries as not debuggable by default
- [x] Respect setLibraryDebuggable
- [x] Add set library debuggable test case
- [x] Do not allow dart:_* libraries to be marked debuggable

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

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2361183002 .
2016-09-23 10:45:51 -07:00
Ryan Macnak 8610536da7 Misc Observatory tweaks.
- Fix profiler mode descriptions.
 - Add count for ports and class hierarchy.
 - Group 'heap snapshot' and 'heap map' together.

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

Review URL: https://codereview.chromium.org/2359553002 .
2016-09-20 12:44:36 -07:00
John McCutchan 699e328105 Fix VM connect element test
BUG=

Review URL: https://codereview.chromium.org/2348313002 .
2016-09-19 07:33:44 -07:00
John McCutchan e2b922b4c5 Fix service test websocket error edge case
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2343183002 .
2016-09-16 10:31:05 -07:00
John McCutchan 0d831bd5c8 Use Chain.capture instead of runZoned
- [x] Swap all calls of runZoned to Chain.capture.

Chain.capture is a wrapper around runZoned that tracks stack traces across asynchronous gaps.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2349753002 .
2016-09-16 09:44:06 -07: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
Ryan Macnak 47cc06ae66 Shrink AOT snapshot size and memory usage.
- Conditionally remove fields of Code, Function and ICData that are not used in the AOT runtime.
 - Don't include RawClosureData.context_scope_ in AOT snapshots.
 - Remove parameter names not needed for method resolution.
 - Remove parameter types not needed for function type tests.
 - Deduplicate parameter name and parameter type lists.
 - Shrink and share the initial MegamorphicCache table.

Flutter gallery (IsolateSnapshotReader event)
snapshot size 2731129 -> 2199999 (-19.4%)
initial heap  7899568 -> 5433176 (-31.2%)

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2326483005 .
2016-09-15 15:06:42 -07:00
Ryan Macnak 57d558fa5f Observatory: Fix instance view of lists.
Fixes #27351.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2342943002 .
2016-09-15 13:35:18 -07:00
John McCutchan 72b79d970b Improve VM connection flow in Observatory
- [x] Don't show "(Connected)" next to a VM we aren't connected to.
- [x] Navigate to the vm-connect page if we get an initial connection error.
- [x] Fix regression of the 'vm disconnected' notification bubble not appearing.
- [x] Use the Uris helper class instead of hard coded paths
- [x] Improve user inputted URI normalization
- [x] Ignore network errors on stream subscription requests
- [x] On first launch, attempt to connect to the default target and not the last target connected to.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2340973002 .
2016-09-15 11:29:06 -07:00
John McCutchan 87dcad607e Cleanup some Observatory errors caught by dart2js
Not sure why the analzyer didn't notice these but dart2js (when invoked via pub serve does).

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2339303003 .
2016-09-14 15:45:14 -07:00
Ryan Macnak cd4c9fc46b Observatory: Fix allocation profile CSV export. Fix heap snapshot in/out reference counts.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2340883002 .
2016-09-14 15:44:28 -07:00
Carlo Bernaschina 1b4afdab2d Restored SVGs in Observatory script-inset element
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2328943003 .
2016-09-09 09:58:07 -07:00
Ryan Macnak ebc0c261a5 Minor UI tweaks.
R=cbernaschina@google.com

Review URL: https://codereview.chromium.org/2324833005 .
2016-09-09 09:55:50 -07:00
Carlo Bernaschina 5b838cfb01 Allow to compact header in allocation-profile
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2322643004 .
2016-09-08 14:36:43 -07:00
Carlo Bernaschina de2cea8f57 Added missing content to nav-top-menu
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2325613003 .
2016-09-08 10:47:40 -07:00
Carlo Bernaschina d9a886c397 Reverted change to ServiceMap
TBR=rmacnak@google.com

Review URL: https://codereview.chromium.org/2323543002 .
2016-09-07 15:03:00 -07:00
Carlo Bernaschina 5177c2bca9 Removed polymer & mirror from Observatory
web_components are still necessary, but avoiding to use shadow dom
allows us to use the lite version

Closes=https://github.com/dart-lang/sdk/issues/27239
Closes=https://github.com/dart-lang/sdk/issues/27148
Closes=https://github.com/dart-lang/sdk/issues/26952

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

Review URL: https://codereview.chromium.org/2310003004 .
2016-09-07 14:15:27 -07:00
Carlo Bernaschina 876f49999a Converted Observatory debugger elements
R=rmacnak@google.com, turnidge@google.com

Review URL: https://codereview.chromium.org/2312553002 .
2016-09-06 15:05:44 -07:00
Carlo Bernaschina cfefe97495 Converted Observatory metrics-page element
Major restyle

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2303173002 .
2016-09-06 09:56:16 -07:00
Carlo Bernaschina bc5a41edf8 Fixed crash of Observatory class-view element
Fixes=https://github.com/dart-lang/sdk/issues/27222

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2308003002 .
2016-09-02 11:12:44 -07:00
Carlo Bernaschina c38769ea9a Converted Observatory timeline-page element
Not fully testable

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2299613004 .
2016-09-02 10:38:40 -07:00