Commit c72902d0 authored by erikchen's avatar erikchen Committed by Commit Bot

Change memory dumps to not use periodic dumps by default.

All consumers that require periodic dumps now explicitly specify a dump config.
Remove by default the periodic dump config.

BUG=726393

Review-Url: https://codereview.chromium.org/2952083004
Cr-Commit-Position: refs/heads/master@{#481951}
parent 4731a33c
...@@ -891,17 +891,17 @@ TEST_F(MemoryDumpManagerTest, TraceConfigExpectationsWhenIsCoordinator) { ...@@ -891,17 +891,17 @@ TEST_F(MemoryDumpManagerTest, TraceConfigExpectationsWhenIsCoordinator) {
InitializeMemoryDumpManagerForInProcessTesting(true /* is_coordinator */); InitializeMemoryDumpManagerForInProcessTesting(true /* is_coordinator */);
// Enabling memory-infra with the legacy TraceConfig (category filter) in // Enabling memory-infra with the legacy TraceConfig (category filter) in
// a coordinator process should enable periodic dumps. // a coordinator process should not enable periodic dumps.
EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory); EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory);
EXPECT_TRUE(IsPeriodicDumpingEnabled()); EXPECT_FALSE(IsPeriodicDumpingEnabled());
DisableTracing(); DisableTracing();
// Enabling memory-infra with the new (JSON) TraceConfig in a coordinator // Enabling memory-infra with the new (JSON) TraceConfig in a coordinator
// process without specifying any "memory_dump_config" section should enable // process while specifying a "memory_dump_config" section should enable
// periodic dumps. This is to preserve the behavior chrome://tracing UI, that // periodic dumps. This is to preserve the behavior chrome://tracing UI, that
// is: ticking memory-infra should dump periodically with the default config. // is: ticking memory-infra should dump periodically with an explicit config.
EnableTracingWithTraceConfig( EnableTracingWithTraceConfig(
TraceConfigMemoryTestUtil::GetTraceConfig_NoTriggers()); TraceConfigMemoryTestUtil::GetTraceConfig_PeriodicTriggers(100, 5));
EXPECT_TRUE(IsPeriodicDumpingEnabled()); EXPECT_TRUE(IsPeriodicDumpingEnabled());
DisableTracing(); DisableTracing();
......
...@@ -51,11 +51,6 @@ const char kEventFiltersParam[] = "event_filters"; ...@@ -51,11 +51,6 @@ const char kEventFiltersParam[] = "event_filters";
const char kFilterPredicateParam[] = "filter_predicate"; const char kFilterPredicateParam[] = "filter_predicate";
const char kFilterArgsParam[] = "filter_args"; const char kFilterArgsParam[] = "filter_args";
// Default configuration of memory dumps.
const TraceConfig::MemoryDumpConfig::Trigger kDefaultMemoryDumpTrigger = {
5000, // min_time_between_dumps_ms
MemoryDumpLevelOfDetail::DETAILED, MemoryDumpType::PERIODIC_INTERVAL};
class ConvertableTraceConfigToTraceFormat class ConvertableTraceConfigToTraceFormat
: public base::trace_event::ConvertableToTraceFormat { : public base::trace_event::ConvertableToTraceFormat {
public: public:
...@@ -459,7 +454,6 @@ void TraceConfig::SetMemoryDumpConfigFromConfigDict( ...@@ -459,7 +454,6 @@ void TraceConfig::SetMemoryDumpConfigFromConfigDict(
void TraceConfig::SetDefaultMemoryDumpConfig() { void TraceConfig::SetDefaultMemoryDumpConfig() {
memory_dump_config_.Clear(); memory_dump_config_.Clear();
memory_dump_config_.triggers.push_back(kDefaultMemoryDumpTrigger);
memory_dump_config_.allowed_dump_modes = GetDefaultAllowedMemoryDumpModes(); memory_dump_config_.allowed_dump_modes = GetDefaultAllowedMemoryDumpModes();
} }
......
...@@ -697,7 +697,7 @@ TEST(TraceConfigTest, LegacyStringToMemoryDumpConfig) { ...@@ -697,7 +697,7 @@ TEST(TraceConfigTest, LegacyStringToMemoryDumpConfig) {
TraceConfig tc(MemoryDumpManager::kTraceCategory, ""); TraceConfig tc(MemoryDumpManager::kTraceCategory, "");
EXPECT_TRUE(tc.IsCategoryGroupEnabled(MemoryDumpManager::kTraceCategory)); EXPECT_TRUE(tc.IsCategoryGroupEnabled(MemoryDumpManager::kTraceCategory));
EXPECT_NE(std::string::npos, tc.ToString().find("memory_dump_config")); EXPECT_NE(std::string::npos, tc.ToString().find("memory_dump_config"));
EXPECT_EQ(1u, tc.memory_dump_config().triggers.size()); EXPECT_EQ(0u, tc.memory_dump_config().triggers.size());
EXPECT_EQ( EXPECT_EQ(
TraceConfig::MemoryDumpConfig::HeapProfiler :: TraceConfig::MemoryDumpConfig::HeapProfiler ::
kDefaultBreakdownThresholdBytes, kDefaultBreakdownThresholdBytes,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment