Commit Graph

713 Commits

Author SHA1 Message Date
Todd Turnidge 5e196ada5d VMMustBePaused -> IsolateMustBePaused
Closes #24537

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1973303003 .
2016-05-16 11:19:22 -07:00
Todd Turnidge 4d473a819f Allow users to see more elements of a list/map in Observatory.
Closes #26004

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1977873003 .
2016-05-13 15:08:55 -07:00
John McCutchan b895aa5154 Improve CPU Profile View
Service:

- [x] Add "_profilerMode" to VM response. "VM" or "Dart" depending on --profile-vm flag.
- [x] Output a tree where VM tag are treated as executing "exit frame" functions when profiling Dart.
- [x] tick "exit frame" tag functions when profiling Dart.

Observatory:

- [x] don't include option for VM tags when profiling Dart.
- [x] default to no tags when profiling Dart.

- [x] indent the colored bar closer to the down arrow.
- [x] don't show percentages for user tag rows.

- [x] Update cpu profile table view to use virtual tree.
- [x] Update class allocation view to use virtual tree.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1851293005 .
2016-05-13 10:07:19 -07:00
John McCutchan c566fc30c6 Add Timeline Developer Profiles for faster category switching
- [x] Add a drop down of preset enabled streams.
- [x] Relabel 'Get' button to 'Refresh'.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1975953002 .
2016-05-12 13:32:42 -07:00
John McCutchan db07faaa8c Improve Observatory Timeline UI
- [x] Remove Stop / Start buttons and replace with fine grained category control.
- [x] Restrict the cpu profile to the time span of the timeline.
- [x] Display recorder name.
- [x] Show a popup when fetching the timeline from the VM.
- [x] Show a popup when fetching the cpu profile(s) from the VM.

