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

Side by Side Diff: base/trace_event/memory_dump_request_args.cc

Issue 2838913002: memory-infra: Add SUMMARY_ONLY MemoryDumpType (Closed)
Patch Set: fix for rebase Created 3 years, 8 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
OLDNEW
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 #include "base/trace_event/memory_dump_request_args.h" 5 #include "base/trace_event/memory_dump_request_args.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace base { 9 namespace base {
10 namespace trace_event { 10 namespace trace_event {
11 11
12 // static 12 // static
13 const char* MemoryDumpTypeToString(const MemoryDumpType& dump_type) { 13 const char* MemoryDumpTypeToString(const MemoryDumpType& dump_type) {
14 switch (dump_type) { 14 switch (dump_type) {
15 case MemoryDumpType::PERIODIC_INTERVAL: 15 case MemoryDumpType::PERIODIC_INTERVAL:
16 return "periodic_interval"; 16 return "periodic_interval";
17 case MemoryDumpType::EXPLICITLY_TRIGGERED: 17 case MemoryDumpType::EXPLICITLY_TRIGGERED:
18 return "explicitly_triggered"; 18 return "explicitly_triggered";
19 case MemoryDumpType::PEAK_MEMORY_USAGE: 19 case MemoryDumpType::PEAK_MEMORY_USAGE:
20 return "peak_memory_usage"; 20 return "peak_memory_usage";
21 case MemoryDumpType::SUMMARY_ONLY:
22 return "summary_only";
21 } 23 }
22 NOTREACHED(); 24 NOTREACHED();
23 return "unknown"; 25 return "unknown";
24 } 26 }
25 27
26 MemoryDumpType StringToMemoryDumpType(const std::string& str) { 28 MemoryDumpType StringToMemoryDumpType(const std::string& str) {
27 if (str == "periodic_interval") 29 if (str == "periodic_interval")
28 return MemoryDumpType::PERIODIC_INTERVAL; 30 return MemoryDumpType::PERIODIC_INTERVAL;
29 if (str == "explicitly_triggered") 31 if (str == "explicitly_triggered")
30 return MemoryDumpType::EXPLICITLY_TRIGGERED; 32 return MemoryDumpType::EXPLICITLY_TRIGGERED;
31 if (str == "peak_memory_usage") 33 if (str == "peak_memory_usage")
32 return MemoryDumpType::PEAK_MEMORY_USAGE; 34 return MemoryDumpType::PEAK_MEMORY_USAGE;
35 if (str == "summary_only")
36 return MemoryDumpType::SUMMARY_ONLY;
33 NOTREACHED(); 37 NOTREACHED();
34 return MemoryDumpType::LAST; 38 return MemoryDumpType::LAST;
35 } 39 }
36 40
37 const char* MemoryDumpLevelOfDetailToString( 41 const char* MemoryDumpLevelOfDetailToString(
38 const MemoryDumpLevelOfDetail& level_of_detail) { 42 const MemoryDumpLevelOfDetail& level_of_detail) {
39 switch (level_of_detail) { 43 switch (level_of_detail) {
40 case MemoryDumpLevelOfDetail::BACKGROUND: 44 case MemoryDumpLevelOfDetail::BACKGROUND:
41 return "background"; 45 return "background";
42 case MemoryDumpLevelOfDetail::LIGHT: 46 case MemoryDumpLevelOfDetail::LIGHT:
(...skipping 19 matching lines...) Expand all
62 66
63 MemoryDumpCallbackResult::MemoryDumpCallbackResult() {} 67 MemoryDumpCallbackResult::MemoryDumpCallbackResult() {}
64 68
65 MemoryDumpCallbackResult::MemoryDumpCallbackResult( 69 MemoryDumpCallbackResult::MemoryDumpCallbackResult(
66 const MemoryDumpCallbackResult&) = default; 70 const MemoryDumpCallbackResult&) = default;
67 71
68 MemoryDumpCallbackResult::~MemoryDumpCallbackResult() {} 72 MemoryDumpCallbackResult::~MemoryDumpCallbackResult() {}
69 73
70 } // namespace trace_event 74 } // namespace trace_event
71 } // namespace base 75 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/memory_dump_request_args.h ('k') | base/trace_event/memory_tracing_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698