5#include "flutter/fml/platform/android/cpu_affinity.h"
8#include <sys/resource.h>
14#include "flutter/fml/logging.h"
27 std::vector<CpuIndexAndSpeed> cpu_speeds;
29 for (
auto i = 0u;
i < cpu_count;
i++) {
31 "/cpufreq/cpuinfo_max_freq";
33 if (speed.has_value()) {
34 cpu_speeds.push_back({.index =
i, .speed = speed.value()});
42 auto count = std::thread::hardware_concurrency();
69 return sched_setaffinity(gettid(),
sizeof(
set), &
set) == 0;
A class that computes the correct CPU indices for a requested CPU affinity.
const std::vector< size_t > & GetIndices(CpuAffinity affinity) const
Return the set of CPU indices for the requested CPU affinity.
bool IsValid() const
The class is valid if it has more than one CPU index and a distinct set of efficiency or performance ...
#define FML_DCHECK(condition)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
@ kEfficiency
Request CPU affinity for the efficiency cores.
std::optional< int64_t > ReadIntFromFile(const std::string &path)
static CPUSpeedTracker * gCPUTracker
std::optional< size_t > AndroidEfficiencyCoreCount()
Android specific implementation of EfficiencyCoreCount.
bool AndroidRequestAffinity(CpuAffinity affinity)
Android specific implementation of RequestAffinity.
std::once_flag gCPUTrackerFlag
void InitCPUInfo(size_t cpu_count)
static SkString to_string(int n)