dump every minute the average cpu load

This commit is contained in:
Stefan Lankes 2011-09-22 10:58:03 +02:00
parent de02bffaa9
commit 50315a1d20
2 changed files with 12 additions and 2 deletions

View file

@ -79,12 +79,16 @@ static void timer_handler(struct state *s)
/*if (timer_ticks % TIMER_FREQ == 0) {
vga_puts("One second has passed\n");
}*/
/* Dump load every minute */
if (timer_ticks % (TIMER_FREQ*60) == 0)
dump_load();
}
update_load();
#if MAX_CORES > 1
if ((atomic_int32_read(&cpu_online) > 1) && (timer_ticks % (TIMER_FREQ/5) == 0))
if (atomic_int32_read(&cpu_online) > 1)
load_balancing();
#endif
}

View file

@ -92,6 +92,11 @@ tid_t wait(int32_t* result);
*/
void update_load(void);
/** @brief Print the current cpu load
*
*/
void dump_load(void);
#if MAX_CORES > 1
/** @brief Load balancer
*
@ -103,7 +108,8 @@ void load_balancing(void);
/** @brief Task switcher
*
* Timer-interrupted use of this function for task switching */
* Timer-interrupted use of this function for task switching
*/
void scheduler(void);
/** @brief Wake up a blocked task