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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
- 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>
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>
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>
- 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>