chromium/services/tracing/public/cpp/trace_startup_config.cc

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "services/tracing/public/cpp/trace_startup_config.h"

#include <stddef.h>

#include <memory>
#include <string>

#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/memory/shared_memory_switch.h"
#include "base/no_destructor.h"
#include "base/strings/string_number_conversions.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/trace_log.h"
#include "base/values.h"
#include "build/build_config.h"
#include "components/tracing/common/tracing_switches.h"
#include "services/tracing/public/cpp/perfetto/perfetto_config.h"
#include "services/tracing/public/mojom/perfetto_service.mojom.h"
#include "third_party/perfetto/protos/perfetto/config/track_event/track_event_config.gen.h"

#if BUILDFLAG(IS_ANDROID)
#include "base/android/early_trace_event_binding.h"
#endif

namespace tracing {

namespace {

// Maximum trace config file size that will be loaded, in bytes.
const size_t kTraceConfigFileSizeLimit =;

// Trace config file path:
// - Android: /data/local/chrome-trace-config.json
// - Others: specified by --trace-config-file flag.
#if BUILDFLAG(IS_ANDROID)
const base::FilePath::CharType kAndroidTraceConfigFile[] =
    FILE_PATH_LITERAL("/data/local/chrome-trace-config.json");
#endif

// String parameters that can be used to parse the trace config file content.
const char kTraceConfigParam[] =;
const char kStartupDurationParam[] =;
const char kResultFileParam[] =;
const char kResultDirectoryParam[] =;

constexpr std::string_view kDefaultStartupCategories[] =;

}  // namespace

// static
TraceStartupConfig& TraceStartupConfig::GetInstance() {}

// static
perfetto::TraceConfig TraceStartupConfig::GetDefaultBackgroundStartupConfig() {}

TraceStartupConfig::TraceStartupConfig() {}

TraceStartupConfig::~TraceStartupConfig() = default;

bool TraceStartupConfig::IsEnabled() const {}

void TraceStartupConfig::SetDisabled() {}

perfetto::TraceConfig TraceStartupConfig::GetPerfettoConfig() const {}

TraceStartupConfig::OutputFormat TraceStartupConfig::GetOutputFormat() const {}

base::FilePath TraceStartupConfig::GetResultFile() const {}

void TraceStartupConfig::SetBackgroundStartupTracingEnabled(bool enabled) {}

TraceStartupConfig::SessionOwner TraceStartupConfig::GetSessionOwner() const {}

bool TraceStartupConfig::AttemptAdoptBySessionOwner(SessionOwner owner) {}

bool TraceStartupConfig::EnableFromCommandLine() {}

bool TraceStartupConfig::EnableFromConfigHandle() {}

bool TraceStartupConfig::EnableFromConfigFile() {}

bool TraceStartupConfig::EnableFromBackgroundTracing() {}

bool TraceStartupConfig::ParseTraceConfigFileContent(
    const std::string& content) {}

}  // namespace tracing