Commit Graph

110 Commits

Author SHA1 Message Date
Ben Konyi b43e89c7f6 [ VM ] Cleanup timeline_test.cc
Updated the timeline cc tests to override Timeline::recorder()
consistently and properly cleanup recorder memory. Fixes some memory
leaks.

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

TEST=timeline_test.cc

Change-Id: I36d69434ec29fa6bf42ffdb06943374b5a412dc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192960
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-03-24 19:46:32 +00:00
Ben Konyi 19b67901f2 [ VM ] Add missing locks in timeline recorder cleanup
Fixes https://github.com/flutter/flutter/issues/78076

Reverts commits ddcb60a3d9 and 3ecbfd927f.

TEST=runtime/vm/timeline_test.cc

Change-Id: I5eeb66e01a1a1b842edf9183fa876fc97e992398
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192500
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2021-03-23 20:05:11 +00:00
Siva Annamalai 3ecbfd927f Revert "[ VM ] Ensure shared timeline objects are protected by locks"
This reverts commit a62e144882.

Reason for revert: Flutter engine shell tests are timing out because of deadlock.

Original change's description:
> [ VM ] Ensure shared timeline objects are protected by locks
>
> Timeline::Clear() could cause an user after free error if trying to allocate a timeline
> event immediately after clearing the timeline buffer.
>
> Timeline::Cleanup() could result in recorder_ being freed while timeline events are still
> being processed.
>
> Should fix https://github.com/flutter/flutter/issues/78076
>
> TEST=tests/lib/developer/timeline_recorders_test.dart
>
> Change-Id: Ia61b9c93986788c79ef6f2ff1907625b66fb4ea1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191802
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: Iac2c19147a3e73df37418e11106f0c5132a35302
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192482
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-03-22 18:06:04 +00:00
Ben Konyi a62e144882 [ VM ] Ensure shared timeline objects are protected by locks
Timeline::Clear() could cause an user after free error if trying to allocate a timeline
event immediately after clearing the timeline buffer.

Timeline::Cleanup() could result in recorder_ being freed while timeline events are still
being processed.

Should fix https://github.com/flutter/flutter/issues/78076

TEST=tests/lib/developer/timeline_recorders_test.dart

Change-Id: Ia61b9c93986788c79ef6f2ff1907625b66fb4ea1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191802
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-03-19 18:47:32 +00:00
Ryan Macnak 1d05591fbb [vm] Produce clearer error messages when operator new fails.
TEST=bots
Bug: https://github.com/dart-lang/sdk/issues/43642
Bug: https://github.com/dart-lang/sdk/issues/43862
Change-Id: I598a26a56762c141a1aef972f7d32f2c9594b244
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171802
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-13 19:07:20 +00:00
pangzhen 9ca9966276 [vm, timeline] Fix compilation failed below macOS 10.14, iOS 12
signpost.h exists in macOS 10.14, iOS 12 or above

This is a reland of 156ef76535

Original change's description:
> [vm, timeline] Fix compilation failed below macOS 10.14
>
> signpost.h exists in macOS 10.14 or above, so compilation failed below macOS 10.14
>
> Change-Id: I97c4d6652f8330d3fc150186e41067c80c3b56f2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151101
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

Cq-Include-Trybots: luci.dart.try:vm-kernel-mac-release-x64-try,dart-sdk-mac-try
Change-Id: I9a810d4a801726dc503d49c40340d25ad575c277
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152780
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-07-02 12:01:49 +00:00
Vyacheslav Egorov 967deb8db4 Revert "[vm, timeline] Fix compilation failed below macOS 10.14"
This reverts commit 156ef76535.

Reason for revert: broke compilation on buildbots

Original change's description:
> [vm, timeline] Fix compilation failed below macOS 10.14
> 
> signpost.h exists in macOS 10.14 or above, so compilation failed below macOS 10.14
> 
> Change-Id: I97c4d6652f8330d3fc150186e41067c80c3b56f2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151101
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,3630cn@sina.com

Change-Id: I04cd72a0c16a9e1d32d1735abf0fe42d35d240e1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151380
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-06-16 07:53:36 +00:00
pangzhen 156ef76535 [vm, timeline] Fix compilation failed below macOS 10.14
signpost.h exists in macOS 10.14 or above, so compilation failed below macOS 10.14

Change-Id: I97c4d6652f8330d3fc150186e41067c80c3b56f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151101
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-06-16 07:15:31 +00:00
Nathan Rogers ff13c4e31a [fuchsia] Avoid unnecessary zx_clock_get(ZX_CLOCK_THREAD, ...) calls
When system tracing is enabled on the Fuchsia platform, avoid calling
|OS::GetCurrentThreadCPUMicros|.  The thread timestamp values are
discarded later, so querying them is wasteful w.r.t. both time and
trace buffer space.

