Lines Matching +full:merge +full:- +full:base

2 // Use of this source code is governed by a BSD-style license that can be
5 #include "base/trace_event/trace_config.h"
11 #include "base/json/json_reader.h"
12 #include "base/json/json_writer.h"
13 #include "base/memory/ptr_util.h"
14 #include "base/strings/string_split.h"
15 #include "base/trace_event/memory_dump_manager.h"
16 #include "base/trace_event/memory_dump_request_args.h"
17 #include "base/trace_event/trace_event.h"
19 namespace base { namespace
25 const char kRecordUntilFull[] = "record-until-full";
26 const char kRecordContinuously[] = "record-continuously";
27 const char kRecordAsMuchAsPossible[] = "record-as-much-as-possible";
28 const char kTraceToConsole[] = "trace-to-console";
29 const char kEnableSystrace[] = "enable-systrace";
30 const char kEnableArgumentFilter[] = "enable-argument-filter";
58 : public base::trace_event::ConvertableToTraceFormat {
66 out->append(trace_config_.ToString()); in AppendAsTraceFormat()
110 void TraceConfig::MemoryDumpConfig::Merge( in Merge() function in base::trace_event::TraceConfig::MemoryDumpConfig
127 const std::unordered_set<base::ProcessId>& included_process_ids) in ProcessFilterConfig()
136 void TraceConfig::ProcessFilterConfig::Merge( in Merge() function in base::trace_event::TraceConfig::ProcessFilterConfig
143 const base::DictionaryValue& dict) { in InitializeFromConfigDict()
149 for (auto& pid_value : value->GetList()) { in InitializeFromConfigDict()
158 Value* list = dict->SetKey(kIncludedProcessesParam, Value(Value::Type::LIST)); in ToDict()
159 std::set<base::ProcessId> ordered_set(included_process_ids_.begin(), in ToDict()
162 list->GetList().emplace_back(static_cast<int>(process_id)); in ToDict()
166 base::ProcessId process_id) const { in IsEnabled()
190 args_ = rhs.args_->CreateDeepCopy(); in operator =()
196 const base::DictionaryValue* event_filter) { in InitializeFromConfigDict()
199 const base::DictionaryValue* args_dict = nullptr; in InitializeFromConfigDict()
200 if (event_filter->GetDictionary(kFilterArgsParam, &args_dict)) in InitializeFromConfigDict()
201 args_ = args_dict->CreateDeepCopy(); in InitializeFromConfigDict()
211 filter_dict->SetString(kFilterPredicateParam, predicate_name()); in ToDict()
216 filter_dict->Set(kFilterArgsParam, args_->CreateDeepCopy()); in ToDict()
223 if (!args_->GetList(key, &list)) in GetArgAsSet()
225 for (size_t i = 0; i < list->GetSize(); ++i) { in GetArgAsSet()
227 if (list->GetString(i, &value)) in GetArgAsSet()
228 out_set->insert(value); in GetArgAsSet()
322 void TraceConfig::Merge(const TraceConfig& config) { in Merge() function in base::trace_event::TraceConfig
326 DLOG(ERROR) << "Attempting to merge trace config with a different " in Merge()
330 category_filter_.Merge(config.category_filter_); in Merge()
331 memory_dump_config_.Merge(config.memory_dump_config_); in Merge()
332 process_filter_config_.Merge(config.process_filter_config_); in Merge()
377 const base::ListValue* category_event_filters = nullptr; in InitializeFromConfigDict()
439 for (size_t i = 0; i < allowed_modes_list->GetSize(); ++i) { in SetMemoryDumpConfigFromConfigDict()
441 allowed_modes_list->GetString(i, &level_of_detail_str); in SetMemoryDumpConfigFromConfigDict()
454 trigger_list->GetSize() > 0) { in SetMemoryDumpConfigFromConfigDict()
455 for (size_t i = 0; i < trigger_list->GetSize(); ++i) { in SetMemoryDumpConfigFromConfigDict()
457 if (!trigger_list->GetDictionary(i, &trigger)) in SetMemoryDumpConfigFromConfigDict()
462 if (!trigger->GetInteger(kMinTimeBetweenDumps, &interval)) { in SetMemoryDumpConfigFromConfigDict()
465 trigger->GetInteger(kPeriodicIntervalLegacyParam, &interval); in SetMemoryDumpConfigFromConfigDict()
469 trigger->GetString(kTriggerTypeParam, &trigger_type_str); in SetMemoryDumpConfigFromConfigDict()
476 trigger->GetString(kTriggerModeParam, &level_of_detail_str); in SetMemoryDumpConfigFromConfigDict()
489 if (heap_profiler_options->GetInteger(kBreakdownThresholdBytes, in SetMemoryDumpConfigFromConfigDict()
511 const base::ListValue& category_event_filters) { in SetEventFiltersFromConfigList()
517 const base::DictionaryValue* event_filter = nullptr; in SetEventFiltersFromConfigList()
523 CHECK(event_filter->GetString(kFilterPredicateParam, &predicate_name)) in SetEventFiltersFromConfigList()
534 dict->SetString(kRecordModeParam, in ToDict()
536 dict->SetBoolean(kEnableSystraceParam, enable_systrace_); in ToDict()
537 dict->SetBoolean(kEnableArgumentFilterParam, enable_argument_filter_); in ToDict()
543 std::unique_ptr<base::ListValue> filter_list(new base::ListValue()); in ToDict()
545 std::unique_ptr<base::DictionaryValue> filter_dict( in ToDict()
546 new base::DictionaryValue()); in ToDict()
548 filter_list->Append(std::move(filter_dict)); in ToDict()
550 dict->Set(kEventFiltersParam, std::move(filter_list)); in ToDict()
556 allowed_modes->AppendString(MemoryDumpLevelOfDetailToString(dump_mode)); in ToDict()
559 memory_dump_config->Set(kAllowedDumpModesParam, std::move(allowed_modes)); in ToDict()
564 trigger_dict->SetString(kTriggerTypeParam, in ToDict()
566 trigger_dict->SetInteger( in ToDict()
569 trigger_dict->SetString( in ToDict()
572 triggers_list->Append(std::move(trigger_dict)); in ToDict()
577 memory_dump_config->Set(kTriggersParam, std::move(triggers_list)); in ToDict()
582 options->SetInteger( in ToDict()
585 memory_dump_config->Set(kHeapProfilerOptions, std::move(options)); in ToDict()
587 dict->Set(kMemoryDumpConfigParam, std::move(memory_dump_config)); in ToDict()
618 } // namespace base