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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 // hence the above |post_task_failed| == true. | 412 // hence the above |post_task_failed| == true. |
413 // - The MDP does NOT have a task runner affinity. A locked access is required | 413 // - The MDP does NOT have a task runner affinity. A locked access is required |
414 // to R/W |disabled| (for the UnregisterAndDeleteDumpProviderSoon() case). | 414 // to R/W |disabled| (for the UnregisterAndDeleteDumpProviderSoon() case). |
415 bool should_dump; | 415 bool should_dump; |
416 const char* disabled_reason = nullptr; | 416 const char* disabled_reason = nullptr; |
417 { | 417 { |
418 AutoLock lock(lock_); | 418 AutoLock lock(lock_); |
419 if (!mdpinfo->disabled) { | 419 if (!mdpinfo->disabled) { |
420 if (mdpinfo->consecutive_failures >= kMaxConsecutiveFailuresCount) { | 420 if (mdpinfo->consecutive_failures >= kMaxConsecutiveFailuresCount) { |
421 mdpinfo->disabled = true; | 421 mdpinfo->disabled = true; |
422 disabled_reason = | 422 disabled_reason = "Dump failed multiple times consecutively."; |
423 "Dump failure, possibly related with sandboxing (crbug.com/461788)." | |
424 " Try --no-sandbox."; | |
425 } else if (post_task_failed && mdpinfo->task_runner) { | 423 } else if (post_task_failed && mdpinfo->task_runner) { |
426 // Don't disable unbound dump providers. The utility thread is normally | 424 // Don't disable unbound dump providers. The utility thread is normally |
427 // shutdown when disabling the trace and getting here in this case is | 425 // shutdown when disabling the trace and getting here in this case is |
428 // expected. | 426 // expected. |
429 mdpinfo->disabled = true; | 427 mdpinfo->disabled = true; |
430 disabled_reason = "The thread it was meant to dump onto is gone."; | 428 disabled_reason = "The thread it was meant to dump onto is gone."; |
431 } | 429 } |
432 } | 430 } |
433 should_dump = !mdpinfo->disabled && !post_task_failed; | 431 should_dump = !mdpinfo->disabled && !post_task_failed; |
434 } // AutoLock lock(lock_); | 432 } // AutoLock lock(lock_); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 auto iter = process_dumps.find(pid); | 670 auto iter = process_dumps.find(pid); |
673 if (iter == process_dumps.end()) { | 671 if (iter == process_dumps.end()) { |
674 scoped_ptr<ProcessMemoryDump> new_pmd(new ProcessMemoryDump(session_state)); | 672 scoped_ptr<ProcessMemoryDump> new_pmd(new ProcessMemoryDump(session_state)); |
675 iter = process_dumps.insert(std::make_pair(pid, std::move(new_pmd))).first; | 673 iter = process_dumps.insert(std::make_pair(pid, std::move(new_pmd))).first; |
676 } | 674 } |
677 return iter->second.get(); | 675 return iter->second.get(); |
678 } | 676 } |
679 | 677 |
680 } // namespace trace_event | 678 } // namespace trace_event |
681 } // namespace base | 679 } // namespace base |
OLD | NEW |