Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Issue 2680213002: Updated MallocHooks to collect stack traces when memory is allocated. (Closed)

Created:
3 years, 10 months ago by bkonyi
Modified:
3 years, 10 months ago
Reviewers:
zra, Cutch
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Updated MallocHooks to collect stack traces when memory is allocated. BUG= R=johnmccutchan@google.com, zra@google.com Committed: https://github.com/dart-lang/sdk/commit/47f0da9cd79d41c3f23b03a0f6cc771566e62c78

Patch Set 1 : Rough first patch #

Total comments: 29

Patch Set 2 : Rough patch: addressed initial comments + converted sample filters from using Isolates to Dart_Port… #

Total comments: 15

Patch Set 3 : Addressed prior comments + added code to process and send samples to Observatory #

Patch Set 4 : Updated function name from SetupNativeSample to SetupSampleNative to be consistent with other funct… #

Patch Set 5 : Added comments to dart.cc explaining why MallocHooks is initialized where it is. #

Patch Set 6 : Added tests and modified stack walker to allow for skipping an arbitrary number of frames before co… #

Total comments: 27

Patch Set 7 : Addressed previous comments, removed Linux specific test, added additional stack trace collection t… #

Patch Set 8 : Rebased and performed refactoring #

Total comments: 8

Patch Set 9 : Updated tests, addressed prior comments. #

Total comments: 4

Patch Set 10 : Updated MallocHooks to collect stack traces when memory is allocated. #

Total comments: 8

Patch Set 11 : Addressed comments + added ability to disable stacktrace collection for tests/benchmarks that timeo… #

Total comments: 8

Patch Set 12 : Readded is_native_allocation_sample() and added counter for number of times we fail to capture a na… #

Patch Set 13 : Removed port field from NativeAllocationSampleFilter constructor. #

Total comments: 4

