9#include "gtest/gtest.h"
26 ASSERT_TRUE(tracker.IsValid());
37 ASSERT_FALSE(tracker.IsValid());
46 ASSERT_FALSE(tracker.IsValid());
53 ASSERT_FALSE(tracker.IsValid());
65 ASSERT_TRUE(
file.is_valid());
69 ASSERT_TRUE(
result.has_value());
70 ASSERT_EQ(
result.value_or(0), 12345);
82 ASSERT_TRUE(
file.is_valid());
86 ASSERT_FALSE(
result.has_value());
91 ASSERT_FALSE(
result.has_value());
A class that computes the correct CPU indices for a requested CPU affinity.
const std::string & path() const
TEST(BacktraceTest, CanGatherBacktrace)
@ kPerformance
Request CPU affinity for the performance cores.
@ kEfficiency
Request CPU affinity for the efficiency cores.
@ kNotPerformance
Request affinity for all non-performance cores.
fml::UniqueFD OpenFileReadOnly(const fml::UniqueFD &base_directory, const char *path)
bool WriteAtomically(const fml::UniqueFD &base_directory, const char *file_name, const Mapping &mapping)
std::optional< int64_t > ReadIntFromFile(const std::string &path)
bool RequestAffinity(CpuAffinity affinity)
Request the given affinity for the current thread.
std::optional< size_t > EfficiencyCoreCount()
Request count of efficiency cores.