OLD | NEW |
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/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 // hence the above |post_task_failed| == true. | 391 // hence the above |post_task_failed| == true. |
392 // - The MDP does NOT have a task runner affinity. A locked access is required | 392 // - The MDP does NOT have a task runner affinity. A locked access is required |
393 // to R/W |disabled| (for the UnregisterAndDeleteDumpProviderSoon() case). | 393 // to R/W |disabled| (for the UnregisterAndDeleteDumpProviderSoon() case). |
394 bool should_dump; | 394 bool should_dump; |
395 const char* disabled_reason = nullptr; | 395 const char* disabled_reason = nullptr; |
396 { | 396 { |
397 AutoLock lock(lock_); | 397 AutoLock lock(lock_); |
398 if (!mdpinfo->disabled) { | 398 if (!mdpinfo->disabled) { |
399 if (mdpinfo->consecutive_failures >= kMaxConsecutiveFailuresCount) { | 399 if (mdpinfo->consecutive_failures >= kMaxConsecutiveFailuresCount) { |
400 mdpinfo->disabled = true; | 400 mdpinfo->disabled = true; |
401 disabled_reason = | 401 disabled_reason = "Dump failed multiple times consecutively."; |
402 "Dump failure, possibly related with sandboxing (crbug.com/461788)." | |
403 " Try --no-sandbox."; | |
404 } else if (post_task_failed && mdpinfo->task_runner) { | 402 } else if (post_task_failed && mdpinfo->task_runner) { |
405 // Don't disable unbound dump providers. The utility thread is normally | 403 // Don't disable unbound dump providers. The utility thread is normally |
406 // shutdown when disabling the trace and getting here in this case is | 404 // shutdown when disabling the trace and getting here in this case is |
407 // expected. | 405 // expected. |
408 mdpinfo->disabled = true; | 406 mdpinfo->disabled = true; |
409 disabled_reason = "The thread it was meant to dump onto is gone."; | 407 disabled_reason = "The thread it was meant to dump onto is gone."; |
410 } | 408 } |
411 } | 409 } |
412 should_dump = !mdpinfo->disabled && !post_task_failed; | 410 should_dump = !mdpinfo->disabled && !post_task_failed; |
413 } | 411 } |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 auto iter = process_dumps.find(pid); | 640 auto iter = process_dumps.find(pid); |
643 if (iter == process_dumps.end()) { | 641 if (iter == process_dumps.end()) { |
644 scoped_ptr<ProcessMemoryDump> new_pmd(new ProcessMemoryDump(session_state)); | 642 scoped_ptr<ProcessMemoryDump> new_pmd(new ProcessMemoryDump(session_state)); |
645 iter = process_dumps.insert(std::make_pair(pid, std::move(new_pmd))).first; | 643 iter = process_dumps.insert(std::make_pair(pid, std::move(new_pmd))).first; |
646 } | 644 } |
647 return iter->second.get(); | 645 return iter->second.get(); |
648 } | 646 } |
649 | 647 |
650 } // namespace trace_event | 648 } // namespace trace_event |
651 } // namespace base | 649 } // namespace base |
OLD | NEW |