| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 base::trace_event::ProcessMemoryDump* pmd); | 68 base::trace_event::ProcessMemoryDump* pmd); |
| 69 | 69 |
| 70 static uint64_t rss_bytes_for_testing; | 70 static uint64_t rss_bytes_for_testing; |
| 71 static FactoryFunction factory_for_testing; | 71 static FactoryFunction factory_for_testing; |
| 72 | 72 |
| 73 #if defined(OS_LINUX) || defined(OS_ANDROID) | 73 #if defined(OS_LINUX) || defined(OS_ANDROID) |
| 74 static FILE* proc_smaps_for_testing; | 74 static FILE* proc_smaps_for_testing; |
| 75 static int fast_polling_statm_fd_for_testing; | 75 static int fast_polling_statm_fd_for_testing; |
| 76 | 76 |
| 77 base::ScopedFD fast_polling_statm_fd_; | 77 base::ScopedFD fast_polling_statm_fd_; |
| 78 |
| 79 base::ScopedFD OpenStatm(); |
| 78 #endif | 80 #endif |
| 79 | 81 |
| 80 base::ProcessId process_; | 82 base::ProcessId process_; |
| 81 std::unique_ptr<base::ProcessMetrics> process_metrics_; | 83 std::unique_ptr<base::ProcessMetrics> process_metrics_; |
| 82 | 84 |
| 83 // The peak may not be resettable on all the processes if the linux kernel is | 85 // The peak may not be resettable on all the processes if the linux kernel is |
| 84 // older than http://bit.ly/reset_rss or only on child processes if yama LSM | 86 // older than http://bit.ly/reset_rss or only on child processes if yama LSM |
| 85 // sandbox is enabled. | 87 // sandbox is enabled. |
| 86 bool is_rss_peak_resettable_; | 88 bool is_rss_peak_resettable_; |
| 87 | 89 |
| 88 DISALLOW_COPY_AND_ASSIGN(ProcessMetricsMemoryDumpProvider); | 90 DISALLOW_COPY_AND_ASSIGN(ProcessMetricsMemoryDumpProvider); |
| 89 }; | 91 }; |
| 90 | 92 |
| 91 } // namespace tracing | 93 } // namespace tracing |
| 92 | 94 |
| 93 #endif // COMPONENTS_TRACING_COMMON_PROCESS_MEMORY_METRICS_DUMP_PROVIDER_H_ | 95 #endif // COMPONENTS_TRACING_COMMON_PROCESS_MEMORY_METRICS_DUMP_PROVIDER_H_ |
| OLD | NEW |