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

Side by Side 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 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_TOTALS_H_ 5 #ifndef BASE_TRACE_EVENT_PROCESS_MEMORY_TOTALS_H_
6 #define BASE_TRACE_EVENT_PROCESS_MEMORY_TOTALS_H_ 6 #define BASE_TRACE_EVENT_PROCESS_MEMORY_TOTALS_H_
7 7
8 #include "base/base_export.h" 8 #include "base/base_export.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 10
11 namespace base { 11 namespace base {
12 namespace trace_event { 12 namespace trace_event {
13 13
14 class TracedValue; 14 class TracedValue;
15 15
16 // Data model for process-wide memory stats. 16 // Data model for process-wide memory stats.
17 class BASE_EXPORT ProcessMemoryTotals { 17 class BASE_EXPORT ProcessMemoryTotals {
18 public: 18 public:
19 ProcessMemoryTotals() : resident_set_bytes_(0) {} 19 ProcessMemoryTotals();
20 20
21 // Called at trace generation time to populate the TracedValue. 21 // Called at trace generation time to populate the TracedValue.
22 void AsValueInto(TracedValue* value) const; 22 void AsValueInto(TracedValue* value) const;
23 23
24 // Clears up all the data collected.
25 void Clear();
26
24 uint64 resident_set_bytes() const { return resident_set_bytes_; } 27 uint64 resident_set_bytes() const { return resident_set_bytes_; }
25 void set_resident_set_bytes(uint64 value) { resident_set_bytes_ = value; } 28 void set_resident_set_bytes(uint64 value) { resident_set_bytes_ = value; }
26 29
30 uint64 peak_resident_set_bytes() const { return peak_resident_set_bytes_; }
31 void set_peak_resident_set_bytes(uint64 value) {
32 peak_resident_set_bytes_ = value;
33 }
34
35 // On some platforms (recent linux kernels, see goo.gl/sMvAVz) the peak rss
36 // can be reset. When is_peak_rss_resettable == true, the peak refers to
37 // peak from the previous measurement. When false, it is the absolute peak
38 // since the start of the process.
39 bool is_peak_rss_resetable() const { return is_peak_rss_resetable_; }
40 void set_is_peak_rss_resetable(bool value) { is_peak_rss_resetable_ = value; }
41
27 private: 42 private:
28 uint64 resident_set_bytes_; 43 uint64 resident_set_bytes_;
44 uint64 peak_resident_set_bytes_;
45 bool is_peak_rss_resetable_;
29 46
30 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryTotals); 47 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryTotals);
31 }; 48 };
32 49
33 } // namespace trace_event 50 } // namespace trace_event
34 } // namespace base 51 } // namespace base
35 52
36 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_TOTALS_H_ 53 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_TOTALS_H_
OLDNEW
« 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