| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef NETDATA_GET_SYSTEM_CPUS_H |
| 4 | #define NETDATA_GET_SYSTEM_CPUS_H |
| 5 | |
| 6 | #include "../libnetdata.h" |
| 7 | |
| 8 | /* |
| 9 | * The functions return the actual cpu cores of the system. |
| 10 | * For configuring netdata workers, please use netdata_conf_cpus() |
| 11 | * which is based on these settings, but it allows users to override it. |
| 12 | * |
| 13 | * External plugins can use the environment variable NETDATA_CONF_CPUS |
| 14 | * to get the user configured setting. |
| 15 | * |
| 16 | */ |
| 17 | |
| 18 | #define os_get_system_cpus() os_get_system_cpus_cached(true) |
| 19 | #define os_get_system_cpus_uncached() os_get_system_cpus_cached(false) |
| 20 | size_t os_get_system_cpus_cached(bool cache); |
| 21 | |
| 22 | #if defined(OS_LINUX) |
| 23 | size_t os_read_cpuset_cpus(const char *filename, size_t system_cpus); |
| 24 | #endif |
| 25 | |
| 26 | #endif //NETDATA_GET_SYSTEM_CPUS_H |