chromium/components/metrics/call_stacks/call_stack_profile_builder.cc

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

#include "components/metrics/call_stacks/call_stack_profile_builder.h"

#include <algorithm>
#include <iterator>
#include <map>
#include <memory>
#include <string>
#include <tuple>
#include <utility>

#include "base/check.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/metrics/metrics_hashes.h"
#include "base/no_destructor.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "components/metrics/call_stacks/call_stack_profile_encoding.h"

namespace metrics {

namespace {

// Only used by child processes. This returns a unique_ptr so that it can be
// reset during tests.
std::unique_ptr<ChildCallStackProfileCollector>&
GetChildCallStackProfileCollector() {}

base::RepeatingCallback<void(base::TimeTicks, SampledProfile)>&
GetBrowserProcessReceiverCallbackInstance() {}

// Convert |filename| to its MD5 hash.
uint64_t HashModuleFilename(const base::FilePath& filename) {}

}  // namespace

CallStackProfileBuilder::CallStackProfileBuilder(
    const base::CallStackProfileParams& profile_params,
    const WorkIdRecorder* work_id_recorder,
    base::OnceClosure completed_callback)
    :{}

CallStackProfileBuilder::~CallStackProfileBuilder() = default;

base::ModuleCache* CallStackProfileBuilder::GetModuleCache() {}

// This function is invoked on the profiler thread while the target thread is
// suspended so must not take any locks, including indirectly through use of
// heap allocation, LOG, CHECK, or DCHECK.
void CallStackProfileBuilder::RecordMetadata(
    const base::MetadataRecorder::MetadataProvider& metadata_provider) {}

void CallStackProfileBuilder::ApplyMetadataRetrospectively(
    base::TimeTicks period_start,
    base::TimeTicks period_end,
    const base::MetadataRecorder::Item& item) {}

void CallStackProfileBuilder::AddProfileMetadata(
    const base::MetadataRecorder::Item& item) {}

void CallStackProfileBuilder::OnSampleCompleted(
    std::vector<base::Frame> frames,
    base::TimeTicks sample_timestamp) {}

void CallStackProfileBuilder::OnSampleCompleted(
    std::vector<base::Frame> frames,
    base::TimeTicks sample_timestamp,
    size_t weight,
    size_t count) {}

void CallStackProfileBuilder::OnProfileCompleted(
    base::TimeDelta profile_duration,
    base::TimeDelta sampling_period) {}

// static
void CallStackProfileBuilder::SetBrowserProcessReceiverCallback(
    const base::RepeatingCallback<void(base::TimeTicks, SampledProfile)>&
        callback) {}

// static
void CallStackProfileBuilder::SetParentProfileCollectorForChildProcess(
    mojo::PendingRemote<metrics::mojom::CallStackProfileCollector>
        browser_interface) {}

// static
void CallStackProfileBuilder::ResetChildCallStackProfileCollectorForTesting() {}

void CallStackProfileBuilder::PassProfilesToMetricsProvider(
    base::TimeTicks profile_start_time,
    SampledProfile sampled_profile) {}

bool CallStackProfileBuilder::StackComparer::operator()(
    const CallStackProfile::Stack* stack1,
    const CallStackProfile::Stack* stack2) const {}

}  // namespace metrics