Patch Set 14 : Updated MallocHooks to collect stack traces when memory is allocated. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+690 lines, -226 lines) Patch
M runtime/vm/benchmark_test.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +6 lines, -0 lines 0 comments Download
M runtime/vm/dart.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +14 lines, -1 line 0 comments Download
M runtime/vm/hash_map.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/malloc_hooks.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/malloc_hooks.cc View 1 2 3 4 5 6 7 8 9 10 12 chunks +201 lines, -81 lines 0 comments Download
M runtime/vm/malloc_hooks_test.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +103 lines, -4 lines 0 comments Download
M runtime/vm/malloc_hooks_unsupported.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +19 lines, -2 lines 0 comments Download
M runtime/vm/os.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/vm/os_android.cc View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/vm/os_fuchsia.cc View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/vm/os_linux.cc View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/vm/os_macos.cc View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/vm/os_thread.h View 1 2 3 4 5 6 7 8 9 2 chunks +10 lines, -2 lines 0 comments Download
M runtime/vm/os_win.cc View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/profiler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 12 chunks +29 lines, -15 lines 0 comments Download
M runtime/vm/profiler.cc View 1 2 3 4 5 6 7 8 9 10 11 23 chunks +128 lines, -51 lines 0 comments Download
M runtime/vm/profiler_service.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/profiler_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +44 lines, -10 lines 0 comments Download
M runtime/vm/profiler_test.cc View 1 2 3 4 5 6 7 8 9 52 chunks +57 lines, -56 lines 0 comments Download
M runtime/vm/service.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +24 lines, -0 lines 0 comments Download
M runtime/vm/snapshot_test.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +9 lines, -0 lines 0 comments Download
M runtime/vm/source_report.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 26 (2 generated)
bkonyi
Just looking for some initial comments/suggestions based on what I have so far for the ...
3 years, 10 months ago (2017-02-07 23:10:26 UTC) #2
Cutch
First round of comments https://codereview.chromium.org/2680213002/diff/1/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2680213002/diff/1/runtime/vm/malloc_hooks.cc#newcode127 runtime/vm/malloc_hooks.cc:127: sample_ = Profiler::NativeSampleAllocation(); Naming nit: ...
3 years, 10 months ago (2017-02-08 00:28:54 UTC) #3
bkonyi
https://codereview.chromium.org/2680213002/diff/1/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2680213002/diff/1/runtime/vm/malloc_hooks.cc#newcode127 runtime/vm/malloc_hooks.cc:127: sample_ = Profiler::NativeSampleAllocation(); On 2017/02/08 00:28:53, Cutch wrote: > ...
3 years, 10 months ago (2017-02-08 01:37:05 UTC) #4
zra
Initial comments from first PS. Might be stale. Starting to review most recent PS, now. ...
3 years, 10 months ago (2017-02-08 17:42:55 UTC) #5
zra
This looks headed in the right direction. https://codereview.chromium.org/2680213002/diff/20001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (left): https://codereview.chromium.org/2680213002/diff/20001/runtime/vm/malloc_hooks.cc#oldcode30 runtime/vm/malloc_hooks.cc:30: ASSERT(in_malloc_hook_flag_ != ...
3 years, 10 months ago (2017-02-08 18:14:14 UTC) #6
bkonyi
https://codereview.chromium.org/2680213002/diff/1/runtime/vm/dart.cc File runtime/vm/dart.cc (right): https://codereview.chromium.org/2680213002/diff/1/runtime/vm/dart.cc#newcode235 runtime/vm/dart.cc:235: MallocHooks::InitOnce(); On 2017/02/08 17:42:55, zra wrote: > What's the ...
3 years, 10 months ago (2017-02-09 21:22:47 UTC) #7
bkonyi
I've gone ahead and added tests for what I have so far. Everything is functional ...
3 years, 10 months ago (2017-02-14 23:26:33 UTC) #8
zra
https://codereview.chromium.org/2680213002/diff/100001/runtime/vm/dart.cc File runtime/vm/dart.cc (right): https://codereview.chromium.org/2680213002/diff/100001/runtime/vm/dart.cc#newcode276 runtime/vm/dart.cc:276: MallocHooks::InitOnce(); Maybe add a TODO to separate initialization of ...
3 years, 10 months ago (2017-02-15 05:50:46 UTC) #9
Cutch
https://codereview.chromium.org/2680213002/diff/100001/runtime/vm/dart.cc File runtime/vm/dart.cc (right): https://codereview.chromium.org/2680213002/diff/100001/runtime/vm/dart.cc#newcode235 runtime/vm/dart.cc:235: // MallocHooks can't be initialized until StubCode has been. ...
3 years, 10 months ago (2017-02-15 08:21:01 UTC) #10
bkonyi
https://codereview.chromium.org/2680213002/diff/100001/runtime/vm/dart.cc File runtime/vm/dart.cc (right): https://codereview.chromium.org/2680213002/diff/100001/runtime/vm/dart.cc#newcode235 runtime/vm/dart.cc:235: // MallocHooks can't be initialized until StubCode has been. ...
3 years, 10 months ago (2017-02-16 00:28:29 UTC) #11
zra
https://codereview.chromium.org/2680213002/diff/100001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2680213002/diff/100001/runtime/vm/malloc_hooks.cc#newcode143 runtime/vm/malloc_hooks.cc:143: static const intptr_t kSkipCount = 5; On 2017/02/16 00:28:28, ...
3 years, 10 months ago (2017-02-16 21:45:28 UTC) #12
bkonyi
https://codereview.chromium.org/2680213002/diff/140001/runtime/vm/malloc_hooks_test.cc File runtime/vm/malloc_hooks_test.cc (right): https://codereview.chromium.org/2680213002/diff/140001/runtime/vm/malloc_hooks_test.cc#newcode94 runtime/vm/malloc_hooks_test.cc:94: __declspec(noinline) static uintptr_t GetProgramCounter() { On 2017/02/16 21:45:27, zra ...
3 years, 10 months ago (2017-02-16 22:55:06 UTC) #13
zra
lgtm with nits Also wait for John to approve. In the meantime maybe get a ...
3 years, 10 months ago (2017-02-16 23:15:49 UTC) #14
bkonyi
I've removed the extra includes and started a Golem run. https://codereview.chromium.org/2680213002/diff/160001/runtime/vm/os_thread.h File runtime/vm/os_thread.h (right): https://codereview.chromium.org/2680213002/diff/160001/runtime/vm/os_thread.h#newcode11 ...
3 years, 10 months ago (2017-02-16 23:25:31 UTC) #15
Cutch
https://codereview.chromium.org/2680213002/diff/180001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2680213002/diff/180001/runtime/vm/malloc_hooks.cc#newcode203 runtime/vm/malloc_hooks.cc:203: void Clear() { this should be marked virtual in ...
3 years, 10 months ago (2017-02-21 18:53:35 UTC) #16
bkonyi
I've addressed John's latest comments, but had to make some additional changes to allow for ...
3 years, 10 months ago (2017-02-22 19:12:51 UTC) #17
bkonyi
I've addressed John's latest comments, but had to make some additional changes to allow for ...
3 years, 10 months ago (2017-02-22 19:12:53 UTC) #18
Cutch
https://codereview.chromium.org/2680213002/diff/200001/runtime/vm/profiler.cc File runtime/vm/profiler.cc (right): https://codereview.chromium.org/2680213002/diff/200001/runtime/vm/profiler.cc#newcode1109 runtime/vm/profiler.cc:1109: return NULL; You might want to add some code ...
3 years, 10 months ago (2017-02-22 23:15:56 UTC) #19
bkonyi
https://codereview.chromium.org/2680213002/diff/200001/runtime/vm/profiler.cc File runtime/vm/profiler.cc (right): https://codereview.chromium.org/2680213002/diff/200001/runtime/vm/profiler.cc#newcode1109 runtime/vm/profiler.cc:1109: return NULL; On 2017/02/22 23:15:55, Cutch wrote: > You ...
3 years, 10 months ago (2017-02-23 00:25:20 UTC) #20
bkonyi
3 years, 10 months ago (2017-02-23 00:25:20 UTC) #21
Cutch
https://codereview.chromium.org/2680213002/diff/240001/runtime/vm/profiler.h File runtime/vm/profiler.h (right): https://codereview.chromium.org/2680213002/diff/240001/runtime/vm/profiler.h#newcode492 runtime/vm/profiler.h:492: sample->port() != ILLEGAL_PORT) { there should be no need ...
3 years, 10 months ago (2017-02-23 18:10:25 UTC) #22
bkonyi
https://codereview.chromium.org/2680213002/diff/240001/runtime/vm/profiler.h File runtime/vm/profiler.h (right): https://codereview.chromium.org/2680213002/diff/240001/runtime/vm/profiler.h#newcode492 runtime/vm/profiler.h:492: sample->port() != ILLEGAL_PORT) { On 2017/02/23 18:10:25, Cutch wrote: ...
3 years, 10 months ago (2017-02-23 19:34:17 UTC) #23
Cutch
lgtm LGTM
3 years, 10 months ago (2017-02-23 19:37:28 UTC) #24
bkonyi
3 years, 10 months ago (2017-02-23 20:42:27 UTC) #26
Message was sent while issue was closed.
Committed patchset #14 (id:260001) manually as
47f0da9cd79d41c3f23b03a0f6cc771566e62c78 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698