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

Unified Diff: base/trace_event/process_memory_totals.h

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: base/trace_event/process_memory_totals.h
diff --git a/base/trace_event/process_memory_totals.h b/base/trace_event/process_memory_totals.h
index 29c94c9aaccb6cc60bcc0d092c4bcbc52d938eff..1bf8bdcd7b49698d12aed051a675dfad12df4a49 100644
--- a/base/trace_event/process_memory_totals.h
+++ b/base/trace_event/process_memory_totals.h
@@ -16,16 +16,33 @@ class TracedValue;
// Data model for process-wide memory stats.
class BASE_EXPORT ProcessMemoryTotals {
public:
- ProcessMemoryTotals() : resident_set_bytes_(0) {}
+ ProcessMemoryTotals();
// Called at trace generation time to populate the TracedValue.
void AsValueInto(TracedValue* value) const;
+ // Clears up all the data collected.
+ void Clear();
+
uint64 resident_set_bytes() const { return resident_set_bytes_; }
void set_resident_set_bytes(uint64 value) { resident_set_bytes_ = value; }
+ uint64 peak_resident_set_bytes() const { return peak_resident_set_bytes_; }
+ void set_peak_resident_set_bytes(uint64 value) {
+ peak_resident_set_bytes_ = value;
+ }
+
+ // On some platforms (recent linux kernels, see goo.gl/sMvAVz) the peak rss
+ // can be reset. When is_peak_rss_resettable == true, the peak refers to
+ // peak from the previous measurement. When false, it is the absolute peak
+ // since the start of the process.
+ bool is_peak_rss_resetable() const { return is_peak_rss_resetable_; }
+ void set_is_peak_rss_resetable(bool value) { is_peak_rss_resetable_ = value; }
+
private:
uint64 resident_set_bytes_;
+ uint64 peak_resident_set_bytes_;
+ bool is_peak_rss_resetable_;
DISALLOW_COPY_AND_ASSIGN(ProcessMemoryTotals);
};
« no previous file with comments | « base/trace_event/process_memory_maps_dump_provider_unittest.cc ('k') | base/trace_event/process_memory_totals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698