| OLD | NEW |
| 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 COMPONENTS_TRACING_COMMON_PROCESS_MEMORY_METRICS_DUMP_PROVIDER_H_ | 5 #ifndef COMPONENTS_TRACING_COMMON_PROCESS_MEMORY_METRICS_DUMP_PROVIDER_H_ |
| 6 #define COMPONENTS_TRACING_COMMON_PROCESS_MEMORY_METRICS_DUMP_PROVIDER_H_ | 6 #define COMPONENTS_TRACING_COMMON_PROCESS_MEMORY_METRICS_DUMP_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 base::trace_event::ProcessMemoryDump* pmd) override; | 36 base::trace_event::ProcessMemoryDump* pmd) override; |
| 37 void PollFastMemoryTotal(uint64_t* memory_total) override; | 37 void PollFastMemoryTotal(uint64_t* memory_total) override; |
| 38 void SuspendFastMemoryPolling() override; | 38 void SuspendFastMemoryPolling() override; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, | 41 FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, |
| 42 ParseProcSmaps); | 42 ParseProcSmaps); |
| 43 FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, DumpRSS); | 43 FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, DumpRSS); |
| 44 FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, | 44 FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, |
| 45 TestPollFastMemoryTotal); | 45 TestPollFastMemoryTotal); |
| 46 #if defined(OS_MACOSX) |
| 47 FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, |
| 48 TestMachOReading); |
| 49 #endif // defined(OS_MACOSX) |
| 46 | 50 |
| 47 ProcessMetricsMemoryDumpProvider(base::ProcessId process); | 51 ProcessMetricsMemoryDumpProvider(base::ProcessId process); |
| 48 | 52 |
| 49 bool DumpProcessTotals(const base::trace_event::MemoryDumpArgs& args, | 53 bool DumpProcessTotals(const base::trace_event::MemoryDumpArgs& args, |
| 50 base::trace_event::ProcessMemoryDump* pmd); | 54 base::trace_event::ProcessMemoryDump* pmd); |
| 51 bool DumpProcessMemoryMaps(const base::trace_event::MemoryDumpArgs& args, | 55 bool DumpProcessMemoryMaps(const base::trace_event::MemoryDumpArgs& args, |
| 52 base::trace_event::ProcessMemoryDump* pmd); | 56 base::trace_event::ProcessMemoryDump* pmd); |
| 53 | 57 |
| 54 static uint64_t rss_bytes_for_testing; | 58 static uint64_t rss_bytes_for_testing; |
| 55 | 59 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 67 // older than http://bit.ly/reset_rss or only on child processes if yama LSM | 71 // older than http://bit.ly/reset_rss or only on child processes if yama LSM |
| 68 // sandbox is enabled. | 72 // sandbox is enabled. |
| 69 bool is_rss_peak_resettable_; | 73 bool is_rss_peak_resettable_; |
| 70 | 74 |
| 71 DISALLOW_COPY_AND_ASSIGN(ProcessMetricsMemoryDumpProvider); | 75 DISALLOW_COPY_AND_ASSIGN(ProcessMetricsMemoryDumpProvider); |
| 72 }; | 76 }; |
| 73 | 77 |
| 74 } // namespace tracing | 78 } // namespace tracing |
| 75 | 79 |
| 76 #endif // COMPONENTS_TRACING_COMMON_PROCESS_MEMORY_METRICS_DUMP_PROVIDER_H_ | 80 #endif // COMPONENTS_TRACING_COMMON_PROCESS_MEMORY_METRICS_DUMP_PROVIDER_H_ |
| OLD | NEW |