Commit Graph

713 Commits

Author SHA1 Message Date
Carlo Bernaschina 0e32851cfd Add Timeline Dashboard hidden page in Observatory
- Refactoring of the TimelinePage in order to remove the
  dependencies from the Service objects.
- Implemented TimelineRepository to abstract the communication layer
- Structured new TimelineDashboardPage with simplified UI and event
  filtering

The VM returns lists of events which are forwarded to Catapult.
Some events are white-listed for the common user.
Due to limitations in the way the events are generated the only way to
attach the white-list flag to the events is by adding an extra argument.
By setting the hash of timeline.html to #basic we inform JavaScript that
we require the activation of the filter which forwards just the events
white-listed to Captapult, while preserving all the others during
dumping operations.

See https://docs.google.com/document/d/1sDKI3ROYM1ORaKhelt063ayfveF_6WC8aq9MiqHjYBs/edit#

Change-Id: I38435d8d32f37305ce3c366daf55f82e8287959d
Reviewed-on: https://dart-review.googlesource.com/3346
Commit-Queue: Carlo Bernaschina <cbernaschina@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-07 20:38:19 +00:00
Carlo Bernaschina 9f545cd315 Do not combine by default in allocations profile
Change-Id: Idaf9de685f7c0473d4e0a597959e6bca0df6077b
Reviewed-on: https://dart-review.googlesource.com/3823
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-09-07 01:06:44 +00:00
Carlo Bernaschina 36226f722e Restore default tcp port in Observatory
Change-Id: I94174685918c584c8b9f4b0448e5c46bcbfdaa9f
Reviewed-on: https://dart-review.googlesource.com/3360
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-09-05 22:14:27 +00:00
Samir Jindel f0941f7c7d Improve the performance of closure-converted code.
Summary:

Previously, we would create a wrapper function in the flowgraph around converted
closures, which would forward all the closure's arguments and unpack the context
argument before calling the real closure function.

Now, we perform the unpacking at the top of the real function to avoid having
any wrapper function.

Previously, captured parameters would still be appear live to the GC even if
they're updated, because after they are copied into the context, all updates to
them are done there.

Now, as in regular closures, we zero-out the parameter variable after copying
it's value into the context, avoiding potential memory leaks.

Test Plan:

Ran the closure conversion test suite.
Ran benchmarks on Golem -- all statistically significant regressions are gone.

BUG=
R=dmitryas@google.com, regis@google.com

Review-Url: https://codereview.chromium.org/3008923002 .
2017-09-01 14:59:40 +02:00
Carlo Bernaschina 4ea98fba56 Allow port and host override in Observatory
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/3009013002 .
2017-08-31 17:37:40 -07:00
Ryan Macnak b7a0458196 [observatory] Add an "ownership" analysis for the heap snapshot.
An object A is said to be owned by object B if all direct references to A come from B. In particular, an object that holds unshared lists and maps will own the heap size of those lists and maps, as well as any unshared elements. We hope a table of owned sizes will be more useful than a table of shallow sizes, since the latter typically says the heap is mostly lists.

R=cbernaschina@google.com

Review-Url: https://codereview.chromium.org/3009743003 .
2017-08-30 09:50:57 -07:00
Carlo Bernaschina 89e72c7bb5 Hide internal classes from Memory Profile
The Service Protocol exposes a new private RPC _getDefaultClassesAliases
which returns a Map from internal classes to a String.

This Map is used to group internal classes and to avoid navigation to
patch files.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/3003903002 .
2017-08-28 18:18:51 -07:00
Ryan Macnak 48bc6e5d73 Add external sizes to the heap dominator tree.
Fixes #30381

R=cbernaschina@google.com

Review-Url: https://codereview.chromium.org/3008593002 .
2017-08-28 10:54:32 -07:00
Carlo Bernaschina 179b056e47 Restile Observatory memory dashboard
- Better look for the tab buttons
- Removed the term `Isolate`

R=asiva@google.com

