MCPcopy Create free account
hub / github.com/Niko1221/Strata / sysfs_root

Function sysfs_root

engine/src/kernels/cpu/pool.cpp:671–674  ·  view source on GitHub ↗

Where the NUMA topology is read from: /sys. STRATA_TEST_SYSFS_ROOT= reads /devices/system/{node,cpu} instead, so a test can give the pool a made-up two-node machine (pool_tasks_test); nobody sets it for real.

Source from the content-addressed store, hash-verified

669// Where the NUMA topology is read from: /sys. STRATA_TEST_SYSFS_ROOT=<dir> reads <dir>/devices/system/{node,cpu} instead,
670// so a test can give the pool a made-up two-node machine (pool_tasks_test); nobody sets it for real.
671std::string sysfs_root() {
672 const char* e = std::getenv("STRATA_TEST_SYSFS_ROOT");
673 return e != nullptr && *e != '\0' ? std::string(e) : std::string("/sys");
674}
675
676// The NUMA node of a logical CPU (sysfs), or -1.
677int cpu_numa_node(int cpu) {

Callers 2

cpu_numa_nodeFunction · 0.70
numa_node_countFunction · 0.70

Calls 1

stringFunction · 0.50

Tested by

no test coverage detected