1 // Copyright 2023 The Chromium Authors
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_ANDROID_MEMINFO_DUMP_PROVIDER_H_
6 #define BASE_ANDROID_MEMINFO_DUMP_PROVIDER_H_
8 #include "base/base_export.h"
9 #include "base/no_destructor.h"
10 #include "base/time/time.h"
11 #include "base/trace_event/base_tracing.h"
13 namespace base::android {
15 class BASE_EXPORT MeminfoDumpProvider
16 : public base::trace_event::MemoryDumpProvider {
18 // Returns the instance for testing.
19 static MeminfoDumpProvider& Initialize();
20 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
21 base::trace_event::ProcessMemoryDump* pmd) override;
23 static constexpr char kDumpProviderName[] = "android_meminfo";
24 static constexpr char kDumpName[] = "meminfo";
25 static constexpr char kIsStaleName[] = "is_stale";
26 static constexpr char kPssMetricName[] = "other_pss";
27 static constexpr char kPrivateDirtyMetricName[] = "other_private_dirty";
30 friend class base::NoDestructor<MeminfoDumpProvider>;
31 MeminfoDumpProvider();
33 base::TimeTicks last_collection_time_;
36 } // namespace base::android
38 #endif // BASE_ANDROID_MEMINFO_DUMP_PROVIDER_H_