Review-Url: https://codereview.chromium.org/3007513002 .
2017-08-24 09:35:25 -07:00
Carlo Bernaschina 463dec5135 Restyle Observatory Memory Dashboard buttons
- More polished button style
- Make Refresh and GC buttons styled as buttons

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2996353002 .
2017-08-22 10:36:18 -07:00
Carlo Bernaschina a21eee5c00 Introduce heap snapshot into Memory Dashboard
In the Memory Dashboard, once an isolate is selected, it is now possible
to see the allocation profile or the heap snapshot.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/3002843002 .
2017-08-18 18:04:40 -07:00
Carlo Bernaschina b87e991af2 Restore "Speedup Observatory elements first time rendering"
The CurlyBlockElement was using a hack to speedup rendering to allow
RetainingPathElement and InboundReferencesElement to pass the tests.

- Removed hack from CurlyBlockElement
- Converted RetainingPathElement and InboundReferencesElement to the
  waitFor APi.

Related https://github.com/dart-lang/sdk/commit/7568ed5f69e384e1832757a6c27d343616626afb

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

Review-Url: https://codereview.chromium.org/2995923002 .
2017-08-18 17:09:02 -07:00
Carlo Bernaschina 66c0fd885a Refactor of Observatory virtual-collection
The virtual-collection component uses a div container as a viewport on
a fixed sized spacer div that emulates the full size of the content.
In the spacer div there is a relative positioned div that scrolls
both horizontally and vertically. While the internal items are fully
computed horizontally, vertically we render just a subset of the items.
This buffer component scrolls both horizontally and vertically due
to its father child relationship with the spacer div. When the viewport
is going to show items that are not rendered in the buffer we move
the buffer accordingly (it is relative positioned with a variable top)
and update the content.

Managing the header of a table though is challenging:
1. we want the header to be fixed vertically
2. we want it to scroll horizontally accordingly to the the rest of the
   content
3. we want also to make this container took into consideration during
   the width computation, to allow it to trigger the horizontal
   scrollbar if it is wider that content.
4. we want the header to perceive the same available space as the
   other items in the collection.

We cannot obtain (1) at the same time of (2) (3) and (4) via pure
CSS. The header must be child of just another element.
- If we make it children of collection itself we obtain just (1) while
  we need to emulate the others via code.
- If we make it children of the viewport we obtain (2) (3) and (4),
  but we need to emulate (1) via code.

The first implementation followed the second option. The side effect
though is that smooth scroll (touch or touchpad based) does not fire
the onScroll events required to keep the header on top fast enough to
avoid flickering.

Due to the fact that scroll is the main use case for this element the
new implementation uses the first approach. Vertical flickering is
a problem no more. We obtain (2) by changing the horizontal offset
of the container, possible flickering, but way less common.
We obtain (3) by adding an extra div in the viewport which has the
same minimum size of the header. We obtain (4) by updating the
width of the last header child during the resize operations.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2998103002 .
2017-08-18 14:33:30 -07:00
Carlo Bernaschina 5f6e3dc5bb Remove dynamic parameters from Observatory helpers
R=bkonyi@google.com

Review-Url: https://codereview.chromium.org/3002763002 .
2017-08-16 17:25:13 -07:00
Carlo Bernaschina 0cbbeeb288 Restore "Add current rss and embedder name to Observatory"
Made benchmark_test.cc independent from Service by using the
implementation of MaxRSS from bin::Process

Related https://github.com/dart-lang/sdk/commit/ce736d3ef009bf334a92d5b7d354fc0b04805b4f

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

Review-Url: https://codereview.chromium.org/2994223002 .
2017-08-14 17:02:30 -07:00
Carlo Bernaschina 8f3fab2f16 Revert "Speedup Observatory elements first time rendering"
This reverts commit 7568ed5f69.

Some observatory_ui tests are broken

TBR=asiva@google.com

