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

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

Issue 2902413002: memory-infra: remove light dumps and increment default dump time to 5s (Closed)
Patch Set: Undo crrev.com/2815963002, fire first timer immediately Created 3 years, 7 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/memory_dump_scheduler.cc ('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
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/trace_config.h" 5 #include "base/trace_event/trace_config.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 const char kPeriodicIntervalLegacyParam[] = "periodic_interval_ms"; 45 const char kPeriodicIntervalLegacyParam[] = "periodic_interval_ms";
46 const char kHeapProfilerOptions[] = "heap_profiler_options"; 46 const char kHeapProfilerOptions[] = "heap_profiler_options";
47 const char kBreakdownThresholdBytes[] = "breakdown_threshold_bytes"; 47 const char kBreakdownThresholdBytes[] = "breakdown_threshold_bytes";
48 48
49 // String parameters used to parse category event filters. 49 // String parameters used to parse category event filters.
50 const char kEventFiltersParam[] = "event_filters"; 50 const char kEventFiltersParam[] = "event_filters";
51 const char kFilterPredicateParam[] = "filter_predicate"; 51 const char kFilterPredicateParam[] = "filter_predicate";
52 const char kFilterArgsParam[] = "filter_args"; 52 const char kFilterArgsParam[] = "filter_args";
53 53
54 // Default configuration of memory dumps. 54 // Default configuration of memory dumps.
55 const TraceConfig::MemoryDumpConfig::Trigger kDefaultHeavyMemoryDumpTrigger = { 55 const TraceConfig::MemoryDumpConfig::Trigger kDefaultMemoryDumpTrigger = {
56 2000, // min_time_between_dumps_ms 56 5000, // min_time_between_dumps_ms
57 MemoryDumpLevelOfDetail::DETAILED, MemoryDumpType::PERIODIC_INTERVAL}; 57 MemoryDumpLevelOfDetail::DETAILED, MemoryDumpType::PERIODIC_INTERVAL};
58 const TraceConfig::MemoryDumpConfig::Trigger kDefaultLightMemoryDumpTrigger = {
59 250, // min_time_between_dumps_ms
60 MemoryDumpLevelOfDetail::LIGHT, MemoryDumpType::PERIODIC_INTERVAL};
61 58
62 class ConvertableTraceConfigToTraceFormat 59 class ConvertableTraceConfigToTraceFormat
63 : public base::trace_event::ConvertableToTraceFormat { 60 : public base::trace_event::ConvertableToTraceFormat {
64 public: 61 public:
65 explicit ConvertableTraceConfigToTraceFormat(const TraceConfig& trace_config) 62 explicit ConvertableTraceConfigToTraceFormat(const TraceConfig& trace_config)
66 : trace_config_(trace_config) {} 63 : trace_config_(trace_config) {}
67 64
68 ~ConvertableTraceConfigToTraceFormat() override {} 65 ~ConvertableTraceConfigToTraceFormat() override {}
69 66
70 void AppendAsTraceFormat(std::string* out) const override { 67 void AppendAsTraceFormat(std::string* out) const override {
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 static_cast<size_t>(min_size_bytes); 452 static_cast<size_t>(min_size_bytes);
456 } else { 453 } else {
457 memory_dump_config_.heap_profiler_options.breakdown_threshold_bytes = 454 memory_dump_config_.heap_profiler_options.breakdown_threshold_bytes =
458 MemoryDumpConfig::HeapProfiler::kDefaultBreakdownThresholdBytes; 455 MemoryDumpConfig::HeapProfiler::kDefaultBreakdownThresholdBytes;
459 } 456 }
460 } 457 }
461 } 458 }
462 459
463 void TraceConfig::SetDefaultMemoryDumpConfig() { 460 void TraceConfig::SetDefaultMemoryDumpConfig() {
464 memory_dump_config_.Clear(); 461 memory_dump_config_.Clear();
465 memory_dump_config_.triggers.push_back(kDefaultHeavyMemoryDumpTrigger); 462 memory_dump_config_.triggers.push_back(kDefaultMemoryDumpTrigger);
466 memory_dump_config_.triggers.push_back(kDefaultLightMemoryDumpTrigger);
467 memory_dump_config_.allowed_dump_modes = GetDefaultAllowedMemoryDumpModes(); 463 memory_dump_config_.allowed_dump_modes = GetDefaultAllowedMemoryDumpModes();
468 } 464 }
469 465
470 void TraceConfig::SetEventFiltersFromConfigList( 466 void TraceConfig::SetEventFiltersFromConfigList(
471 const base::ListValue& category_event_filters) { 467 const base::ListValue& category_event_filters) {
472 event_filters_.clear(); 468 event_filters_.clear();
473 469
474 for (size_t event_filter_index = 0; 470 for (size_t event_filter_index = 0;
475 event_filter_index < category_event_filters.GetSize(); 471 event_filter_index < category_event_filters.GetSize();
476 ++event_filter_index) { 472 ++event_filter_index) {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 } 579 }
584 if (enable_systrace_) 580 if (enable_systrace_)
585 ret = ret + "," + kEnableSystrace; 581 ret = ret + "," + kEnableSystrace;
586 if (enable_argument_filter_) 582 if (enable_argument_filter_)
587 ret = ret + "," + kEnableArgumentFilter; 583 ret = ret + "," + kEnableArgumentFilter;
588 return ret; 584 return ret;
589 } 585 }
590 586
591 } // namespace trace_event 587 } // namespace trace_event
592 } // namespace base 588 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/memory_dump_scheduler.cc ('k') | base/trace_event/trace_config_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698