Commit Graph

124 Commits

Author SHA1 Message Date
John McCutchan d14e50b9c7 More allocation tracing unit tests
- Context allocation unit test.
- Class allocation unit test.
- Adjust behaviour of RecordAllocation when we haven't exited Dart code and we aren't profiling the VM to match the sampler.

R=iposva@google.com

Review URL: https://codereview.chromium.org//1297693003 .
2015-08-20 11:10:37 -07:00
John McCutchan 40fc39ba2a Fix build error in last CL 2015-08-06 14:31:57 -07:00
John McCutchan 09893f7e3b Make sure that profile_vm is turned off when running profiler tests.
BUG=

Review URL: https://codereview.chromium.org//1276053002 .
2015-08-06 14:21:55 -07:00
John McCutchan 286c1722f5 Support profiler code transition tags
- Optionally insert tags when transitioning between unoptimized, optimized, and inlined frames.
- Extend inlined function unit test to verify code transition tags.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//1268803006 .
2015-08-04 15:02:51 -07:00
John McCutchan ef11d0545b Add unit test for CPU profile inline function expansion
- Add unit test for CPU profile inline function expansion.
- Fix missing frame bug in inline function expansion.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1259243005 .
2015-07-29 10:21:36 -07:00
John McCutchan b2bdbfdc1e Fix bad inclusive ticks for functions on release x64
BUG=

Review URL: https://codereview.chromium.org//1264523002 .
2015-07-28 15:18:29 -07:00
John McCutchan 62ada2042c Refactor function tick code and add test
- Make ProfileFunction ticking semantics consistent with ProfileCode.
- Refactor ProfileFunction trie building code.
- Add test for ProfileFunction trees.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1261963002 .
2015-07-28 14:28:44 -07:00
John McCutchan 70a5561cef Fix profiler exclusive code tree node counts
- Add unit tests.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1258783005 .
2015-07-28 11:33:42 -07:00
John McCutchan 3d0b3b6b2b Fix ProfileCode ticking and add unit test
- Fix wrong loop indexer (two i variables...) use when ticking ProfileCode.
- Factor out exclusive / inclusive tick decision into a helper function.
- Adjust ProfileCode::Tick's semantics.
- Add unit test verifying ProfileCode tick semantics.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1260793003 .
2015-07-28 10:21:38 -07:00
John McCutchan 4da11ef37f Test tracing of string allocations
Also, fix a bug in string allocation tracing.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1230063010 .
2015-07-10 14:30:04 -07:00
John McCutchan 13a372eca0 Add forgotten toggle on / off part of typed array allocation test
BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1225343004 .
2015-07-10 14:00:16 -07:00
John McCutchan 01192a2175 Trace typed data allocations
BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1227963004 .
2015-07-10 13:50:55 -07:00
John McCutchan e89b2eeaac Trace allocation of arrays
BUG=
R=fschneider@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//1226143011 .
2015-07-10 13:06:17 -07:00
John McCutchan 598c67001b Update Assembler::TryAllocate to support inline allocation tracing
- Track whether class allocation should be traced in existing ClassHeapStats structure.
- Emit compare and branch at top of ::TryAllocate

These changes appear to be performance neutral.

An alternative approach is to deoptimize all code that inlined allocations for a specific class. I do not think this is a good approach because we will spoil the water- allocations that aren't occurring in the (optimized steady state) running program  will appear in the allocation profile. This will make the data much less actionable bordering on misleading. The approach used in this CL will guarantee the allocation profile aligns with the actual running program.

R=regis@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//1213013002 .
2015-07-10 12:19:01 -07:00
John McCutchan 29dcc3394f Fix expected function names in Profiler_ToggleRecordAllocation test
BUG=

Review URL: https://codereview.chromium.org//1220483002.
2015-06-26 13:15:50 -07:00
John McCutchan 48dfce84b1 Fix allocation stub switching
- When disabling the allocation stub for a class, patch the stub so that the next caller will regenerate the stub.
- Use allocation profiling to test that stub switching and regeneration works.

R=koda@google.com

Review URL: https://codereview.chromium.org//1215773002.
2015-06-26 12:35:54 -07:00
John McCutchan bb934552ea Extend allocation profile testing
- Add ProfileTrieWalker to help with testing.
- Extend allocation profile test to check for expected stack trace.
- Don't inline allocation of class when allocation tracing is enabled.

Dependency: https://codereview.chromium.org/1210333002/

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1210283003.
2015-06-26 12:22:08 -07:00
John McCutchan 26b5b2e95b Introduce mechanism to record an allocation of a class
- 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.
2015-06-24 13:41:12 -07:00
John McCutchan 50842cd27a Add storage of class id and state bit to the profiler's Sample
- 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.
2015-06-23 06:47:39 -07:00
johnmccutchan@google.com d62849f0e8 Rework Sample class
BUG=
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32870 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-20 21:10:07 +00:00
johnmccutchan@google.com 79d3555394 Add flag to control number of stack frames collected by profiler
BUG=
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31924 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-17 16:32:51 +00:00
johnmccutchan@google.com 7da1f4f3ba Build map of code regions and address ticks for profile report.
Profile pauses should be less than 500 ms even when handling 120,000 samples (2 minutes @ 1000 hz).
Code objects are referenced by hex address: "code/cafebabe".
Test for retrieving code objects over the service.
Remove old profile tool scripts. Replaced by dprof (https://github.com/dart-lang/dprof) and Observatory UI for profiler.
Support for stable service refs to implicit closures and dispatcher functions.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31447 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-03 19:55:50 +00:00
johnmccutchan@google.com 919dc2d6eb * Introduce ThreadInterrupter which calls a TLS set callback when thread is interrupted.
* Threads can only register and unregister themselves with ThreadInterrupter.
* Profiler is no longer involved in interrupting threads. It's just a callback and the buffer.
* Profiler operates lock free using an atomic operation to reserve sample in sample buffer.
* Linux, Mac, and Windows done.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31170 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-16 18:52:15 +00:00
johnmccutchan@google.com 97ac18aee9 Sampling profiler
BUG=4350
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30419 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-19 18:26:10 +00:00