Review-Url: https://codereview.chromium.org/2994233002 .
2017-08-14 16:55:31 -07:00
Carlo Bernaschina 7568ed5f69 Speedup Observatory elements first time rendering
R=asiva@google.com, bkonyi@google.com

Review-Url: https://codereview.chromium.org/2995883002 .
2017-08-14 16:04:29 -07:00
Carlo Bernaschina 2f5a59e658 Revert "Add current rss and embedder name to Observatory"
This reverts commit ce736d3ef0.

TBR=zra@google.com

Review-Url: https://codereview.chromium.org/2999933002 .
2017-08-14 15:45:13 -07:00
Carlo Bernaschina ce736d3ef0 Add current rss and embedder name to Observatory
Moved the responsibility to provide MaxRSS and CurrentRSS from the VM to
the embedder.

The embedder can opt-it by setting a Dart_GetEmbedderInformation
callback using the public Dart_SetEmbedderInformationCallback API.

The implementation of the Dart_GetEmbedderInformation should mandatory
fill the version field and the ones it is able to fill.
The name field must reference a constant C style string, it will not be
freed by the VM code.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2996803002 .
2017-08-14 15:22:46 -07:00
Carlo Bernaschina 470749c38c Remove race condition in Observatory memory page
During the computation of the hover labels in the memory dashboard graph
the format functions were reading shared state that can be out of sync
if an update is ongoing.

To fix the error is enough to use the local copies instead.
To prevent this error in the future the format functions now are marked
as static and the analyzer will signal if they are accessing shared state.

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

Review-Url: https://codereview.chromium.org/3002603002 .
2017-08-14 14:39:09 -07:00
Carlo Bernaschina aae9988880 Check service availability on editor repository
The editor repository in Observatory was assuming is some situations the
presence of an openSourceLocation service even if it was not registered.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/3002473002 .
2017-08-14 14:37:46 -07:00
Carlo Bernaschina b7767a92f2 Fix virtual-collection header flickering
On Firefox and probably other browsers the header of the
virtual-collection elements must be updated in the scroll event listener
to avoid the flickering of the screen.

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

Review-Url: https://codereview.chromium.org/2997823002 .
2017-08-14 14:34:29 -07:00
Carlo Bernaschina fb565cfba4 Clear analyzer warning on Observatory
- https://github.com/dart-lang/sdk/commit/f8e47a9e26c9ee44f431ed20d4507d98acbc257d
  Introduced some analyzer warnings into Observatory.

- Added missing forward of the forceFetch parameter

- Removed two abstraction breaks

R=rmacnak@google.com

- Applying TODO
  https://github.com/dart-lang/sdk/blob/ccadb4687c8af4b02a046669b9d50dd52edd1112/runtime/observatory/lib/src/cpu_profile/cpu_profile.dart#L750
Review-Url: https://codereview.chromium.org/2999763002 .
2017-08-11 12:36:32 -07:00
Ryan Macnak f8e47a9e26 Reapply "[vm] Don't enable the profiler by default. Enable the profiler at startup with --observe, or later through Observatory."
Ensure we still start NativeSymbolResolver even if the profiler is off, since it is also used name weak handler finalizer functions and to produce stack traces for crashes.

R=bkonyi@google.com

Review-Url: https://codereview.chromium.org/2992893002 .
2017-08-09 11:20:58 -07:00
Carlo Bernaschina 82e9557aa7 Avoid graph extending outside the drawing area.
In the memory-dashboard page of Observatory the graph is drawn in the
wrong way if the communication with the device is slow.

Related https://github.com/google/charted/issues/219

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2993003002 .
2017-08-03 17:05:02 -07:00
Carlo Bernaschina c6a71098b6 Add memory-dashboard page to Observatory
A new hidden page in observatory that will be used from external IDEs.
This initial version focuses on the evolution of the memory usage in time
and per isolate allocation profile.