Change-Id: I400075c89e69ddde6b032808859826c95f029008
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149395
Reviewed-by: Siva Annamalai <asiva@google.com>
Auto-Submit: Nathan Rogers <nathanrogers@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-06-03 17:27:41 +00:00
Ben Konyi c9ab5c4681 [ VM / Service ] Added TimelineStreamSubscriptionsChanged event
The `TimelineStreamSubscriptionsChanged` event is sent when
`setVMTimelineFlags` is invoked, notifying `Timeline` subscribers that
the set of recorded timeline streams has changed.

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

Change-Id: Ic1545eefea8cf3deeefba97bd1ea2695d1c35016
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147681
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-05-12 19:22:41 +00:00
Ryan Macnak 8c96812bec [vm, timeline] Remember block creation order instead of sorting in the endless recorder.
Reduces time, and more importantly auxiliary memory, to retrieve the timeline.

Change-Id: I0f87797f6d851d00cc5df0abaf5274693cb95752
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144810
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-04-27 23:42:36 +00:00
Ryan Macnak 6fe15f6df9 [vm] Represent tagged pointers as C++ value types instead of C++ pointer types.
This works around bugs in UndefinedBehaviorSanitizer and Clang.

Bug: b/28638298
Change-Id: I6be595f9664516019d28017d24559583a1ae3a21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144354
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-04-25 05:21:27 +00:00
Nathan Rogers 24480f24b6 [fuchsia] Use lib/ based trace engine paths
Bug: fxb/23054 (PT-193)
Change-Id: I4ab96f25c59b63f3c833a8e4e80dd305f60f8aa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138742
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-10 23:29:18 +00:00
Martin Kustermann dae308461c [vm/concurrency] Share [Heap] and [SharedClassTable] between all isolates within one isolate group
This CL:

  * Moves [Heap]/[SharedClassTable] from [Isolate] to [IsolateGroup], which
    will make all isolates in the group use the same heap. The GC will use
    the shared class table for object size information.

  * Adds support for entering/leaving an isolate group as a helper thread
    (e.g. via [Thread::EnterIsolateGroupAsHelper]). The current active
    isolate group can be accessed via TLS `IsolateGroup::Current()` or
    `Thread::isolate_group_`. When entering as a helper thread there will be
    no current isolate.

  * Changes the GC to use the above mechanism and ensures GC works without
    a currently active isolate. The GC will use information purely available via
    [IsolateGroup]. The GC will iterate all isolates within an isolate
    group e.g. for scanning roots.

  * Makes spawning of new isolates start in their own isolate group.
    Once the isolate is fully functional it's heap will be merged into
    the original isolate group

  * Moves ApiState, containing persistent and weak persistent handles,
    from [Isolate] to [IsolateGroup], plus adds appropriate locking.

Issue https://github.com/dart-lang/sdk/issues/36097

Change-Id: Ia8e1d8aa78750e8400864200f4825395a182c004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126646
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-02-20 21:08:35 +00:00
yuanhuihui 72b0501791 Support timeline conversion to iOS platform trace
using Instruments to track these events.

Signed-off-by: yuanhuihui <gityuan@gmail.com>
Bug: https://github.com/dart-lang/sdk/issues/40076
Change-Id: I590081c516923f82a2a3dbf4b109afe75b8f5fc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131360
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-17 18:10:04 +00:00
Ryan Macnak 5804537b83 [vm, timeline] Following switch from Duration events to Begin-End event pairs, avoid separate native call transitions to query the monotonic and thread clocks.
Bug: https://github.com/dart-lang/sdk/issues/39727
Change-Id: Ie38947c63845f13d660cb4a367681fed31796473
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128564
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-02 23:13:06 +00:00
yuanhuihui fe9f30c389 [timeline] support vm events available to systrace
more detail: https://github.com/dart-lang/sdk/issues/39757

Signed-off-by: yuanhuihui <gityuan@gmail.com>
Bug: https://github.com/dart-lang/sdk/issues/39757
Change-Id: I6174500796289ffcfb7a53d3f897c5d7f82932ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128200
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-12-13 00:41:46 +00:00
Ryan Macnak 98da22a11f [observatory] Display process-wide memory usage with heap snapshots.
Include major memory users known to the VM: isolate heaps, profiling buffers, timeline buffers.

