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 BASE_TRACE_EVENT_TRACE_CONFIG_MEMORY_TEST_UTIL_H_ | 5 #ifndef BASE_TRACE_EVENT_TRACE_CONFIG_MEMORY_TEST_UTIL_H_ |
6 #define BASE_TRACE_EVENT_TRACE_CONFIG_MEMORY_TEST_UTIL_H_ | 6 #define BASE_TRACE_EVENT_TRACE_CONFIG_MEMORY_TEST_UTIL_H_ |
7 | 7 |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/trace_event/memory_dump_manager.h" | 9 #include "base/trace_event/memory_dump_manager.h" |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 "\"enable_argument_filter\":false," | 65 "\"enable_argument_filter\":false," |
66 "\"enable_sampling\":false," | 66 "\"enable_sampling\":false," |
67 "\"enable_systrace\":false," | 67 "\"enable_systrace\":false," |
68 "\"included_categories\":[" | 68 "\"included_categories\":[" |
69 "\"%s\"" | 69 "\"%s\"" |
70 "]," | 70 "]," |
71 "\"record_mode\":\"record-until-full\"" | 71 "\"record_mode\":\"record-until-full\"" |
72 "}", MemoryDumpManager::kTraceCategory); | 72 "}", MemoryDumpManager::kTraceCategory); |
73 } | 73 } |
74 | 74 |
75 static std::string GetTraceConfig_BackgroundTrigger() { | 75 static std::string GetTraceConfig_BackgroundTrigger(int period_ms) { |
76 return StringPrintf( | 76 return StringPrintf( |
77 "{" | 77 "{" |
78 "\"enable_argument_filter\":false," | 78 "\"enable_argument_filter\":false," |
79 "\"enable_sampling\":false," | 79 "\"enable_sampling\":false," |
80 "\"enable_systrace\":false," | 80 "\"enable_systrace\":false," |
81 "\"included_categories\":[" | 81 "\"included_categories\":[" |
82 "\"%s\"" | 82 "\"%s\"" |
83 "]," | 83 "]," |
84 "\"memory_dump_config\":{" | 84 "\"memory_dump_config\":{" |
85 "\"triggers\":[" | 85 "\"triggers\":[" |
86 "{" | 86 "{" |
87 "\"mode\":\"background\"," | 87 "\"mode\":\"background\"," |
88 "\"periodic_interval_ms\":1" | 88 "\"periodic_interval_ms\":%d" |
89 "}" | 89 "}" |
90 "]" | 90 "]" |
91 "}," | 91 "}," |
92 "\"record_mode\":\"record-until-full\"" | 92 "\"record_mode\":\"record-until-full\"" |
93 "}", MemoryDumpManager::kTraceCategory); | 93 "}", MemoryDumpManager::kTraceCategory, period_ms); |
94 } | 94 } |
95 }; | 95 }; |
96 | 96 |
97 } // namespace trace_event | 97 } // namespace trace_event |
98 } // namespace base | 98 } // namespace base |
99 | 99 |
100 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_MEMORY_TEST_UTIL_H_ | 100 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_MEMORY_TEST_UTIL_H_ |
OLD | NEW |