Related https://github.com/dart-lang/sdk/issues/30023
Related https://codereview.chromium.org/2990913002/

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2989083002 .
2017-08-03 15:52:23 -07:00
Carlo Bernaschina c39e7d5f5f Fix Observatory virtual-collection layout issues
Virtual Collections especially in the allocation-profile page had some issues with layout and background coloring.

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

Review-Url: https://codereview.chromium.org/2991203002 .
2017-08-02 16:08:22 -07:00
Dmitry Stefantsov eddc456f29 Revert "[vm] Don't enable the profiler by default. Enable the profiler at startup with --observe, or later through Observatory."
This reverts commit cc08f2ddd8.

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2990173002 .
2017-08-02 11:30:16 +02:00
Ryan Macnak cc08f2ddd8 [vm] Don't enable the profiler by default. Enable the profiler at startup with --observe, or later through Observatory.
Note there is no option to disable the profiler. The profiler on Mac, Linux, and Android is based on SIGPROF, and there is no way to wait for all the outstanding signals as required to be able to safely free the sample buffer.

Saves ~20MB on 64-bit VMs.

R=cbernaschina@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2989093002 .
2017-08-01 17:57:08 -07:00
Carlo Bernaschina acfd8a9f81 Fix Observatory double connection in clean browser
If the local storage of the browser is empty observatory connects two
times to the Service Protocol having as side effect the redirection to
the `/vm` page

Closes https://github.com/dart-lang/sdk/issues/30312

R=bkonyi@google.com

Review-Url: https://codereview.chromium.org/2991183002 .
2017-08-01 14:36:21 -07:00
Carlo Bernaschina a67d798841 Update observatory_pub_packages dependency
Updated all observatory dependencies.
In particular charted to 0.4.8

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

Review-Url: https://codereview.chromium.org/2990913002 .
2017-07-31 13:03:35 -07:00
Ryan Macnak 87aaa8bdb3 [observatory] Default sort allocation profiles by size instead of name.
Remove extra asterisk from optimized code references.

R=cbernaschina@google.com

Review-Url: https://codereview.chromium.org/2976903002 .
2017-07-27 15:16:17 -07:00
Alexander Markov bda3c9c2b2 Simplify and fix implicit closure check, speed up Closure_equals, v2
This is the re-application of 44e8da3ecd
with fixes:
* Dartanalyzer error is fixed in the new test isolate/message4_test
* The new test is skipped in the status file in dart2j/non-d8 modes,
  issue #30247 is created.
* Minor tweak of Closure_equals: other.IsClosure() is tested earlier.

Original CL review:

https://codereview.chromium.org/2989493002/

Original CL description:

This CL introduces a new Function kind, kImplicitClosureFunction, in
order to simplify check for implicit closures and make it more
efficient.

This CL also fixes Function::IsImplicitStaticClosureFunction(RawFunction*)
to correctly handle implicit closures created from static native
functions.

Closes #30203.

As the result of a faster check for implicit closures and slight
refactoring of Closure_equals, micro-benchmark exercising Closure_equals
speeds up from 9618ms to 6700ms for implicit closures case and
insignificantly for other cases.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2987703002 .
2017-07-24 09:43:52 -07:00
Alexander Markov 45dddb2807 Revert "Simplify and fix implicit closure check, speed up Closure_equals"
This reverts commit 44e8da3ecd.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2984083002 .
2017-07-21 15:39:20 -07:00
Alexander Markov 44e8da3ecd Simplify and fix implicit closure check, speed up Closure_equals
This CL introduces a new Function kind, kImplicitClosureFunction, in
order to simplify check for implicit closures and make it more
efficient.

This CL also fixes Function::IsImplicitStaticClosureFunction(RawFunction*)
to correctly handle implicit closures created from static native
functions.

Closes #30203.