Change-Id: I2580ad74b5d4d07c5c75fde28bb7a5d71fddb09b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127382
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2019-12-07 00:28:15 +00:00
Chris Bracken e41086ef7c [vm] Enable timeline trace events with Fuchsia SDK
Re-enables tracing when built against the public Fuchsia SDK. Was
previously only available on in-tree Fuchsia builds since tracing had
not been exposed in the public SDK.

Change-Id: I54026268f96f762a84c92c24df377249990159a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122081
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-10-18 01:33:03 +00:00
Ryan Macnak f4f0831c69 [vm] Fix TSAN failures related to object headers and GC task phases.
Change-Id: I15078e845712e8e712e2cb0a044fc7550127ea36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120629
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-10-09 21:48:20 +00:00
Ryan Macnak 6b39eb3248 [vm] Remove the 'Profiler' timeline stream.
Accidentially renamed to 'Developer' in 4b6ab33cfa due to confusion between the library 'dart:profiler' and the Fuchsia trace category 'dart:profiler'.

Dead since the removal of _writeCpuProfileTimeline in 68dede011e.

Change-Id: I7ebd9c5e59d8075b424751e155ccd321985d3599
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119086
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-30 16:30:26 +00:00
asiva 4b6ab33cfa [SDK] Reland: Remove dart:profiler library which has been deprecated since Dart 1.2
and remove all references to it in tests and the SDK build scripts.

Change-Id: I728770c460042596ddd14efecdc52bcf0580f592
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117584
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-09-17 23:19:20 +00:00
David Morgan 54b95f1c8b Revert "[SDK] Remove dart:profiler library which has been deprecated since Dart 1.2"
This reverts commit 6f85cb83cf.

Reason for revert: CFE built before this CL breaks with dill built after; it expects dart:profiler to be present in the dill.

Original change's description:
> [SDK] Remove dart:profiler library which has been deprecated since Dart 1.2
>       and remove all references to it in tests and the SDK build scripts.
> 
> Change-Id: I65a4d71b74c66ca090eba28e922e2f70a7b2989d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114965
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

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

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

Change-Id: I5fec5c7aec55377ba5cba0b55a25e67682220276
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115242
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2019-09-03 14:26:26 +00:00
asiva 6f85cb83cf [SDK] Remove dart:profiler library which has been deprecated since Dart 1.2
and remove all references to it in tests and the SDK build scripts.

Change-Id: I65a4d71b74c66ca090eba28e922e2f70a7b2989d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114965
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-08-30 17:03:04 +00:00
Lorenz Nickel 79e478e50e Fixed some links
**I fixed some links and some other minor flaws.**

I also found the following outdated links, which I didn't fix:

- [This link](https://github.com/dart-lang/pool/tree/zone.strong) in [this file](https://github.com/dart-lang/sdk/blob/master/docs/newsletter/20170728.md) (didn't fix because don't know new location and this is some sort of archive so the link should probably stay the original)
- [This link](https://www.dartlang.org/tools/analyzer) in [this file](https://github.com/dart-lang/sdk/blob/master/pkg/analyzer_cli/lib/src/options.dart) (didn't fix since the link is still working, it just gets redirected and the link is part of the programm, I don't want to break anything by changing it, all other links are in comments)
- [This link](https://github.com/domokit/mojo/issues/728) in [this file](https://github.com/dart-lang/sdk/blob/master/build/config/compiler/BUILD.gn) (didn't fix since probably has no new location and is part of TODO, which I don't want to change)

While doing all this I also noticed that [these tests](https://github.com/dart-lang/sdk/tree/master/tests/compiler/dart2js_extra) contain a lot of other inconsistencies in their comments and the location of the import-statements (I only fixed one which was not link-related), could be target of another PR.

Closes #36927
https://github.com/dart-lang/sdk/pull/36927

GitOrigin-RevId: 71d05d0b52d8ec5b92d077a070e066d1fdd4bbfa
Change-Id: Ide4b2424fccad8ae2e06c788efd4443dc0de997b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102222
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2019-07-01 16:21:41 +00:00
Ben Konyi a75ded625e [ VM / Service ] Made VM timeline functionality public through the service API.
Change-Id: I8228f0417047af53edc6f570940d452da3155bbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106061
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-06-19 16:06:12 +00:00
Dan Field e81101e37c [vm, fuchsia] Allow for enabling trace categories through both traceutil and the service protocol.
This is needed so that we can make progress on using flutter drive tests on Fuchsia.

Change-Id: Ifea0e4747c0cf28b85ad5a2eff20bdf361a10be3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104948
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-06-05 21:55:11 +00:00
Chinmay Garde aa64d1d2e6 Allow building Dart with Fuchsia SDK enabled buildroots.
The Fuchsia SDK can now be consumed by non-Fuchsia buildroots to produce
Fuchsia artifacts.

The Fuchsia SDK comes with a JSON manifest that describes the various SDK
"parts". GN targets are stamped for each of these parts. The location of these
GN targets can be configured. That location is set to |fuchsia_sdk_root| in
each buildroot. This variable is defined in //build/fuchsia/sdk.gni in each
buildroot. For buildroots that don't care or know about the Fuchsia SDK, that
file may not exist. This is why, the import of that file is guarded behind
the is_fuchsia flag. When the Fuchsia SDK is enabled, that file will define
values for two required variable |using_fuchsia_sdk| and |fuchsia_sdk_root|.

The first flag defines if the SDK is being used. If unset (but defined), the
builds are in-tree. Eventually we want only SDK builds. |fuchsia_sdk_root|
is set to the spot in the buildroot where the GN targets for the SDK parts
are stamped.

Change-Id: I604612c8d6a21efb07b323610e80b596abc1a6dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101540
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Chinmay Garde <chinmaygarde@google.com>
2019-05-07 00:43:33 +00:00
Ryan Macnak 2c001aacc0 [vm] Address various quirks observed in Fuchsia profiling samples.
- Don't waste time scrubbing or qualifying function metadata names.
 - Don't waste time scrubbing or lib qualifying function names for timeline events.
 - Give intrinsic functions a grace usage counter.
 - Fix wrong flag guarding stack overflow name-based slow paths.

Change-Id: Ib78e7e4f8de51208266190fff2d1f7eb8d80c329
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97174
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-03-19 17:46:08 +00:00
Zach Anderson 8332fb0631 [vm] Adds an API call to dump the CPU profile to the timeline
Used in https://fuchsia-review.googlesource.com/c/topaz/+/258655

Change-Id: I79b102e0d318d7be3bae44fb88f81bb8086a10d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94400
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2019-03-07 21:28:26 +00:00
Ryan Macnak dc555eb9a7 [vm] On Fuchsia, enable timeline streams based on the state of system trace categories.
Allows categories to be selected through arguments to `trace` instead of changing VM flags and rebuilding.

Change-Id: Ia1ec6b58ca0b765c3d675b7d4938acc5f624b768
Reviewed-on: https://dart-review.googlesource.com/c/91860
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-03-01 18:05:40 +00:00
Ryan Macnak d6caaeeebb [vm] Have Dart_TimelineEvent respect SUPPORT_TIMELINE instead of PRODUCT.
Remove unused Dart_GlobalTimelineGetTrace and Dart_SetEmbedderTimelineCallbacks, leftover from the days of Mojo.

Change-Id: Id9ea56734155c9c0ef4f23956e0043dddd5070c0
Reviewed-on: https://dart-review.googlesource.com/c/91768
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-02-05 18:26:05 +00:00
Ryan Macnak 169331abb1 [vm] Misc timeline tweaks.
- Move compiler pass events to a new CompilerVerbose stream
 - Remove serialization phase events
 - Add class name to class finalization event (lost along with finalization events in recent cleanups of finalization)
 - Add event for kernel loading

Change-Id: Ie72bced978400ea174c1551c961baa55c691b019
Reviewed-on: https://dart-review.googlesource.com/c/90883
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-01-25 18:37:05 +00:00
Ryan Macnak 5812a3bf74 [vm] Fix scoping in TIMELINE_DURATION.
Change-Id: I67d53f0e6d17d904b1bebc89bd4d7d45aaf95122
Reviewed-on: https://dart-review.googlesource.com/c/90342
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-01-22 18:38:49 +00:00
Ryan Macnak 06a1e6e9e3 [vm] Enable timeline on Fuchsia even in product mode.
On Fuchsia, the timeline is accessed without involving the service isolate or vm-service.

Change-Id: Ia0d4e1ca252604e8fcef466a31e3d2a8b0912251
Reviewed-on: https://dart-review.googlesource.com/c/90100
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-01-18 00:06:10 +00:00
Ryan Macnak 07f95e7761 Revert "[vm] Enable timeline on Fuchsia even in product mode."
This reverts commit 3f7b371f2c.

Reason for revert: Some modes failing to find new constant?

Original change's description:
> [vm] Enable timeline on Fuchsia even in product mode.
> 
> On Fuchsia, the timeline is accessed without involving the service isolate or vm-service.
> 
> Change-Id: I0d2351dcadcfc47835732235e1b8fafa8212f883
> Reviewed-on: https://dart-review.googlesource.com/c/89880
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com,zra@google.com,asiva@google.com

Change-Id: Ic03a78d14821e0361d54587f1f7510bc9ebfef1c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/89942
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-01-17 00:39:39 +00:00
Ryan Macnak 3f7b371f2c [vm] Enable timeline on Fuchsia even in product mode.
On Fuchsia, the timeline is accessed without involving the service isolate or vm-service.

Change-Id: I0d2351dcadcfc47835732235e1b8fafa8212f883
Reviewed-on: https://dart-review.googlesource.com/c/89880
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-01-16 22:55:51 +00:00
Ben Konyi 07852532e3 [ VM ] Additional cleanup in Dart_Initialize and Dart_Cleanup
Change-Id: I6dc02b3d9de16cc176eb97613bc0c7f0bb9b16eb
Reviewed-on: https://dart-review.googlesource.com/77013
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2018-09-28 23:18:59 +00:00
Ryan Macnak 0d71b8aa40 Revert "[vm] Add a timeline stream for recording the zone high watermark."
This ended up not being helpful, and just makes the timeline harder to read.

This reverts commit 8590919ca6.

Change-Id: I0063dea0c4f6b37bf66a54df9b1c20a73dea40d9
Reviewed-on: https://dart-review.googlesource.com/75209
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-18 17:06:03 +00:00
Ryan Macnak bfb9fae597 [vm] Don't keep events in memory when using systrace/traceutil.
Change-Id: Ic784e1f6c95d1c544958ec5510c168d3d58f50fb
Reviewed-on: https://dart-review.googlesource.com/48820
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-04-02 18:34:35 +00:00
Ryan Macnak 8590919ca6 [vm] Add a timeline stream for recording the zone high watermark.
Change-Id: Ic7f899dbb29eb732b54d7164968a176d7b1025b9
Reviewed-on: https://dart-review.googlesource.com/45544
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-03-16 17:43:27 +00:00
Ryan Macnak 2e12b5f06b [vm] Adjust the relative sizes of the profile and timeline buffers.
In Flutter, the timeline buffer overflows much more quickly than the profile buffer, but usually timeline events are more helpful than profile ticks for understanding performance. This commit trades profile buffer space for timeline event space.

32-bit:
  profile buffer: 12MB -> 6MB
  timeline buffer: 0.5MB -> 2MB

Also increase the default sample depth to better handle Flutter's deep tree walks.

Change-Id: If092047fa89b2b3e57e57370bc435a591497b566
Reviewed-on: https://dart-review.googlesource.com/5903
Reviewed-by: Todd Turnidge <turnidge@google.com>
2017-09-26 22:01:42 +00:00
Ryan Macnak 3d21a46b72 Limit preserialized JSON for timeline events from Dart code to the arguments.
Avoids string copies in C++ and map copies in Dart.

Also remove some vestiages of removed feature that allowed an embedder to add pre-encoded events to the timeline.

Change-Id: I962a67093ba461c991d9169b0391c44af1d489db
Bug: https://github.com/dart-lang/sdk/issues/30787
Reviewed-on: https://dart-review.googlesource.com/6762
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-19 23:29:55 +00:00
Carlo Bernaschina 62045a4590 Add Logical Frame View to Timeline Dashboard
This version of the Timeline allows the developer to see a logical
view over the operations involved in each frame.
Events are grouped by frame and shifted accordingly to avoid to have
overlapped frame.

See runtime/observatory/web/timeline.js for the undestrand the steps
involded in the process.

Change-Id: I3980a3278a32fe69ed70db07cfa7189dc0c9a643
Reviewed-on: https://dart-review.googlesource.com/5603
Commit-Queue: Carlo Bernaschina <cbernaschina@google.com>
Reviewed-by: Todd Turnidge <turnidge@google.com>
2017-09-14 23:53:57 +00:00
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
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
Ryan Macnak 00290c3813 Allocate the fixed-size timeline buffer with virtual memory instead of malloc.
Allows naming the memory region; removes some pressure from jemalloc.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2984313002 .
2017-07-27 13:37:41 -07:00
Zachary Anderson 350ad3a4dc Special-case Timeline.{start,finish}Sync for Fuchsia
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2984603002 .
2017-07-21 08:06:36 -07:00
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Ryan Macnak 5a02f3819b [vm] Support flow events in Dart_TimelineEvent.
Issue https://github.com/dart-lang/sdk/issues/30142

R=zra@google.com

Review-Url: https://codereview.chromium.org/2977663003 .
2017-07-12 10:18:10 -07:00