Fixes #26401
Fixes #26394

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1972523003 .
2016-05-12 07:16:19 -07:00
John McCutchan 5331af35bc Skip adding line based range data for ranges that don't map to a line.
BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org/1960213002 .
2016-05-09 13:40:09 -07:00
Stephen Adams fcf5278b6c Observatory: Tweak disassembly comments
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1885273004 .
2016-04-15 09:56:13 -07:00
John McCutchan b1eb8859a5 Add call tree filter to Observatory CPU profile tree
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1846713003 .
2016-04-01 06:41:09 -07:00
John McCutchan 29225365fd Automatically fetch timeline when timeline page is loaded
R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1847043003 .
2016-03-31 11:03:14 -07:00
Ryan Macnak 1c107c4fbd vm-service: Include bytecode with _RegExp objects.
BUG=http://dartbug.com/26042
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1822933002 .
2016-03-31 10:05:18 -07:00
John McCutchan a72409a0d4 Refactor call tree search to support both Code and Function trees
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1837373002 .
2016-03-30 17:13:48 -07:00
Ryan Macnak 00eff0ff6a Improve error message when attempting to evaluate against a VM-internal object (e.g., a MegamorphicCache's table).
Don't accumulate object annotations on the disassembly when refreshing a Code view.

BUG=http://dartbug.com/26008
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1835393002 .
2016-03-28 14:51:06 -07:00
John McCutchan bae39a100c Dramatically increase the performance of Observatory's profile UI
- Add new VirtualTree view model. Only renders visible tree rows and keeps DOM load light regardless of tree size.

- Port Observatory profiler UI to new VirtualTree.

- sra's dart2js stress test instantly displays with this CL

Some trade offs:

- We get instant tree expand / collapse but scrolling is slower / janky. Need to investigate how to make this fast.

(short term) loss of functionality:

- UI is minimal for now. We don't display the attribute boxes or the InfoBox button.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1833453004 .
2016-03-25 15:02:38 -07:00
John McCutchan ecc6f0a050 Implement MojoSharedBufferGetInformation for Dart
BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org/1809913002 .
2016-03-18 14:09:09 -07:00
Ryan Macnak 366f1f1ed1 Collect samples for background threads.
- Don't tick vm tags for background threads so the Observatory's summary pie chart reflects how the mutator spent its time.
 - Similarly, don't factor background samples in the CPU profile view.
 - Do include background samples in the timeline view.

Use a different event name for background compilations.

Add timeline events for the mark and sweep tasks.

Reload the isolate list when refreshing the timeline view so it includes profile ticks when the page is loading directly (e.g., F5) instead of only after visiting the vm page.

Fix loading the timeline when profiling is disabled.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1814813003 .
2016-03-18 10:18:38 -07:00
Todd Turnidge 0585ef2eca Fix observatory warnings
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1813033002 .
2016-03-18 09:42:36 -07:00
Todd Turnidge 22c37b9516 Improve class-tree, class-view, and instance-view.
class-tree
- Make all the rows have the same height.
- Hide synthetic mixin classes from the tree.
- Show mixin information in a different way.
- Show the total subclass count for each row if non-zero.

class-view
- Display supertype and mixin information

instance-view
- Display typeArguments, parameterizedClass, parameterIndex,
  targetType and bound information for Types.
- Display a source for Types.
- Provide an [eval] link for the runtimeType.

isolate-view
- Display the list of extension rpcs.

Update service.md.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1807263004 .
2016-03-17 12:48:48 -07:00
Ryan Macnak 6eaa45058c Perform a full GC by default when requesting a heap snapshot.
Prevents the snapshot from include objects that are only weakly
reachable.

BUG=http://dartbug.com/25994
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1811713002 .
2016-03-17 11:11:38 -07:00
John McCutchan 08c282bf7d Display source profiling information in Observatory
Depends on https://codereview.chromium.org/1779333004/

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1786703004 .
2016-03-14 12:38:58 -07:00
John McCutchan 32abe2ce55 Stream blocks of timeline events over the service protocol. Can be used to monitor long running programs without buffering all events inside the VM.
- Rename TimelineEventStreamingRecorder to TimelineEventCallbackRecorder. Note that this should only be used for tests.

- Add 'Timeline' service event stream.
- Send a 'TimelineEvents' event on the 'Timeline' stream whenever a TimelineEventBlock is finished and the 'Timeline' stream is subscribed to.

- Simple service protocol test.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1765563002 .
2016-03-04 12:30:50 -08:00
John McCutchan 49dc7e557b Fix some service protocol isolate life cycle races that were discovered by the Flutter testing tool.
Fixes #25902

Issue #1

Assuming --pause-isolates-on-start, there is a window of time after an isolate is made runnable and before it pauses at the first message that we say the isolate is "resumed".

- Fix issue #1 by claiming the isolate is paused on start if it will eventually pause on start.
- Also, handle the resume command for this state by clearing the 'should pause on start' bit.

Issue #2

Before an isolate is made runnable we say the isolate is "resumed".

- Fix issue #2 by introducing a new pause event "None".

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1756393002 .
2016-03-03 11:30:41 -08:00
Todd Turnidge 45ec466ce5 Make getSourceReport public.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1753903003 .
2016-03-02 10:26:27 -08:00
John McCutchan b2249f30fd Add persistent handles to service protocol and Observatory UI
VM Changes:

- Add private _getPersistentHandles service RPC.
- Add service_test for _getPersistentHandles.

Observatory Changes:

- Add Persistent Handles page.
- Display persistent handles in a curly-block
- Display weak persistent handles in a sortable table.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1719313002 .
2016-03-01 07:31:29 -08:00
John McCutchan 003fa8863f Fix analysis bots
BUG=

Review URL: https://codereview.chromium.org/1732303003 .
2016-02-25 12:51:16 -08:00
John McCutchan 5d50f1c64a Fix bots: Only load class if the isolate is runnable.
BUG=

Review URL: https://codereview.chromium.org/1735993002 .
2016-02-25 08:58:04 -08:00
John McCutchan b482480b65 Improve behaviour when we hit a stack overflow / OOM error
Fixes #25815

VM changes:

- Don't crash in SignalExceptionThrown when we have no stack frames.

- Notify the debugger about an unhandled stack overflow / OOM *after* setting the sticky error. This allows Observatory to display it.

- When pausing without a debugger attached, print the sticky error if one is set.

- Improve stack trace frame numbers when printing for a stack overflow.

Observatory changes:

- Report the sticky error for pause at unhandled exception as well as exit.

- Let the user know that we cannot pause for unhandled stack overflow / OOM exceptions.

- Don't show the "at <func> (<script location>)" string in the isolate summary, if we don't have a top frame.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1709383002 .
2016-02-25 07:33:01 -08:00
John McCutchan b39b2c8cfb Add ability to save and load timelines from Observatory
Fixes #25180

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1722373002 .
2016-02-24 09:12:30 -08:00
John McCutchan 7656cedf47 Refactor service tests in preparation of running on sky_shell
- Split service test common helper into separate file.
- Make many tests easier to adapt to line number changes.
- Refactor test launching in preparation of running these tests against sky_shell
- Pass --testee-mode as an environment variable instead of of a command line flag because Flutter applications cannot receive command line arguments.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1726773002 .
2016-02-23 10:51:48 -08:00
John McCutchan 5c8d79c55a Add step OverAwait to service protocol
Additions to service protocol:

- PauseEvent includes an "atAsyncContinuation" boolean value.
- Resume command can take an 'OverAsyncContinuation' step mode.
- Breakpoints have an optional 'isSyntheticAsyncContinuation' boolean value.

Added low level step_over_await_test.

Issuing the OverAsyncContinuation resume command does the following:

- Adds a synthetic breakpoint (#1) to the async closure.
- Resumes the isolate.
- When we hit #1, the VM issues a StepOver and then reports us paused at #1.

At the next resume command, the VM will remove #1.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1699153002 .
2016-02-17 11:02:55 -08:00
John McCutchan cda760915c Add fine grained command line and service protocol control over timeline streams recording
- Add --timeline-streams= flag which takes a comma separated list of streams to record.
- Send "availableStreams" and "recordedStreams" in the _getVMTimelineFlags RPC. Also include the type of recorder we are using.
- Enable setting of "recordedStreams" in the _setVMTimelineFlags RPC.

R=zra@google.com

Review URL: https://codereview.chromium.org/1690333002 .
2016-02-12 13:18:25 -08: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
John McCutchan f2844d77b6 If the VM page fails to load, route to the VM connect page
Fixes #25707

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1678353002 .
2016-02-09 12:21:58 -08:00
John McCutchan ce650790a1 Return an error in many service RPCs if the isolate is not runnable
- Return kIsolateMustBeRunnable error when an isolate must be runnable for a service RPC to complete.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1645423002 .
2016-01-29 11:16:23 -08:00
John McCutchan ec020a301b Improve Observatory debugger behaviour when an isolate exits with unhandled exceptions
- When an isolate is paused at exit and has a sticky error, have the debugger display the error.
- Add --pause-isolates-on-unhandled-exceptions flag which sets a default value for break-on-exception.
- Have the debugger display help text about 'set break-on-exception' and '--pause-isolates-on-unhandled-exceptions'
- Signal an unhandled exception even if no client is connected to Observatory.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1636083002 .
2016-01-26 10:12:46 -08:00
Todd Turnidge 1fdde601da Properly display un-compiled nested functions.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1596563003 .
2016-01-15 15:13:09 -08:00
Todd Turnidge 3bf009d8d3 Make local variables sticky-scroll in debugger frames.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1594603003 .
2016-01-15 15:09:08 -08:00
Todd Turnidge 318db33875 Only show breakpoints at possible breakpoint positions in Observatory.
We now use getSourceReport to get an accurate list of possible
breakpoints rather than relying on inaccurate heuristics.  This means,
for example, that variable declarations will stop being labeled
incorrectly as potential breakpoints.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1590353002 .
2016-01-15 14:56:35 -08:00
Todd Turnidge f23610b3e3 Use getSourceReport for coverage/callsites in Observatory.
Move script reloading into the script inset instead of the navbar.

Make the refresh icon do a sticky-header scroll thing (fancy!).

Remove old coverage code from observatory.

BUG=

Review URL: https://codereview.chromium.org/1584173003 .
2016-01-15 09:18:57 -08:00
Todd Turnidge 97a7db5a71 typo: association -> associations
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1578703003 .
2016-01-12 10:31:47 -08:00
John McCutchan 89c49b9e87 Add dart:developer.postEvent for posting events to the service protocol from Dart code
- Add dart:developer.postEvent for posting events to the service protocol.
- Add 'Extension' service protocol event stream.
- Unit test.
- Update service.md

- Bug fix for logging stream.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1537523002 .
2015-12-17 09:34:52 -08:00
John McCutchan f3ee772308 Provide list of service protocol extensions in isolate and emit an event when one is registered.
- Doc improvements.
- Type annotation improvements.
- Isolate includes list of currently registered extensions.
- New event kind on isolate stream emitted whenever an extension is registered (IsolateServiceExtensionRegistered).

Fixes https://dartbug.com/25208
Fixes https://dartbug.com/25257

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1527793004 .
2015-12-16 13:49:37 -08:00
Ryan Macnak a0e0ac78cb Observatory: Include profiler samples in the timeline view.
- Add pre-isolate service RPC that emits profiler samples in about:tracing format.
 - Make timeline UI automatically merge the event timeline with the sample timelines.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1525913002 .
2015-12-16 10:11:44 -08:00
Todd Turnidge 3a28a1297e Fix line number reporting for unresolved breakpoints.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1524263002 .
2015-12-15 10:08:30 -08:00
Ryan Macnak c44419805c - Display a pseudo-receiver for static function activations.
- Add missing breadcrumbs to class heirarchy, flags and timetime view.
 - Truncate large objects by default so we can look at them without falling over.
 - Demangle local variable names.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1463123002 .
2015-11-24 12:39:43 -08:00
Ryan Macnak 75cd019a9c Add RPC and UI for reachable size of an object / all instances of a class.
BUG=http://dartbug.com/24945
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1453983002 .
2015-11-20 10:02:16 -08:00
Todd Turnidge b9af3683fd Don't unsubscribe to streams we aren't subscribed to.
Gets rid of some stray uncaught exceptions when running Flutter.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1456643002 .
2015-11-17 11:29:39 -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 f1391c7841 Observatory: handle the case where package:foo imports are canonicalized as packages/foo.
BUG=http://dartbug.com/24925
R=floitsch@google.com

Review URL: https://codereview.chromium.org/1447383002 .
2015-11-16 17:55:39 -08:00
Florian Loitsch 31c73aef7c Fix ambigous typos.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1443723004 .
2015-11-16 22:06:44 +01:00
Ryan Macnak 816e665ae1 Use the new Base64 support from dart:convert in Observatory.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1374113006 .
2015-11-13 15:36:27 -08:00