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
3 // found in the LICENSE file.
5 #ifndef BASE_TRACE_EVENT_PROCESS_MEMORY_TOTALS_H_
6 #define BASE_TRACE_EVENT_PROCESS_MEMORY_TOTALS_H_
8 #include "base/base_export.h"
9 #include "base/basictypes.h"
12 namespace trace_event
{
16 // Data model for process-wide memory stats.
17 class BASE_EXPORT ProcessMemoryTotals
{
19 ProcessMemoryTotals();
21 // Called at trace generation time to populate the TracedValue.
22 void AsValueInto(TracedValue
* value
) const;
24 // Clears up all the data collected.
27 uint64
resident_set_bytes() const { return resident_set_bytes_
; }
28 void set_resident_set_bytes(uint64 value
) { resident_set_bytes_
= value
; }
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
;
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
; }
43 uint64 resident_set_bytes_
;
44 uint64 peak_resident_set_bytes_
;
45 bool is_peak_rss_resetable_
;
47 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryTotals
);
50 } // namespace trace_event
53 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_TOTALS_H_