/* * Returns: * 1 if disabled * 0 if enabled * -1 if idlestate is not available * -2 if disabling is not supported by the kernel */ int sysfs_is_idlestate_disabled(unsigned int cpu, unsigned int idlestate) { if (sysfs_get_idlestate_count(cpu) <= idlestate) return -1; if (!sysfs_idlestate_file_exists(cpu, idlestate, idlestate_value_files[IDLESTATE_DISABLE])) return -2; return sysfs_idlestate_get_one_value(cpu, idlestate, IDLESTATE_DISABLE); }
unsigned long long sysfs_get_idlestate_time(unsigned int cpu, unsigned int idlestate) { return sysfs_idlestate_get_one_value(cpu, idlestate, IDLESTATE_TIME); }
unsigned long sysfs_get_idlestate_usage(unsigned int cpu, unsigned int idlestate) { return sysfs_idlestate_get_one_value(cpu, idlestate, IDLESTATE_USAGE); }
unsigned long sysfs_get_idlestate_latency(unsigned int cpu, unsigned int idlestate) { return sysfs_idlestate_get_one_value(cpu, idlestate, IDLESTATE_LATENCY); }