Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: base/trace_event/trace_config_memory_test_util.h

Issue 1335503003: [tracing] Add test for memory-infra startup tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@startup_tracing
Patch Set: Nit Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/trace_event/trace_config.h ('k') | base/trace_event/trace_config_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BASE_TRACE_EVENT_TRACE_CONFIG_MEMORY_TEST_UTIL_H_
6 #define BASE_TRACE_EVENT_TRACE_CONFIG_MEMORY_TEST_UTIL_H_
7
8 #include "base/strings/stringprintf.h"
9 #include "base/trace_event/memory_dump_manager.h"
10
11 namespace base {
12 namespace trace_event {
13
14 class TraceConfigMemoryTestUtil {
15 public:
16 static std::string GetTraceConfig_PeriodicTriggers(int light_period,
17 int heavy_period) {
18 return StringPrintf(
19 "{"
20 "\"enable_argument_filter\":false,"
21 "\"enable_sampling\":false,"
22 "\"enable_systrace\":false,"
23 "\"included_categories\":["
24 "\"%s\""
25 "],"
26 "\"memory_dump_config\":{"
27 "\"triggers\":["
28 "{"
29 "\"mode\":\"light\","
30 "\"periodic_interval_ms\":%d"
31 "},"
32 "{"
33 "\"mode\":\"detailed\","
34 "\"periodic_interval_ms\":%d"
35 "}"
36 "]"
37 "},"
38 "\"record_mode\":\"record-until-full\""
39 "}", MemoryDumpManager::kTraceCategory, light_period, heavy_period);
40 }
41
42 static std::string GetTraceConfig_EmptyTriggers() {
43 return StringPrintf(
44 "{"
45 "\"enable_argument_filter\":false,"
46 "\"enable_sampling\":false,"
47 "\"enable_systrace\":false,"
48 "\"included_categories\":["
49 "\"%s\""
50 "],"
51 "\"memory_dump_config\":{"
52 "\"triggers\":["
53 "]"
54 "},"
55 "\"record_mode\":\"record-until-full\""
56 "}", MemoryDumpManager::kTraceCategory);
57 }
58
59 static std::string GetTraceConfig_NoTriggers() {
60 return StringPrintf(
61 "{"
62 "\"enable_argument_filter\":false,"
63 "\"enable_sampling\":false,"
64 "\"enable_systrace\":false,"
65 "\"included_categories\":["
66 "\"%s\""
67 "],"
68 "\"record_mode\":\"record-until-full\""
69 "}", MemoryDumpManager::kTraceCategory);
70 }
71 };
72
73 } // namespace trace_event
74 } // namespace base
75
76 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_MEMORY_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « base/trace_event/trace_config.h ('k') | base/trace_event/trace_config_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698