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

Issue 2861133002: memory-infra: Move dump level check to observer and rename session state (Closed)

Created:
3 years, 7 months ago by hjd
Modified:
3 years, 7 months ago
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org, danakj+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

memory-infra: Move dump level check to observer and rename session state - Rename session_state to heap_profiler_serialization_state in MemoryDumpManager. - Move IsDumpModeAllowed check from MemoryDumpManager to MemoryTracingObserver. This further decouples MemoryDumpManager from tracing. BUG=703184 Review-Url: https://codereview.chromium.org/2861133002 Cr-Commit-Position: refs/heads/master@{#469721} Committed: https://chromium.googlesource.com/chromium/src/+/b154afcbc07fcd0b31b1c59ef3c6c30c02bed13a

Patch Set 1 #

Patch Set 2 : rebase #

Total comments: 17

Patch Set 3 : update for comments #

Patch Set 4 : rename type #

Total comments: 3

Patch Set 5 : move comment #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+161 lines, -261 lines) Patch
M base/BUILD.gn View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M base/trace_event/heap_profiler_heap_dump_writer.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M base/trace_event/heap_profiler_heap_dump_writer.cc View 1 2 3 2 chunks +6 lines, -5 lines 0 comments Download
M base/trace_event/heap_profiler_heap_dump_writer_unittest.cc View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
A + base/trace_event/heap_profiler_serialization_state.h View 1 2 3 4 chunks +8 lines, -10 lines 0 comments Download
A + base/trace_event/heap_profiler_serialization_state.cc View 1 2 3 1 chunk +5 lines, -15 lines 0 comments Download
M base/trace_event/memory_allocator_dump_unittest.cc View 1 2 3 4 chunks +4 lines, -4 lines 0 comments Download
M base/trace_event/memory_dump_manager.h View 1 2 3 4 5 chunks +13 lines, -14 lines 0 comments Download
M base/trace_event/memory_dump_manager.cc View 1 2 3 7 chunks +37 lines, -49 lines 1 comment Download
M base/trace_event/memory_dump_manager_unittest.cc View 1 2 3 8 chunks +40 lines, -27 lines 0 comments Download
M base/trace_event/memory_dump_session_state.h View 1 2 3 1 chunk +0 lines, -77 lines 0 comments Download
M base/trace_event/memory_dump_session_state.cc View 1 2 3 1 chunk +0 lines, -37 lines 0 comments Download
M base/trace_event/memory_tracing_observer.h View 1 chunk +4 lines, -0 lines 0 comments Download
M base/trace_event/memory_tracing_observer.cc View 1 2 3 4 chunks +16 lines, -0 lines 0 comments Download
M base/trace_event/process_memory_dump.h View 1 2 3 5 chunks +9 lines, -6 lines 0 comments Download
M base/trace_event/process_memory_dump.cc View 1 2 3 3 chunks +6 lines, -3 lines 0 comments Download
M base/trace_event/process_memory_dump_unittest.cc View 1 2 3 1 chunk +8 lines, -8 lines 0 comments Download
M tools/gn/bootstrap/bootstrap.py View 1 2 3 2 chunks +1 line, -1 line 0 comments Download

Messages

