| Index: base/trace_event/memory_dump_provider.h
|
| diff --git a/base/trace_event/memory_dump_provider.h b/base/trace_event/memory_dump_provider.h
|
| index c899ea9c3464f9bda11c4f2918425227f2c312d6..244319efa7b7996c4b45e399028886cc3e61ee06 100644
|
| --- a/base/trace_event/memory_dump_provider.h
|
| +++ b/base/trace_event/memory_dump_provider.h
|
| @@ -22,7 +22,8 @@ class BASE_EXPORT MemoryDumpProvider {
|
| struct Options {
|
| Options()
|
| : target_pid(kNullProcessId),
|
| - dumps_on_single_thread_task_runner(false) {}
|
| + dumps_on_single_thread_task_runner(false),
|
| + is_fast_polling_supported(false) {}
|
|
|
| // If the dump provider generates dumps on behalf of another process,
|
| // |target_pid| contains the pid of that process.
|
| @@ -34,6 +35,11 @@ class BASE_EXPORT MemoryDumpProvider {
|
| // a SingleThreadTaskRunner, which is usually the case. It is faster to run
|
| // all providers that run on the same thread together without thread hops.
|
| bool dumps_on_single_thread_task_runner;
|
| +
|
| + // Set to true if the dump provider implementation supports high frequency
|
| + // polling. Only providers running without task runner affinity are
|
| + // supported.
|
| + bool is_fast_polling_supported;
|
| };
|
|
|
| virtual ~MemoryDumpProvider() {}
|
| @@ -52,6 +58,18 @@ class BASE_EXPORT MemoryDumpProvider {
|
| // collecting extensive allocation data, if supported.
|
| virtual void OnHeapProfilingEnabled(bool enabled) {}
|
|
|
| + // Quickly record the total memory usage in |memory_total|. This method will
|
| + // be called only when the dump provider registration has
|
| + // |is_fast_polling_supported| set to true. This method is used for polling at
|
| + // high frequency for detecting peaks. See comment on
|
| + // |is_fast_polling_supported| option if you need to override this method.
|
| + virtual void PollFastMemoryTotal(uint64_t* memory_total) {}
|
| +
|
| + // Indicates that fast memory polling is not going to be used in the near
|
| + // future and the MDP can tear down any resource kept around for fast memory
|
| + // polling.
|
| + virtual void SuspendFastMemoryPolling() {}
|
| +
|
| protected:
|
| MemoryDumpProvider() {}
|
|
|
|
|