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

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

Issue 2736283003: [memory-infra] MemoryDumpScheduler follows config for time between dumps (Closed)
Patch Set: rebase. Created 3 years, 9 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_manager.h" 5 #include "base/trace_event/memory_dump_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/allocator/features.h" 10 #include "base/allocator/features.h"
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 // NACK the dump. 507 // NACK the dump.
508 pmd_async_state.reset(new ProcessMemoryDumpAsyncState( 508 pmd_async_state.reset(new ProcessMemoryDumpAsyncState(
509 args, dump_providers_, session_state_, callback, 509 args, dump_providers_, session_state_, callback,
510 dump_thread_ ? dump_thread_->task_runner() : nullptr)); 510 dump_thread_ ? dump_thread_->task_runner() : nullptr));
511 511
512 // Safety check to prevent reaching here without calling RequestGlobalDump, 512 // Safety check to prevent reaching here without calling RequestGlobalDump,
513 // with disallowed modes. If |session_state_| is null then tracing is 513 // with disallowed modes. If |session_state_| is null then tracing is
514 // disabled. 514 // disabled.
515 CHECK(!session_state_ || 515 CHECK(!session_state_ ||
516 session_state_->IsDumpModeAllowed(args.level_of_detail)); 516 session_state_->IsDumpModeAllowed(args.level_of_detail));
517
518 if (dump_scheduler_)
519 dump_scheduler_->NotifyDumpTriggered();
517 } 520 }
518 521
519 TRACE_EVENT_WITH_FLOW0(kTraceCategory, "MemoryDumpManager::CreateProcessDump", 522 TRACE_EVENT_WITH_FLOW0(kTraceCategory, "MemoryDumpManager::CreateProcessDump",
520 TRACE_ID_MANGLE(args.dump_guid), 523 TRACE_ID_MANGLE(args.dump_guid),
521 TRACE_EVENT_FLAG_FLOW_OUT); 524 TRACE_EVENT_FLAG_FLOW_OUT);
522 525
523 // Start the process dump. This involves task runner hops as specified by the 526 // Start the process dump. This involves task runner hops as specified by the
524 // MemoryDumpProvider(s) in RegisterDumpProvider()). 527 // MemoryDumpProvider(s) in RegisterDumpProvider()).
525 SetupNextMemoryDump(std::move(pmd_async_state)); 528 SetupNextMemoryDump(std::move(pmd_async_state));
526 } 529 }
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 if (iter == process_dumps.end()) { 968 if (iter == process_dumps.end()) {
966 std::unique_ptr<ProcessMemoryDump> new_pmd( 969 std::unique_ptr<ProcessMemoryDump> new_pmd(
967 new ProcessMemoryDump(session_state, dump_args)); 970 new ProcessMemoryDump(session_state, dump_args));
968 iter = process_dumps.insert(std::make_pair(pid, std::move(new_pmd))).first; 971 iter = process_dumps.insert(std::make_pair(pid, std::move(new_pmd))).first;
969 } 972 }
970 return iter->second.get(); 973 return iter->second.get();
971 } 974 }
972 975
973 } // namespace trace_event 976 } // namespace trace_event
974 } // namespace base 977 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/trace_event/memory_dump_scheduler.h » ('j') | base/trace_event/memory_dump_scheduler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698