| 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() == "heap_profiler_predicate") |
| 637 return; |
| 638 } |
| 639 // Adds a filter predicate to filter all categories for the heap profiler. |
| 640 // Note that the heap profiler predicate only filters out the events |
| 641 // disabled for recording. |
| 642 EventFilterConfig heap_profiler_config("heap_profiler_predicate"); |
| 643 heap_profiler_config.AddIncludedCategory("*"); |
| 644 heap_profiler_config.AddIncludedCategory(MemoryDumpManager::kTraceCategory); |
| 645 event_filters_.push_back(heap_profiler_config); |
| 646 } |
| 632 } | 647 } |
| 633 | 648 |
| 634 void TraceConfig::SetEventFilters( | 649 void TraceConfig::SetEventFilters( |
| 635 const base::ListValue& category_event_filters) { | 650 const base::ListValue& category_event_filters) { |
| 636 event_filters_.clear(); | 651 event_filters_.clear(); |
| 637 | 652 |
| 638 for (size_t event_filter_index = 0; | 653 for (size_t event_filter_index = 0; |
| 639 event_filter_index < category_event_filters.GetSize(); | 654 event_filter_index < category_event_filters.GetSize(); |
| 640 ++event_filter_index) { | 655 ++event_filter_index) { |
| 641 const base::DictionaryValue* event_filter = nullptr; | 656 const base::DictionaryValue* event_filter = nullptr; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 StringPiece str) { | 867 StringPiece str) { |
| 853 return str.empty() || str.front() == ' ' || str.back() == ' '; | 868 return str.empty() || str.front() == ' ' || str.back() == ' '; |
| 854 } | 869 } |
| 855 | 870 |
| 856 bool TraceConfig::HasIncludedPatterns() const { | 871 bool TraceConfig::HasIncludedPatterns() const { |
| 857 return !included_categories_.empty(); | 872 return !included_categories_.empty(); |
| 858 } | 873 } |
| 859 | 874 |
| 860 } // namespace trace_event | 875 } // namespace trace_event |
| 861 } // namespace base | 876 } // namespace base |
| OLD | NEW |