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>
Revert "Revert "Fixed issue in MallocHooks where a MallocHookScope was accidentally removed during a merge, causing a deadlock in the hooks. Also turned off stack trace collection in a test that was timing out as a result of the stack trace collection.""
This reverts commit 1a5b555aa9.
BUG=
R=zra@google.com
Review-Url: https://codereview.chromium.org/2711353003 .
Install a signal handler in the standalone VM that dumps a backtrace
similar to what we already do on assertion failures.
For now only Linux and MacOS are supported.
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org/2514113002 .
We have a racy read of the object header in the stack frame walker
called from the profiler (in this case the gc marker is running at
the same time).
It is appropriate to avoid this even though we think the access is
safe as the objects are in old space and never forwarded and only
the mark bits are manipulated while marking
BUG=
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/2517473002 .
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER
This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.
R=asiva@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/2450713004 .
For code objects, don't allocate symbol strings when printing the disassembly.
Don't try to make disassembling work with background compilation -- instead make sure that we don't allocate on the Dart heap while disassembling.
Add NoSafepointScope around disassemble functions to assert that no allocation happens.
Also, remove some dead code from object.cc.
BUG=#27430
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2363413004 .
The call sequence is very similar to a classic IC call, except the guarded class and the target are loaded indirectly from the constant pool instead of as immediates. In the monomorphic case, we call directly to the expected target with a class check in the callee. In the unlinked, polymorphic and megamorphic cases, we call a stub; these case are now call-through instead of call-and-return.
Every code, except stubs involved in switchable calls, includes the class check sequence at the beginning. So we now distinguish between a checked and an unchecked entry point. Generated code except the switchable call continues to use the unchecked entry point.
PC offsets are calculated relative to the beginning of the instruction stream, rather than either entry point.
BUG=
R=fschneider@google.com
Review URL: https://codereview.chromium.org/2226893002 .
- [x] Count the reasons why we don't walk the stack.
- [x] Count the reasons why we only sample a single frame.
- [x] Count the stack walkers used.
These counters are returned as part of the profile over the vm-service and can be used to debug profiler failures in the future.
R=fschneider@google.com
Review URL: https://codereview.chromium.org/2183993007 .
- Don't tick vm tags for background threads so the Observatory's summary pie chart reflects how the mutator spent its time.
- Similarly, don't factor background samples in the CPU profile view.
- Do include background samples in the timeline view.
Use a different event name for background compilations.
Add timeline events for the mark and sweep tasks.
Reload the isolate list when refreshing the timeline view so it includes profile ticks when the page is loading directly (e.g., F5) instead of only after visiting the vm page.
Fix loading the timeline when profiling is disabled.
BUG=
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1814813003 .
in these blocks will not have a safepoint operation
- changed boxed_field_list_monitor_ to boxed_field_list_mutex_ as we only
need a mutex for guarding access to boxed_field_list_ as changed the
lock to use SafepointMutexLocker as the list addition code could potentially
allocate and result in GC (safepoint operation)
- Added a SafepointMonitorLocker as we have a function Isolate::VisitIsolates
which could potentially have safepoints in the enclosed block.
- Make the lock around MegamorphicCacheTable::Lookup a SafepointMutexLocker
as the look up code seems to be allocating memory while the lock is held.
- Changed the ThreadPool and MessageHandler code to account for the new
MonitorLocker usage standard
- Fixed PortMap::PrintPortsForMessageHandler to use SafepointMutexLocker as
the code it encloses calls into Dart
- Removed profiler_ field in class Profiler as it doesn't seem to be used.
R=johnmccutchan@google.com, srdjan@google.com
Review URL: https://codereview.chromium.org/1748953003 .
- Assign correct timestamps for timeline events from Dart code.
- Support optional 'timeOriginMicros' and 'timeExtentMicros' to _getVMTimeline service RPC.
- Relax time extent check in profiler.
R=asiva@google.com
Review URL: https://codereview.chromium.org/1533323004 .
- Do one eager pass over both the vm and current isolate's heaps to populate the live code table instead of lazily sampling the heap for code objects.
- Remove Instructions -> Code pointer
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1435533003 .
- API breakage: Dart_IsolateBlocked, Dart_IsolateUnblocked -> Dart_ThreadDisableProfiling, Dart_ThreadEnableProfiling.
- Remove IsolateProfilerData.
- Move thread at blocking call count from isolate to thread.
- Always interrupt threads unless they are blocked.
- We can no longer count "idle" ticks.
- Only record sample if thread is the current mutator of an isolate.
- Refactor ThreadInterrupterCallback to ensure that Thread* is valid.
Threads are only ever sent signals if ThreadInterruptsEnabled is true. Which is controlled by two functions:
void DisableThreadInterrupts();
void EnableThreadInterrupts();
R=asiva@google.com, iposva@google.com
Review URL: https://codereview.chromium.org/1423473004 .
- API breakage: Dart_IsolateBlocked, Dart_IsolateUnblocked -> Dart_ThreadDisableProfiling, Dart_ThreadEnableProfiling.
- Remove IsolateProfilerData.
- Move thread at blocking call count from isolate to thread.
- Always interrupt threads unless they are blocked.
- We can no longer count "idle" ticks.
- Only record sample if thread is the current mutator of an isolate.
- Refactor ThreadInterrupterCallback to ensure that Thread* is valid.
Threads are only ever sent signals if ThreadInterruptsEnabled is true. Which is controlled by two functions:
void DisableThreadInterrupts();
void EnableThreadInterrupts();
R=asiva@google.com, iposva@google.com
Review URL: https://codereview.chromium.org/1412733008 .
- Add continuation_index field to profiler sample.
- Add bit to tell if a sample is the head of a chain.
- Add bit to tell if a sample has a chained sample.
- Each sample holds 8 frames.
- Collect up to 8 frames (1 sample) by default.
- Refactor stack walker code to support chaining during stack walking.
- Add unit test collecting 20 stack frames.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1270003002 .
- Use a bit in RawClass to remember if we are tracing allocation for this class.
- Add Profiler::RecordAllocation
- Add a simple heartbeat test for Profiler::RecordAllocation
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//1211633002.
- Introduce ProcessedSample and ProcessedSampleBuffer
- Visit SampleBuffer *once* and build ProcessedSampleBuffer
- Stop altering the SampleBuffer when processing samples
- Beginning of support for chained samples
- Use ProcessedSampleBuffer instead of SampleBuffer for all passes in the ProfilerService. More cleanups here will follow.
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//1202943002.
- Stop storing sp and fp in Sample. Both are not used after the stack walk
- Add AllocationSample bit to Sample's state_
- Add a metadata_ field to Sample
- Use metadata_ to store a class id when AllocationSample bit is set
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//1199473003.