[tracing] Change outer/inner size representation in memory dumps
commitfadec05e8bbe36e8f3ffc53b95cbd860f14d55ac
authorprimiano <primiano@chromium.org>
Wed, 3 Jun 2015 16:57:32 +0000 (3 09:57 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 3 Jun 2015 16:58:18 +0000 (3 16:58 +0000)
tree3a0a36ee9e6c72342d6feacfb148b1d261a7dd9c
parent236d317f450601fbb56756b0b5ca802659a045f6
[tracing] Change outer/inner size representation in memory dumps

The current dump model expects each dump provider to expose an
outer_size and inner_size, the former being the amount of memory
requested to the system, the latter being the actual size of allocated
objects.
This turned out to be pretty confusing, both for chrome://tracing
users and for Chrome developers that write a dump provider.
Furthermore, this doesn't play well with the upcoming memory graphs
(see crbug.com/492102) where dumps can have ownership/retention
relationships.

This CL is reworking the existing dump providers and switching them to
just one size attribute and express outer/inner (where available) via
nesting, as follows:

BEFORE:
  malloc   outer_size:1024   inner_size:800

AFTER:
  malloc                     size:1024
  malloc/allocated_objects   size:800

Furthermore this CL performs some minor cleanup removing !nullptr
checks to createAllocatorDump() calls. Rationale: dump providers
should only return false to OnMemoryDump when the dump fails for
dumper-related reasons (e.g., the subsystem being dumped was in
a weird state and could not be traversed to generate a dump) and
should just assume that createAllocatorDump() never fails.
It is impossible to enforce that all the dump providers will do
the check and gracefully fail, so there is no point doing such
check at all in any dumper.

BUG=495002

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

Cr-Commit-Position: refs/heads/master@{#332627}
base/trace_event/java_heap_dump_provider_android.cc
base/trace_event/malloc_dump_provider.cc
base/trace_event/malloc_dump_provider.h
base/trace_event/memory_allocator_dump.cc
base/trace_event/memory_allocator_dump.h
base/trace_event/memory_allocator_dump_unittest.cc
base/trace_event/winheap_dump_provider_win.cc
content/browser/gpu/browser_gpu_memory_buffer_manager.cc
content/common/discardable_shared_memory_heap.cc
content/common/gpu/gpu_channel_manager.cc
content/common/host_shared_bitmap_manager.cc