| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_MEMORY_PEAK_DETECTOR_H_ | 5 #ifndef BASE_TRACE_EVENT_MEMORY_PEAK_DETECTOR_H_ |
| 6 #define BASE_TRACE_EVENT_MEMORY_PEAK_DETECTOR_H_ | 6 #define BASE_TRACE_EVENT_MEMORY_PEAK_DETECTOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 enum State { | 42 enum State { |
| 43 NOT_INITIALIZED = 0, // Before Setup() | 43 NOT_INITIALIZED = 0, // Before Setup() |
| 44 DISABLED, // Before Start() or after Stop(). | 44 DISABLED, // Before Start() or after Stop(). |
| 45 ENABLED, // After Start() but no dump_providers_ are available. | 45 ENABLED, // After Start() but no dump_providers_ are available. |
| 46 RUNNING // After Start(). The PollMemoryAndDetectPeak() task is scheduled. | 46 RUNNING // After Start(). The PollMemoryAndDetectPeak() task is scheduled. |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 // Peak detector configuration, passed to Start(). | 49 // Peak detector configuration, passed to Start(). |
| 50 struct Config { | 50 struct Config { |
| 51 Config(); |
| 52 Config(uint32_t polling_interval_ms, |
| 53 uint32_t min_time_between_peaks_ms, |
| 54 bool enable_verbose_poll_tracing); |
| 55 |
| 51 // The rate at which memory will be polled. Polls will happen on the task | 56 // The rate at which memory will be polled. Polls will happen on the task |
| 52 // runner passed to Setup(). | 57 // runner passed to Setup(). |
| 53 uint32_t polling_interval_ms; | 58 uint32_t polling_interval_ms; |
| 54 | 59 |
| 55 // Guarantees that a peak detection callback will never before than the | 60 // Guarantees that a peak detection callback will never before than the |
| 56 // specified amount of time from the last one. | 61 // specified amount of time from the last one. |
| 57 uint32_t min_time_between_peaks_ms; | 62 uint32_t min_time_between_peaks_ms; |
| 58 | 63 |
| 59 // When enabled causes a TRACE_COUNTER event to be injected in the trace | 64 // When enabled causes a TRACE_COUNTER event to be injected in the trace |
| 60 // for each poll (if tracing is enabled). | 65 // for each poll (if tracing is enabled). |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 uint32_t samples_index_; | 177 uint32_t samples_index_; |
| 173 uint32_t poll_tasks_count_for_testing_; | 178 uint32_t poll_tasks_count_for_testing_; |
| 174 | 179 |
| 175 DISALLOW_COPY_AND_ASSIGN(MemoryPeakDetector); | 180 DISALLOW_COPY_AND_ASSIGN(MemoryPeakDetector); |
| 176 }; | 181 }; |
| 177 | 182 |
| 178 } // namespace trace_event | 183 } // namespace trace_event |
| 179 } // namespace base | 184 } // namespace base |
| 180 | 185 |
| 181 #endif // BASE_TRACE_EVENT_MEMORY_PEAK_DETECTOR_H_ | 186 #endif // BASE_TRACE_EVENT_MEMORY_PEAK_DETECTOR_H_ |
| OLD | NEW |