chromium/components/power_metrics/system_power_monitor.cc

// Copyright 2023 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/power_metrics/system_power_monitor.h"

#include <array>
#include <cstring>

#include "base/functional/bind.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/trace_event/trace_event.h"

namespace power_metrics {

namespace {

constexpr const char kTraceCategory[] =);

constexpr const char kPackagePowerTraceCounterName[] =;
constexpr const char kCpuPowerTraceCounterName[] =;
constexpr const char kIntegratedGpuPowerTraceCounterName[] =;
constexpr const char kDramPowerTraceCounterName[] =;
constexpr const char kPsysPowerTraceCounterName[] =;
constexpr const char kVddcrVddTraceCounterName[] =;
constexpr const char kVddcrSocTraceCounterName[] =;
constexpr const char kCurrentSocketTraceCounterName[] =;
constexpr const char kApuPowerTraceCounterName[] =;

// Here we determine if the specified metric is valid according to whether its
// corresponding value in the provided sample is greater than 0, since the
// absolute energy must be greater than 0.
bool GenerateValidMetrics(const EnergyMetricsProvider::EnergyMetrics& sample,
                          std::vector<const char*>& valid_metrics) {}

int64_t CalculateNanojoulesDeltaFromSamples(
    const EnergyMetricsProvider::EnergyMetrics& new_sample,
    const EnergyMetricsProvider::EnergyMetrics& old_sample,
    const char* metric) {}

}  // namespace

SystemPowerMonitorDelegate::SystemPowerMonitorDelegate() = default;
SystemPowerMonitorDelegate::~SystemPowerMonitorDelegate() = default;

void SystemPowerMonitorDelegate::RecordSystemPower(const char* metric,
                                                   base::TimeTicks timestamp,
                                                   int64_t power) {}

bool SystemPowerMonitorDelegate::IsTraceCategoryEnabled() const {}

SystemPowerMonitorHelper::SystemPowerMonitorHelper(
    std::unique_ptr<EnergyMetricsProvider> provider,
    std::unique_ptr<SystemPowerMonitorDelegate> delegate)
    :{}

SystemPowerMonitorHelper::~SystemPowerMonitorHelper() = default;

void SystemPowerMonitorHelper::Start() {}

void SystemPowerMonitorHelper::Stop() {}

void SystemPowerMonitorHelper::Sample() {}

bool SystemPowerMonitorHelper::IsTimerRunningForTesting() {}

SystemPowerMonitor::SystemPowerMonitor()
    :{}

SystemPowerMonitor::SystemPowerMonitor(
    std::unique_ptr<EnergyMetricsProvider> provider,
    std::unique_ptr<SystemPowerMonitorDelegate> delegate) {}

SystemPowerMonitor::~SystemPowerMonitor() = default;

// static
SystemPowerMonitor* SystemPowerMonitor::GetInstance() {}

void SystemPowerMonitor::OnTraceLogEnabled() {}

void SystemPowerMonitor::OnTraceLogDisabled() {}

base::SequenceBound<SystemPowerMonitorHelper>*
SystemPowerMonitor::GetHelperForTesting() {}

}  // namespace power_metrics