9#include "gtest/gtest.h"
26 ASSERT_TRUE(tracker.IsValid());
40 ASSERT_FALSE(tracker.IsValid());
49 ASSERT_FALSE(tracker.IsValid());
56 ASSERT_FALSE(tracker.IsValid());
68 ASSERT_TRUE(file.is_valid());
72 ASSERT_TRUE(result.has_value());
73 ASSERT_EQ(result.value_or(0), 12345);
85 ASSERT_TRUE(file.is_valid());
89 ASSERT_FALSE(result.has_value());
94 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)
@ kNotEfficiency
Request affinity for all non-efficiency cores.
@ 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.