Lines Matching refs:zone
124 static int sysfs_powercap_get64_val(struct powercap_zone *zone, in sysfs_powercap_get64_val() argument
132 strcat(file, zone->sys_name); in sysfs_powercap_get64_val()
146 int powercap_get_max_energy_range_uj(struct powercap_zone *zone, uint64_t *val) in powercap_get_max_energy_range_uj() argument
148 return sysfs_powercap_get64_val(zone, GET_MAX_ENERGY_RANGE_UJ, val); in powercap_get_max_energy_range_uj()
151 int powercap_get_energy_uj(struct powercap_zone *zone, uint64_t *val) in powercap_get_energy_uj() argument
153 return sysfs_powercap_get64_val(zone, GET_ENERGY_UJ, val); in powercap_get_energy_uj()
156 int powercap_get_max_power_range_uw(struct powercap_zone *zone, uint64_t *val) in powercap_get_max_power_range_uw() argument
158 return sysfs_powercap_get64_val(zone, GET_MAX_POWER_RANGE_UW, val); in powercap_get_max_power_range_uw()
161 int powercap_get_power_uw(struct powercap_zone *zone, uint64_t *val) in powercap_get_power_uw() argument
163 return sysfs_powercap_get64_val(zone, GET_POWER_UW, val); in powercap_get_power_uw()
166 int powercap_zone_get_enabled(struct powercap_zone *zone, int *mode) in powercap_zone_get_enabled() argument
170 if ((strlen(PATH_TO_POWERCAP) + strlen(zone->sys_name)) + in powercap_zone_get_enabled()
175 strcat(path, zone->sys_name); in powercap_zone_get_enabled()
181 int powercap_zone_set_enabled(struct powercap_zone *zone, int mode) in powercap_zone_set_enabled() argument
188 int powercap_read_zone(struct powercap_zone *zone) in powercap_read_zone() argument
199 strcat(sysfs_dir, zone->sys_name); in powercap_read_zone()
206 strcat(file, zone->sys_name); in powercap_read_zone()
208 sysfs_read_file(file, zone->name, MAX_LINE_LEN); in powercap_read_zone()
209 if (zone->parent) in powercap_read_zone()
210 zone->tree_depth = zone->parent->tree_depth + 1; in powercap_read_zone()
211 ret = powercap_get_energy_uj(zone, &val); in powercap_read_zone()
213 zone->has_energy_uj = 1; in powercap_read_zone()
214 ret = powercap_get_power_uw(zone, &val); in powercap_read_zone()
216 zone->has_power_uw = 1; in powercap_read_zone()
235 if (zone->children[i] == NULL) { in powercap_read_zone()
236 zone->children[i] = child_zone; in powercap_read_zone()
246 strcpy(child_zone->sys_name, zone->sys_name); in powercap_read_zone()
249 child_zone->parent = zone; in powercap_read_zone()
250 if (zone->tree_depth >= POWERCAP_MAX_TREE_DEPTH) { in powercap_read_zone()
290 int powercap_walk_zones(struct powercap_zone *zone, in powercap_walk_zones() argument
291 int (*f)(struct powercap_zone *zone)) in powercap_walk_zones() argument
295 if (!zone) in powercap_walk_zones()
298 ret = f(zone); in powercap_walk_zones()
303 if (zone->children[i] != NULL) in powercap_walk_zones()
304 powercap_walk_zones(zone->children[i], f); in powercap_walk_zones()