As the result of a faster check for implicit closures and slight
refactoring of Closure_equals, micro-benchmark exercising Closure_equals
speeds up from 9618ms to 6700ms for implicit closures case and
insignificantly for other cases.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2989493002 .
2017-07-21 14:26:56 -07:00
Carlo Bernaschina 9e8e1d8ac4 Fix Observatory connection to non default VM
BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2988503002 .
2017-07-20 18:06:57 -07:00
Carlo Bernaschina df8bf384eb Introduce external services registration
A new RPC is introduced `_registerService` which allow clients to
register new services that are accessible from all the other clients.

Each registered endpoint is identified by 3 strings:

 - `service`
   a non empty string which identifies the provided service
   (e.g. `HotReload`, `OpenFile`)
 - `alias`
   an alias for that particular endpoint used by clients to identify it
   (e.g. `Flutter`, `IntelliJ`)
 - `method` __generated__
   the RPC method that should be invoked from a client to request it

A new _stream_ `_Service` is introduce, and two related events:

 - `ServiceRegistered`
   which is triggered when a new client is registered.
   All the related information (`service`, `alias`, `method`) are sent.

 - `ServiceUnregistered`
   which is triggered when a client, which previously registered a
   service, disconnects.
   Just `service` and `method` are sent.

Related https://github.com/dart-lang/sdk/issues/30023

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

Review-Url: https://codereview.chromium.org/2980733003 .
2017-07-13 18:18:51 -07:00
Ryan Macnak ccadb4687c [observatory] Sort native allocation profiles by size.
R=bkonyi@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2977803002 .
2017-07-12 12:42:44 -07:00
Carlo Bernaschina 15970f2a7e Fixed synchronization problem in FF and Safari for virtual-tree test
Closes #30087

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2968283002 .
2017-07-07 13:39:46 -07:00
Carlo Bernaschina 992c4aa8ad Restored vm-connect Observatory_UI tests
Closes #27714

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2972133002 .
2017-07-07 13:34:33 -07:00
Carlo Bernaschina 6be07a30bc Avoid Stack Overflows during VirtualTree expansion
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2968813002 .
2017-07-05 17:47:00 -07:00
Carlo Bernaschina fb36c9d5bd Better sorting and naming for TimelinePage Recorded Streams Profiles
Closes=https://github.com/dart-lang/sdk/issues/29275

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2965833002 .
2017-06-30 16:37:23 -07:00
Carlo Bernaschina 3ad0577442 Change Timeline Page presets UI from Select to Buttons
Related=https://github.com/dart-lang/sdk/issues/29275

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2967703003 .
2017-06-30 16:20:19 -07:00
Carlo Bernaschina a8450243eb Disable expansion of VirtualTree and VirtualCollection items
VirtualTree and VirtualCollection must have fixed size children.
Expandable Ref Elements are by default able to expand.
Added flag to disable the expansion when required.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2970443002 .
2017-06-29 16:24:47 -07:00
Ryan Macnak 399ade26aa [observatory] Add a 'GC' button to heap map.
R=cbernaschina@google.com

Review-Url: https://codereview.chromium.org/2953373002 .
2017-06-29 10:45:26 -07:00
Carlo Bernaschina 0d86f5f3c5 Added Editor stream and sendObjectToEditor RPC into Service Protocol
Related=https://github.com/dart-lang/sdk/issues/30023

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2962593002 .
2017-06-29 10:08:12 -07:00
Erik Corry 029b1cb948 Spelling fixes e to i.
R=kevmoo@google.com
BUG=

Review-Url: https://codereview.chromium.org/2957593002 .
2017-06-24 13:41:39 +02:00
Ryan Macnak bcb4fcfa11 [vm-service] Encode ticks directly as integers, since they are expect to stay in JS integer range.
Fixes #29957

R=cbernaschina@google.com

Review-Url: https://codereview.chromium.org/2951803004 .
2017-06-22 09:50:36 -07:00
Carlo Bernaschina 504125071e Fixed interface documentation
BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2941313002 .
2017-06-16 16:27:35 -07:00
Carlo Bernaschina e826fdcb6b Cleaned analysis result for observatory
BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2940523003 .
2017-06-14 12:23:48 -07:00