From 14791badb1100a3c5ec55c2872568d5d1c82d55e Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Wed, 25 Sep 2019 09:42:37 -0400 Subject: [PATCH] fix powerpc namespace issues --- include/perfect/detail/cache/power.hpp | 8 +++++++- include/perfect/detail/turbo/linux_power.hpp | 11 +++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/include/perfect/detail/cache/power.hpp b/include/perfect/detail/cache/power.hpp index 3cec348..5e4e83f 100644 --- a/include/perfect/detail/cache/power.hpp +++ b/include/perfect/detail/cache/power.hpp @@ -1,5 +1,8 @@ #pragma once +namespace perfect { +namespace detail { + inline void flush_line(void *p) { /* @@ -32,4 +35,7 @@ inline void barrier_all() { : "memory"); -} \ No newline at end of file +} + +} +} diff --git a/include/perfect/detail/turbo/linux_power.hpp b/include/perfect/detail/turbo/linux_power.hpp index 551ec45..fcee8e6 100644 --- a/include/perfect/detail/turbo/linux_power.hpp +++ b/include/perfect/detail/turbo/linux_power.hpp @@ -3,6 +3,7 @@ #include "perfect/result.hpp" namespace perfect { + namespace detail { bool has_acpi_cpufreq_boost() { return bool(std::ifstream("/sys/devices/system/cpu/cpufreq/boost")); @@ -11,12 +12,10 @@ bool has_acpi_cpufreq_boost() { int write_acpi_cpufreq_boost(const std::string &s) { assert(has_acpi_cpufreq_boost()); std::string path("/sys/devices/system/cpu/cpufreq/boost"); - SPDLOG_LOGGER_TRACE(logger::console(), "writing to {}", path); std::ofstream ofs(path, std::ofstream::out); ofs << s; ofs.close(); if (ofs.fail()) { - SPDLOG_LOGGER_TRACE(logger::console(), "error writing to {}", path); return 1; } return 0; @@ -25,7 +24,6 @@ int write_acpi_cpufreq_boost(const std::string &s) { std::string read_acpi_cpufeq_boost() { assert(has_acpi_cpufreq_boost()); std::string path("/sys/devices/system/cpu/cpufreq/boost"); - SPDLOG_LOGGER_TRACE(logger::console(), "reading {}", path); std::ifstream ifs(path, std::ifstream::in); std::string result; std::getline(ifs, result); @@ -37,11 +35,12 @@ std::string read_acpi_cpufeq_boost() { } Result disable_cpu_turbo() { - write_acpi_cpufeq_boost("0"); + write_acpi_cpufreq_boost("0"); } Result enable_cpu_turbo() { - write_acpi_cpufeq_boost("1"); + write_acpi_cpufreq_boost("1"); } -} \ No newline at end of file +} // namespace detail +} // namespace perfect