add emergency "pop"
[protos/xbee-avr.git] / scheduler_stats.c
1 /*  
2  *  Copyright Droids Corporation, Microb Technology, Eirbot (2005)
3  * 
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  *
18  *  Revision : $Id: scheduler.c,v 1.9.4.6 2009-11-08 17:33:14 zer0 Exp $
19  *
20  */
21
22 #include <string.h>
23 #include <stdio.h>
24 #include <inttypes.h>
25
26 #include <aversive/parts.h>
27 #include <aversive/pgmspace.h>
28 #include <aversive.h>
29
30 #include <scheduler.h>
31 #include <scheduler_stats.h>
32
33 void scheduler_stats_dump(void)
34 {
35 #ifdef CONFIG_MODULE_SCHEDULER_STATS
36         uint8_t i;
37
38         printf_P(PSTR("alloc_fails: %"PRIu32"\r\n"), sched_stats.alloc_fails);
39         printf_P(PSTR("add_event: %"PRIu32"\r\n"), sched_stats.add_event);
40         printf_P(PSTR("del_event: %"PRIu32"\r\n"), sched_stats.del_event);
41         printf_P(PSTR("max_stacking: %"PRIu32"\r\n"), sched_stats.max_stacking);
42         for (i=0; i<SCHEDULER_NB_MAX_EVENT; i++) {
43                 printf_P(PSTR("[%d] task_delayed: %"PRIu32", "
44                               "task_scheduled: %"PRIu32"\r\n"),
45                          i, sched_stats.task_delayed[i],sched_stats.task_scheduled[i]);
46         }
47 #endif /* CONFIG_MODULE_SCHEDULER_STATS */
48 }