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

Side by Side Diff: base/trace_event/process_memory_dump.h

Issue 1375963007: [tracing] Display the resident size of the discardable memory segments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lock_discardable
Patch Set: Fix mac. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ 5 #ifndef BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_
6 #define BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ 6 #define BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base_export.h" 10 #include "base/base_export.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // ProcessMemoryDump, transferring their ownership to this instance. 113 // ProcessMemoryDump, transferring their ownership to this instance.
114 // |other| will be an empty ProcessMemoryDump after this method returns. 114 // |other| will be an empty ProcessMemoryDump after this method returns.
115 // This is to allow dump providers to pre-populate ProcessMemoryDump instances 115 // This is to allow dump providers to pre-populate ProcessMemoryDump instances
116 // and later move their contents into the ProcessMemoryDump passed as argument 116 // and later move their contents into the ProcessMemoryDump passed as argument
117 // of the MemoryDumpProvider::OnMemoryDump(ProcessMemoryDump*) callback. 117 // of the MemoryDumpProvider::OnMemoryDump(ProcessMemoryDump*) callback.
118 void TakeAllDumpsFrom(ProcessMemoryDump* other); 118 void TakeAllDumpsFrom(ProcessMemoryDump* other);
119 119
120 // Called at trace generation time to populate the TracedValue. 120 // Called at trace generation time to populate the TracedValue.
121 void AsValueInto(TracedValue* value) const; 121 void AsValueInto(TracedValue* value) const;
122 122
123 // Returns the total bytes resident for a memory segment, with given
124 // |start_address| and |mapped_size|. |mapped_size| is specified in bytes. The
125 // value returned is valid only if the given range is currently mmapped by the
126 // process. Returns -1 if counting is not implemented in the current platform.
127 static ssize_t CountResidentBytes(void* start_address, size_t mapped_size);
Primiano Tucci (use gerrit) 2015/10/06 17:14:09 IIRC static methods should be declared before non
ssid 2015/10/07 09:13:19 Done.
128
123 ProcessMemoryTotals* process_totals() { return &process_totals_; } 129 ProcessMemoryTotals* process_totals() { return &process_totals_; }
124 bool has_process_totals() const { return has_process_totals_; } 130 bool has_process_totals() const { return has_process_totals_; }
125 void set_has_process_totals() { has_process_totals_ = true; } 131 void set_has_process_totals() { has_process_totals_ = true; }
126 132
127 ProcessMemoryMaps* process_mmaps() { return &process_mmaps_; } 133 ProcessMemoryMaps* process_mmaps() { return &process_mmaps_; }
128 bool has_process_mmaps() const { return has_process_mmaps_; } 134 bool has_process_mmaps() const { return has_process_mmaps_; }
129 void set_has_process_mmaps() { has_process_mmaps_ = true; } 135 void set_has_process_mmaps() { has_process_mmaps_ = true; }
130 136
131 private: 137 private:
132 void AddAllocatorDumpInternal(MemoryAllocatorDump* mad); 138 void AddAllocatorDumpInternal(MemoryAllocatorDump* mad);
(...skipping 15 matching lines...) Expand all
148 // Keeps track of relationships between MemoryAllocatorDump(s). 154 // Keeps track of relationships between MemoryAllocatorDump(s).
149 std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_; 155 std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_;
150 156
151 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); 157 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump);
152 }; 158 };
153 159
154 } // namespace trace_event 160 } // namespace trace_event
155 } // namespace base 161 } // namespace base
156 162
157 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ 163 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_
OLDNEW
« no previous file with comments | « no previous file | base/trace_event/process_memory_dump.cc » ('j') | base/trace_event/process_memory_dump.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698