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 = "Dump failed multiple times consecutively."; | 422 disabled_reason = |
| 423 "Dump failure, possibly related with sandboxing (crbug.com/461788)." |
| 424 " Try --no-sandbox."; |
423 } else if (post_task_failed && mdpinfo->task_runner) { | 425 } else if (post_task_failed && mdpinfo->task_runner) { |
424 // Don't disable unbound dump providers. The utility thread is normally | 426 // Don't disable unbound dump providers. The utility thread is normally |
425 // shutdown when disabling the trace and getting here in this case is | 427 // shutdown when disabling the trace and getting here in this case is |
426 // expected. | 428 // expected. |
427 mdpinfo->disabled = true; | 429 mdpinfo->disabled = true; |
428 disabled_reason = "The thread it was meant to dump onto is gone."; | 430 disabled_reason = "The thread it was meant to dump onto is gone."; |
429 } | 431 } |
430 } | 432 } |
431 should_dump = !mdpinfo->disabled && !post_task_failed; | 433 should_dump = !mdpinfo->disabled && !post_task_failed; |
432 } // AutoLock lock(lock_); | 434 } // AutoLock lock(lock_); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 auto iter = process_dumps.find(pid); | 672 auto iter = process_dumps.find(pid); |
671 if (iter == process_dumps.end()) { | 673 if (iter == process_dumps.end()) { |
672 scoped_ptr<ProcessMemoryDump> new_pmd(new ProcessMemoryDump(session_state)); | 674 scoped_ptr<ProcessMemoryDump> new_pmd(new ProcessMemoryDump(session_state)); |
673 iter = process_dumps.insert(std::make_pair(pid, std::move(new_pmd))).first; | 675 iter = process_dumps.insert(std::make_pair(pid, std::move(new_pmd))).first; |
674 } | 676 } |
675 return iter->second.get(); | 677 return iter->second.get(); |
676 } | 678 } |
677 | 679 |
678 } // namespace trace_event | 680 } // namespace trace_event |
679 } // namespace base | 681 } // namespace base |
OLD | NEW |