Commit Graph

29 Commits

Author SHA1 Message Date
Martin Kustermann 86fdeab739 [vm] Remove unused --print-benchmarking-metrics flag
This flag doesn't seem to be used anywhere, neither of
dart/flutter/golem/g3.

Main motivation is to remove the GC triggering code in
Isolate::MakeRunnable.

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

Change-Id: If48072f62974dec5f7c19cc08be7904401e38a61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171282
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-11-10 18:41:24 +00:00
Martin Kustermann 518f097266 [vm] Make metrics API expose correct heap metrics in PRODUCT mode
See b/152430908

Change-Id: I89524489ec9868bf5fa40559292e4f82b352cfe3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147362
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-05-09 08:27:48 +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
Ryan Macnak 68d178f223 [vm] Remove FLAG_support_service and FLAG_support_reload, superseded by PRODUCT define.
When these were originally added, we thought we would be able to use them in place of ifdefs and rely on the compiler optimizations and linker GC to remove things. This turned out not to reliably remove what we wanted removed, so we ended up with the ifdefs anyway.

Change-Id: I62e74d60d92b18a688b9dffaf77b1440c10a07ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134402
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-02-04 23:31:17 +00:00
Clement Skau 405bd06725 [VM] Refactors metrics variables to avoid multiple instances per compiled unit.
This moves the definition of the global static VM metric variables
out of the header to avoid defining them multiple times.
This could cause multiple instances which defeats the whole purpose.

Bug: None
Change-Id: Idb8b2da1c2b4591c4824e2bb4b1474437231b3c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98324
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-02 11:49:18 +00:00
Clement Skau a1d61371d3 Exposes VM and Isolate Metrics in the API.
This change allows devs embedding the VM in e.g. a server to e.g. export VM metrics as part of their server health metrics.

Change-Id: I7a86a3ad98b900d30d9b7f5d19fa77f1705610c6
Reviewed-on: https://dart-review.googlesource.com/c/74723
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2018-10-22 13:38:16 +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
Ben Konyi 3c4c62d79a Reland "[VM] Dart_Initialize no longer crashes after Dart_Cleanup"
This is a reland of 519ee905f9

Original change's description:
> [VM] Dart_Initialize no longer crashes after Dart_Cleanup
> 
> Change-Id: I3cfdab9553aad045f024b6f9aec0b40b08234007
> Reviewed-on: https://dart-review.googlesource.com/75786
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

Change-Id: Icdd901bf1ab0b675cc5f1497061a2b7b8a05d956
Reviewed-on: https://dart-review.googlesource.com/76561
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-09-26 17:54:45 +00:00
Ben Konyi b6284b41e3 Revert "[VM] Dart_Initialize no longer crashes after Dart_Cleanup"
This reverts commit 519ee905f9.

Reason for revert: Seeing multiple crashes on Windows

Original change's description:
> [VM] Dart_Initialize no longer crashes after Dart_Cleanup
> 
> Change-Id: I3cfdab9553aad045f024b6f9aec0b40b08234007
> Reviewed-on: https://dart-review.googlesource.com/75786
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

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

Change-Id: I33ad79dbc3fcf44f93612ff63bd2d8431f6067c8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/76342
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-09-25 02:17:37 +00:00
Ben Konyi 519ee905f9 [VM] Dart_Initialize no longer crashes after Dart_Cleanup
Change-Id: I3cfdab9553aad045f024b6f9aec0b40b08234007
Reviewed-on: https://dart-review.googlesource.com/75786
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-09-25 01:20:24 +00: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 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
Zachary Anderson 8d6bc876f0 Reland "Remove fields from Isolate in Product mode"
In my reordering of the fields in Isolate, I omitted the initialization
of a few fields in the constroctor. This CL will reland the change with
the initialization added back.

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

Review-Url: https://codereview.chromium.org/2983403002 .
2017-07-25 13:24:30 -07:00
Zachary Anderson 211604d7a0 Revert "Remove fields from Isolate in Product mode"
This reverts commit 13558442ab.

The above change caused a timeout in a vm test:

FAILED: none-vm-checked release_x64 vm/cc/SafepointTestDart
Expected: Pass
Actual: Timeout
CommandOutput[run_vm_unittest]:
diagnostics: Process list including children: [28397]
    Trying to capture stack trace for pid 28397
    PID 28397 - process
    TID 28397:
    #0  0x00007efedf216404 pthread_cond_wait@@GLIBC_2.3.2
    #1  0x0000000002b9a315 dart::Monitor::WaitMicros(long)
    #2  0x0000000002af3496 dart::MonitorLocker::WaitWithSafepointCheck(dart::Thread*, long)
    #3  0x0000000002a8724d dart::Heap::AllocateOld(long, dart::HeapPage::PageType)
    #4  0x0000000002b07de3 dart::Object::Allocate(long, long, dart::Heap::Space)
    #5  0x0000000002b26eab dart::UnresolvedClass::New(dart::Object const&, dart::String const&, dart::TokenPosition)
    #6  0x0000000002be6358 dart::Parser::ParseType(dart::ClassFinalizer::FinalizationKind, bool, bool, dart::LibraryPrefix*)
    #7  0x0000000002ba9cc4 dart::Parser::ParseNewOperator(dart::Token::Kind)
    #8  0x0000000002bac7dc dart::Parser::ParsePrimary()
    #9  0x0000000002be19c1 dart::Parser::ParsePostfixExpr()
    #10 0x0000000002bdf1c4 dart::Parser::ParseUnaryExpr()
    #11 0x0000000002bb618c dart::Parser::ParseBinaryExpr(int)
    #12 0x0000000002bb869f dart::Parser::ParseConditionalExpr()
    #13 0x0000000002bae224 dart::Parser::ParseExpr(bool, bool)
    #14 0x0000000002bbeb79 dart::Parser::ParseAwaitableExpr(bool, bool, dart::SequenceNode**)
    #15 0x0000000002bd5273 dart::Parser::ParseStatement()
    #16 0x0000000002bbcce0 dart::Parser::ParseStatementSequence()
    #17 0x0000000002ba64e8 dart::Parser::ParseFunc(dart::Function const&, bool)
    #18 0x0000000002ba3e31 dart::Parser::ParseFunction(dart::ParsedFunction*)
    #19 0x00000000029e0725 dart::DartCompilationPipeline::ParseFunction(dart::ParsedFunction*)
    #20 0x00000000029e4898 dart::CompileFunctionHelper(dart::CompilationPipeline*, dart::Function const&, bool, long)
    #21 0x00000000029e5716 dart::Compiler::CompileOptimizedFunction(dart::Thread*, dart::Function const&, long)
    #22 0x0000000002c8d3a4 dart::DRT_StackOverflow(dart::NativeArguments)
    #23 0x00007efedf6ad61b
    TID 28421:
    #0  0x00007efedf2167be pthread_cond_timedwait@@GLIBC_2.3.2
    #1  0x0000000002b9a2ff dart::Monitor::WaitMicros(long)
    #2  0x0000000002cc6f8f dart::ThreadInterrupter::ThreadMain(unsigned long)
    #3  0x0000000002b999d9 dart::ThreadStart(void*)
    #4  0x00007efedf212184 start_thread
    #5  0x00007efede51737d __clone
    TID 28430:
    #0  0x00007efedf216404 pthread_cond_wait@@GLIBC_2.3.2
    #1  0x0000000002b9a315 dart::Monitor::WaitMicros(long)
    #2  0x0000000002af3496 dart::MonitorLocker::WaitWithSafepointCheck(dart::Thread*, long)
    #3  0x0000000002a8789e dart::HeapIterationScope::HeapIterationScope(bool)
    #4  0x0000000002ad4966 dart::Isolate::IterateObjectPointers(dart::ObjectPointerVisitor*, bool)
    #5  0x00000000027ed02a dart::SafepointTestTask::Run()
    #6  0x0000000002cc7cbd dart::ThreadPool::Worker::Loop()
    #7  0x0000000002cc7b6a dart::ThreadPool::Worker::Main(unsigned long)
    #8  0x0000000002b999d9 dart::ThreadStart(void*)
    #9  0x00007efedf212184 start_thread
    #10 0x00007efede51737d __clone
    TID 28431:
    #0  0x00007efedf216404 pthread_cond_wait@@GLIBC_2.3.2
    #1  0x0000000002b9a315 dart::Monitor::WaitMicros(long)
    #2  0x0000000002ad66fa dart::Isolate::ScheduleThread(bool, bool)
    #3  0x0000000002cc53ea dart::Thread::EnterIsolateAsHelper(dart::Isolate*, dart::Thread::TaskKind, bool)
    #4  0x0000000002a86317 dart::SweeperTask::Run()
    #5  0x0000000002cc7cbd dart::ThreadPool::Worker::Loop()
    #6  0x0000000002cc7b6a dart::ThreadPool::Worker::Main(unsigned long)
    #7  0x0000000002b999d9 dart::ThreadStart(void*)
    #8  0x00007efedf212184 start_thread
    #9  0x00007efede51737d __clone
    TID 28444:
    #0  0x00007efedf216404 pthread_cond_wait@@GLIBC_2.3.2
    #1  0x0000000002b9a315 dart::Monitor::WaitMicros(long)
    #2  0x0000000002af3496 dart::MonitorLocker::WaitWithSafepointCheck(dart::Thread*, long)
    #3  0x0000000002a8724d dart::Heap::AllocateOld(long, dart::HeapPage::PageType)
    #4  0x0000000002b07de3 dart::Object::Allocate(long, long, dart::Heap::Space)
    #5  0x0000000002b26eab dart::UnresolvedClass::New(dart::Object const&, dart::String const&, dart::TokenPosition)
    #6  0x0000000002be6358 dart::Parser::ParseType(dart::ClassFinalizer::FinalizationKind, bool, bool, dart::LibraryPrefix*)
    #7  0x0000000002bb19bb dart::Parser::ParseTypeOrFunctionType(bool, dart::ClassFinalizer::FinalizationKind)
    #8  0x0000000002bb204c dart::Parser::ParseFormalParameter(bool, bool, dart::ParamList*)
    #9  0x0000000002bb43b3 dart::Parser::ParseFormalParameters(bool, bool, bool, dart::ParamList*)
    #10 0x0000000002ba368b dart::Parser::ParseFormalParameterList(bool, bool, bool, dart::ParamList*)
    #11 0x0000000002ba5a8f dart::Parser::ParseFunc(dart::Function const&, bool)
    #12 0x0000000002ba3e31 dart::Parser::ParseFunction(dart::ParsedFunction*)
    #13 0x00000000029e0725 dart::DartCompilationPipeline::ParseFunction(dart::ParsedFunction*)
    #14 0x00000000029e4898 dart::CompileFunctionHelper(dart::CompilationPipeline*, dart::Function const&, bool, long)
    #15 0x00000000029e5716 dart::Compiler::CompileOptimizedFunction(dart::Thread*, dart::Function const&, long)
    #16 0x00000000029e7036 dart::BackgroundCompiler::Run()
    #17 0x0000000002cc7cbd dart::ThreadPool::Worker::Loop()
    #18 0x0000000002cc7b6a dart::ThreadPool::Worker::Main(unsigned long)
    #19 0x0000000002b999d9 dart::ThreadStart(void*)
    #20 0x00007efedf212184 start_thread
    #21 0x00007efede51737d __clone
