Ejemplo n.º 1
0
/*
 * Get CPU load periodically.
 */
void do_stat(void)
{
	read_cpu_stat(pl);
	calc_cpu_load(pl);
	cl[times] = pl->cpuload[cpu];
	if (quiet == 0)
		print_cpu_load(&(cl[times]));	/* print total results */
	times++;
}
Ejemplo n.º 2
0
/** 
 * userspace_adjust_speeds:
 * @cpufreq_objs:	List with with CPU Freq objects
 *
 * Returns:		Result of the call (TRUE/FALSE)
 *
 * calculates current cpu load and traverses all existing interfaces 
 */
gboolean userspace_adjust_speeds(GSList *cpufreq_objs)
{
	GSList *it = NULL;

	HAL_DEBUG(("Adjusting speeds..."));

	if ((calc_cpu_load(DEFAULT_CONSIDER_NICE) < 0)) {
		HAL_DEBUG(("calc_cpu_load failed. Cannot adjust speeds"));
		return TRUE;
	}

	for (it = cpufreq_objs; it != NULL; it = g_slist_next(it)) {
		struct cpufreq_obj *obj = it->data;
		adjust_speed(obj->iface);
	}

	return TRUE;
}