Commit Graph

1605 Commits

Author SHA1 Message Date
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 ad280c8c6c Mark issue_30555_test as flaky
TBR=rmacnak@google.com

Review-Url: https://codereview.chromium.org/3011583002 .
2017-08-29 17:50:21 -07:00
Carlo Bernaschina 39f2dce9d5 Fix issue_30555_test with dartk compiler
Related https://github.com/dart-lang/sdk/issues/30555

TBR=rmacnak@google.com

Review-Url: https://codereview.chromium.org/3008833002 .
2017-08-29 14:44:00 -07:00
Carlo Bernaschina cdd3f4f9e5 Restore "Avoid to run dart code during paused_on_exit"
This restores https://github.com/dart-lang/sdk/commit/20066b625a723d0bca4a13afe408e9d6b1442e0e
That was reverted in https://github.com/dart-lang/sdk/commit/ea3526344ae8460ea50cd73b94904eddda816182
Related https://github.com/dart-lang/sdk/issues/30555

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/3006743003 .
2017-08-29 13:02:09 -07:00
Carlo Bernaschina ea3526344a Revert "Avoid to run dart code during paused_on_exit"
This reverts commit 20066b625a.

TBR=asiva@google.com

Review-Url: https://codereview.chromium.org/3011563002 .
2017-08-29 12:14:58 -07:00
Carlo Bernaschina 20066b625a Avoid to run dart code during paused_on_exit
When a MessageHandler gets to the paused_on_exist state it should just handle service events.

If ports are open though, at the next message the isolate will consider itself still alive and handle any kind of request.

The MessageHandler is now checking for its paused_on_exit state and avoid to handle normal messages in that state.

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

R=asiva@google.com

Review-Url: https://codereview.chromium.org/3010503002 .
2017-08-29 11:14:59 -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
Jens Johansen 656b495df8 Mark service test as runtime error
Snapshots don't include source and generated source is not 1-to-1.
The column offset is off for this test.

BUG=

Review-Url: https://codereview.chromium.org/3011493002 .
2017-08-28 12:26:25 +02:00
Jens Johansen 1ad24e4b46 [kernel] Add offset to SwitchContinueStatement; add debugging test
BUG=
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/3004693002 .
2017-08-28 12:01:03 +02:00
Carlo Bernaschina cf4cc1973a Refactor Isolate name format, storage and log
At the moment isolated has a name field which is on the main_port the
only exception is the vm-service isolate.
The name is used just for logging.

The service protocol though uses an extra field called debugger_name,
that at this moment is redundant and is optimized away during
compilation.

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

This CL:
- Removes the debugger_name in favor of a modifiable name
- Adds to all the log where the name was logged the main_port (that is
  the only real identifier)
- Changes the default format of the isolate name from:
    <script_uri>$<main>
  to:
    <script_uri>:<main>()
Review-Url: https://codereview.chromium.org/3004563003 .
2017-08-25 18:07:03 -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 e673ff0b25 Update observatory_sources.gni
TBR=asiva@google.com

Review-Url: https://codereview.chromium.org/3003463002 .
2017-08-18 18:11:43 -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
Zachary Anderson 734beef062 [infra] Translate _sources.gypi files to _sources.gni files
Also deletes code that becomes dead as a result.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2996903002 .
2017-08-14 21:54:36 -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 d340f75e15 Fix wrong reference to cpu_profile.dart
TBR=asiva@google.com

Review-Url: https://codereview.chromium.org/3000833002 .
2017-08-11 13:13:31 -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
William Hesse fd7dc64a1c Update observatory tests with test path to webcomponents-lite.
BUG=
R=cbernaschina@google.com

Review-Url: https://codereview.chromium.org/2995733003 .
2017-08-10 18:45:52 +02: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
Zach Anderson 0394d3a0cf [infra] Begin removing gyp
This CL begins removing gyp from Dart's tree.

Removing gyp will go in three stages:
1. Remove unused .gyp and .gypi files.
2. Translate *_sources.gypi files to *_sources.gni files
3. Remove //third_party/gyp from DEPS

This CL is stage 1.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2992593002 .
2017-08-04 22:19:35 -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
Zachary Anderson 633ed4cf83 [corelib] dart:developer timeline flow events
This change adds an API to dart:developer Timeline for
adding flow events to the timeline. For details see the
changes in:

sdk/lib/developer/timeline.dart

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2985253002 .
2017-07-31 07:46:52 -07:00
Carlo Bernaschina c78e6ba70c Fix allocation profile test
The test was broken by https://github.com/dart-lang/sdk/commit/87aaa8bdb3cc36620992c06781194191d58fb18b
which changed the default sorting column

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2990953002 .
2017-07-28 10:41:08 -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
Diogenes Nunez ced696af69 Calculates retaining paths through user fields and ignores VM objects
before reporting a path that goes through VM objects.

When a user attempts to check the retaining path of an instance of a
class, previously Observatory would report the first path found, even
if the path contains multiple VM objects.

Now, Observatory will attempt to find a path through the user fields and
ignores all VM objects aside from said fields. If that fails, it
defaults to the original algorithm.

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

Review-Url: https://codereview.chromium.org/2990643002 .
2017-07-27 13:24:48 -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
Bob Nystrom 012774c78e Remove Dartium support from test.dart.
R=whesse@google.com

Review-Url: https://codereview.chromium.org/2981223002 .
2017-07-20 12:46:50 -07:00
Siva Chandra cf07adc873 Allow setting breakpoints in function literal field initializers under --dfe.
The change 3b9cf7351b fixed #29581 for the
case when --dfe is not used. This change fixes the issue for the --dfe
configuration as well.

Tests which now pass have been taken out of the status files.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2979163002 .
2017-07-19 13:17:25 -07:00
Vyacheslav Egorov c6815e8522 Reapply 0489249d29 with a fix for front_end tests.
Proper sequencing of _asyncStackTraceHelper in Kernel

This helper function was being called before its argument was
initialized so it was passing null.  Instead, it should be called
after its argument is initialized.

Because the initialization happens in Kernel code, it is simplest to
insert the call explicitly in Kernel code as well as part of the async
transformation.  This has the consequence that we now call the helper
function even when the flag causal_async_stacks is false.

Fixes issue #29771.
Fixes issue #30178
Fixes issue #30058

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

Review-Url: https://codereview.chromium.org/2936793003 .
Review-Url: https://codereview.chromium.org/2982943002 .
2017-07-17 20:56:28 +02:00