OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/trace_config.h" | 5 #include "base/trace_event/trace_config.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 MemoryDumpConfig::HeapProfiler::kDefaultBreakdownThresholdBytes; | 622 MemoryDumpConfig::HeapProfiler::kDefaultBreakdownThresholdBytes; |
623 } | 623 } |
624 } | 624 } |
625 } | 625 } |
626 | 626 |
627 void TraceConfig::SetDefaultMemoryDumpConfig() { | 627 void TraceConfig::SetDefaultMemoryDumpConfig() { |
628 memory_dump_config_.Clear(); | 628 memory_dump_config_.Clear(); |
629 memory_dump_config_.triggers.push_back(kDefaultHeavyMemoryDumpTrigger); | 629 memory_dump_config_.triggers.push_back(kDefaultHeavyMemoryDumpTrigger); |
630 memory_dump_config_.triggers.push_back(kDefaultLightMemoryDumpTrigger); | 630 memory_dump_config_.triggers.push_back(kDefaultLightMemoryDumpTrigger); |
631 memory_dump_config_.allowed_dump_modes = GetDefaultAllowedMemoryDumpModes(); | 631 memory_dump_config_.allowed_dump_modes = GetDefaultAllowedMemoryDumpModes(); |
| 632 |
| 633 if (AllocationContextTracker::capture_mode() == |
| 634 AllocationContextTracker::CaptureMode::PSEUDO_STACK) { |
| 635 for (const auto& filter : event_filters_) { |
| 636 if (filter.predicate_name() == |
| 637 TraceLog::TraceEventFilter::kHeapProfilerPredicate) |
| 638 return; |
| 639 } |
| 640 // Adds a filter predicate to filter all categories for the heap profiler. |
| 641 // Note that the heap profiler predicate does not filter-out any events. |
| 642 EventFilterConfig heap_profiler_config( |
| 643 TraceLog::TraceEventFilter::kHeapProfilerPredicate); |
| 644 heap_profiler_config.AddIncludedCategory("*"); |
| 645 heap_profiler_config.AddIncludedCategory(MemoryDumpManager::kTraceCategory); |
| 646 event_filters_.push_back(heap_profiler_config); |
| 647 } |
632 } | 648 } |
633 | 649 |
634 void TraceConfig::SetEventFilters( | 650 void TraceConfig::SetEventFilters( |
635 const base::ListValue& category_event_filters) { | 651 const base::ListValue& category_event_filters) { |
636 event_filters_.clear(); | 652 event_filters_.clear(); |
637 | 653 |
638 for (size_t event_filter_index = 0; | 654 for (size_t event_filter_index = 0; |
639 event_filter_index < category_event_filters.GetSize(); | 655 event_filter_index < category_event_filters.GetSize(); |
640 ++event_filter_index) { | 656 ++event_filter_index) { |
641 const base::DictionaryValue* event_filter = nullptr; | 657 const base::DictionaryValue* event_filter = nullptr; |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 StringPiece str) { | 868 StringPiece str) { |
853 return str.empty() || str.front() == ' ' || str.back() == ' '; | 869 return str.empty() || str.front() == ' ' || str.back() == ' '; |
854 } | 870 } |
855 | 871 |
856 bool TraceConfig::HasIncludedPatterns() const { | 872 bool TraceConfig::HasIncludedPatterns() const { |
857 return !included_categories_.empty(); | 873 return !included_categories_.empty(); |
858 } | 874 } |
859 | 875 |
860 } // namespace trace_event | 876 } // namespace trace_event |
861 } // namespace base | 877 } // namespace base |
OLD | NEW |