Total messages: 25 (13 generated)
hjd
ptal, thanks 😊 https://codereview.chromium.org/2861133002/diff/20001/base/trace_event/memory_dump_manager_unittest.cc File base/trace_event/memory_dump_manager_unittest.cc (right): https://codereview.chromium.org/2861133002/diff/20001/base/trace_event/memory_dump_manager_unittest.cc#newcode1261 base/trace_event/memory_dump_manager_unittest.cc:1261: RegisterDumpProvider(&mdp, ThreadTaskRunnerHandle::Get()); We now need an ...
3 years, 7 months ago (2017-05-05 11:42:28 UTC) #3
Primiano Tucci (use gerrit)
Excellent, although I'd also rename the class (and the file name) in this CL. Just ...
3 years, 7 months ago (2017-05-05 13:38:25 UTC) #4
hjd
Updated to rename type, ptal thanks! https://codereview.chromium.org/2861133002/diff/20001/base/trace_event/memory_dump_manager_unittest.cc File base/trace_event/memory_dump_manager_unittest.cc (right): https://codereview.chromium.org/2861133002/diff/20001/base/trace_event/memory_dump_manager_unittest.cc#newcode166 base/trace_event/memory_dump_manager_unittest.cc:166: pmd->CreateAllocatorDump("example")->AddScalar( On 2017/05/05 ...
3 years, 7 months ago (2017-05-05 14:50:54 UTC) #9
Primiano Tucci (use gerrit)
LGTM thanks https://codereview.chromium.org/2861133002/diff/60001/base/trace_event/memory_dump_manager.h File base/trace_event/memory_dump_manager.h (right): https://codereview.chromium.org/2861133002/diff/60001/base/trace_event/memory_dump_manager.h#newcode222 base/trace_event/memory_dump_manager.h:222: // The trace-global session state. update this ...
3 years, 7 months ago (2017-05-05 15:59:23 UTC) #10
hjd
thanks! https://codereview.chromium.org/2861133002/diff/60001/base/trace_event/memory_dump_manager.h File base/trace_event/memory_dump_manager.h (right): https://codereview.chromium.org/2861133002/diff/60001/base/trace_event/memory_dump_manager.h#newcode222 base/trace_event/memory_dump_manager.h:222: // The trace-global session state. On 2017/05/05 15:59:23, ...
3 years, 7 months ago (2017-05-05 16:10:33 UTC) #13
hjd
+thakis ptal for 2 line change in base/BUILD.gn. Thanks!
3 years, 7 months ago (2017-05-05 16:15:50 UTC) #15
Nico
lgtm
3 years, 7 months ago (2017-05-05 16:19:02 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2861133002/80001
3 years, 7 months ago (2017-05-05 16:59:58 UTC) #19
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/b154afcbc07fcd0b31b1c59ef3c6c30c02bed13a
3 years, 7 months ago (2017-05-05 18:09:55 UTC) #22
ssid
https://codereview.chromium.org/2861133002/diff/80001/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (left): https://codereview.chromium.org/2861133002/diff/80001/base/trace_event/memory_dump_manager.cc#oldcode411 base/trace_event/memory_dump_manager.cc:411: !IsDumpModeAllowed(level_of_detail)) { Hm , if we remove this check ...
3 years, 7 months ago (2017-05-05 18:18:34 UTC) #23
hjd
On 2017/05/05 18:18:34, ssid wrote: > https://codereview.chromium.org/2861133002/diff/80001/base/trace_event/memory_dump_manager.cc > File base/trace_event/memory_dump_manager.cc (left): > > https://codereview.chromium.org/2861133002/diff/80001/base/trace_event/memory_dump_manager.cc#oldcode411 > ...
3 years, 7 months ago (2017-05-08 10:48:36 UTC) #24
Primiano Tucci (use gerrit)
3 years, 7 months ago (2017-05-08 10:59:01 UTC) #25
Message was sent while issue was closed.
On 2017/05/08 10:48:36, hjd wrote:
> On 2017/05/05 18:18:34, ssid wrote:
> >
>
https://codereview.chromium.org/2861133002/diff/80001/base/trace_event/memory...
> > File base/trace_event/memory_dump_manager.cc (left):
> > 
> >
>
https://codereview.chromium.org/2861133002/diff/80001/base/trace_event/memory...
> > base/trace_event/memory_dump_manager.cc:411:
> > !IsDumpModeAllowed(level_of_detail)) {
> > Hm , if we remove this check and also remove is_enabled(on other cl), this
> > optimization cannot be made anymore. ie, if some code requests a detailed
dump
> > when tracing is not enabled, we will only realize that dump was not needed
> after
> > creating a global dump. This brings back the need for is_enabled? or we are
> just
> > going to do the work and ignore it?
> 
> Yep I think so, this shouldn't actually happen often if things are working
> correctly right?

Yeah I agree. having the early check avoids only wasting CPU for something that
we'll drop on the floor at the end. but as hjd@ says, this should be pretty
unlikely to happen, so if we waste some CPU for an unlikely event I think it's
fine.

Powered by Google App Engine
This is Rietveld 408576698