Review-Url: https://codereview.chromium.org/2988703002 .
2017-07-24 14:17:53 -07:00
Zachary Anderson 13558442ab Remove fields from Isolate in Product mode
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2984883002 .
2017-07-24 13:22:44 -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 1688aa810e Add --print-benchmarking-metrics to the VM for Golem.
R=fschneider@google.com, johnmccutchan@google.com, sortie@google.com

Review-Url: https://codereview.chromium.org/2572873003 .
2017-01-31 16:39:19 -08:00
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Siva Annamalai aaa0867567 More changes to use #ifndef PRODUCT ... #endif explicitly instead of relying on compiler magic.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2146713004 .
2016-07-14 11:13:13 -07:00
John McCutchan 2cb555c7dd Have --print-metrics use stderr to work around issue with analyzer_cli
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2148613002 .
2016-07-13 08:52:53 -07:00
John McCutchan d295b9c311 Remove many features when building product mode
Move all JSON printing code from object.cc to object_service.cc.

Not compiled in:

- Service protocol
- Debugger
- Debugger API
- JSONStream
- ObjectIdRing
- Profiler service
- Object JSON printing

Size of dart_bootstrap before: 5670365 bytes
Size of dart_bootstrap after: 5287631 bytes

Reduction in size: 382734 bytes.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1660063002 .
2016-02-05 09:55:51 -08:00
John McCutchan 3abd6ad758 Add max post-gc heap usage metrics
- Add per heap max usage metrics.
- Add combined heap (max) usage metrics.

Fixes #24483

R=koda@google.com

Review URL: https://codereview.chromium.org/1384003004 .
2015-10-07 06:54:56 -07:00
John McCutchan d9297fa72a Add Metrics for heap high water marks
Will be printed at isolate exit when VM launched with: --print-metrics

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

Review URL: https://codereview.chromium.org/1391473002 .
2015-10-06 07:03:24 -07:00
John McCutchan 1015c7f4ff Add --print-metrics vm flag for printing metrics to console
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1303033005 .
2015-08-26 10:05:26 -07:00
John McCutchan b7534facef Include 'fixedId' key when printing service ids
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1157173005
2015-05-26 16:56:31 -07:00
johnmccutchan@google.com 1426cfc03b Port metrics to RPC
R=turnidge@google.com

Review URL: https://codereview.chromium.org//886353006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43486 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 21:27:49 +00:00
iposva@google.com 2ee3263277 - Add and enable concurrent sweeper.
- Keep separate lists for normal sized executable and data pages.

R=koda@google.com

Review URL: https://codereview.chromium.org//503363005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39593 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 13:37:55 +00:00
johnmccutchan@google.com 3299ed4a81 - Add VMMetric and some sample metrics
- Per isolate:

* heap.old.used
* heap.old.capacity
* heap.old.external
* heap.new.used
* heap.new.capacity
* heap.new.external

- VM:

* vm.isolate.count

- New metrics service namespace: /metrics/vm/...

R=koda@google.com

Review URL: https://codereview.chromium.org//464953002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39305 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-15 17:35:00 +00:00