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

Issue 1419633004: [Tracing] Introduce HeapDumpWriter helper class (Closed)

Created:
5 years, 2 months ago by Ruud van Asseldonk
Modified:
5 years, 1 month ago
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org, vmpstr+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Tracing] Introduce HeapDumpWriter helper class The heap profiler in chrome://tracing keeps track of allocations in an |AllocationRegister|. When a heap dump is requested, a summary of the allocation register should be written to the trace log. (It is not possible to dump every single allocation, some processes have peeks as high as 400k outstanding allocations.) The |HeapDumpWriter| class analyzes all allocations and writes a condensed heap dump to the trace log. At the moment the logic is very simple. All allocations are grouped by backtrace, and the number of bytes allocated per backtrace is written. In the future this will be extended with the ability to group by different pieces of context. Furthermore, a smarter algorithm can be introduced that writes as much information as possible given a fixed budget of trace log space. The heap dump writer is designed to be independent of the |StackFrameDeduplicator|. There could be a deduplicator per dump provider, or a global deduplicator. By taking it as an argument, the dumper works either way. BUG=524631 Committed: https://crrev.com/51d9e66be7968f1b8844f44effe066708a0536d6 Cr-Commit-Position: refs/heads/master@{#356282}

Patch Set 1 #

Patch Set 2 : Mark Backtrace as BASE_EXPORT #

Patch Set 3 : Work around VS2013 compiler bug #

Patch Set 4 : Cast literal to ensure correct type inference + small cleanup #

Patch Set 5 : Remove WriteStackFrames, DISALLOW_COPY_AND_ASSIGN #

Total comments: 31

Patch Set 6 : Address primiano comments #

Total comments: 20

Patch Set 7 : Renames for trace log format #

Patch Set 8 : Address primiano comments #

Total comments: 8

Patch Set 9 : Address nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+276 lines, -47 lines) Patch
M base/trace_event/BUILD.gn View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M base/trace_event/memory_profiler_allocation_context.h View 1 2 3 4 5 6 7 8 4 chunks +33 lines, -21 lines 0 comments Download
M base/trace_event/memory_profiler_allocation_context.cc View 1 2 3 4 5 6 7 8 5 chunks +35 lines, -17 lines 0 comments Download
M base/trace_event/memory_profiler_allocation_context_unittest.cc View 3 chunks +5 lines, -9 lines 0 comments Download
A base/trace_event/memory_profiler_heap_dump_writer.h View 1 2 3 4 5 6 7 8 1 chunk +71 lines, -0 lines 0 comments Download
A base/trace_event/memory_profiler_heap_dump_writer.cc View 1 2 3 4 5 6 7 8 1 chunk +100 lines, -0 lines 0 comments Download
M base/trace_event/process_memory_dump.h View 1 2 3 4 5 4 chunks +11 lines, -0 lines 0 comments Download
M base/trace_event/process_memory_dump.cc View 1 2 3 4 5 6 4 chunks +17 lines, -0 lines 0 comments Download
M base/trace_event/trace_event.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (4 generated)
Ruud van Asseldonk
5 years, 2 months ago (2015-10-20 15:57:55 UTC) #2
Primiano Tucci (use gerrit)
I think this patch needs a rebase? I had deja-vus while reviewing this, in fact ...
5 years, 2 months ago (2015-10-22 14:41:01 UTC) #3
Ruud van Asseldonk
On 2015/10/22 14:41:01, Primiano Tucci wrote: > I think this patch needs a rebase? > ...
5 years, 2 months ago (2015-10-22 14:49:08 UTC) #4
Ruud van Asseldonk
On 2015/10/22 14:49:08, Ruud van Asseldonk wrote: > On 2015/10/22 14:41:01, Primiano Tucci wrote: > ...
5 years, 2 months ago (2015-10-22 14:51:03 UTC) #5
Primiano Tucci (use gerrit)
Awesome. The more I review your code the more I see all the pieces coming ...
5 years, 1 month ago (2015-10-26 11:52:07 UTC) #6
Ruud van Asseldonk
https://codereview.chromium.org/1419633004/diff/80001/base/trace_event/memory_profiler_allocation_context.cc File base/trace_event/memory_profiler_allocation_context.cc (right): https://codereview.chromium.org/1419633004/diff/80001/base/trace_event/memory_profiler_allocation_context.cc#newcode32 base/trace_event/memory_profiler_allocation_context.cc:32: return SuperFastHash(reinterpret_cast<const char*>(backtrace.frames), On 2015/10/26 11:52:06, Primiano Tucci wrote: ...
5 years, 1 month ago (2015-10-26 14:51:27 UTC) #7
Primiano Tucci (use gerrit)
LGTM with comments addressed https://codereview.chromium.org/1419633004/diff/80001/base/trace_event/memory_profiler_allocation_context.cc File base/trace_event/memory_profiler_allocation_context.cc (right): https://codereview.chromium.org/1419633004/diff/80001/base/trace_event/memory_profiler_allocation_context.cc#newcode32 base/trace_event/memory_profiler_allocation_context.cc:32: return SuperFastHash(reinterpret_cast<const char*>(backtrace.frames), On 2015/10/26 ...
5 years, 1 month ago (2015-10-26 20:57:57 UTC) #9
Primiano Tucci (use gerrit)
Ah also, memory_profiler_allocation_context.h will need some cleanup at some point.
5 years, 1 month ago (2015-10-26 20:58:11 UTC) #10
Ruud van Asseldonk
Addressed comments. Can you please have a look at the changes in |HeapDumpWriter| Primiano? On ...
5 years, 1 month ago (2015-10-27 10:50:18 UTC) #11
Primiano Tucci (use gerrit)
LGTM with some final nits. Would be nice to cover these new changes to ProcessMemoryDump ...
5 years, 1 month ago (2015-10-27 11:56:20 UTC) #12
Ruud van Asseldonk
https://codereview.chromium.org/1419633004/diff/140001/base/trace_event/memory_profiler_allocation_context.cc File base/trace_event/memory_profiler_allocation_context.cc (right): https://codereview.chromium.org/1419633004/diff/140001/base/trace_event/memory_profiler_allocation_context.cc#newcode76 base/trace_event/memory_profiler_allocation_context.cc:76: void DestructAllocationContextTracker(void* alloc_ctx_tracker) { On 2015/10/27 11:56:20, Primiano Tucci ...
5 years, 1 month ago (2015-10-27 11:59:31 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1419633004/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1419633004/160001
5 years, 1 month ago (2015-10-27 12:00:36 UTC) #16
commit-bot: I haz the power
Committed patchset #9 (id:160001)
5 years, 1 month ago (2015-10-27 13:20:19 UTC) #17
commit-bot: I haz the power
5 years, 1 month ago (2015-10-27 13:21:30 UTC) #18
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/51d9e66be7968f1b8844f44effe066708a0536d6
Cr-Commit-Position: refs/heads/master@{#356282}

Powered by Google App Engine
This is Rietveld 408576698