Golem  v0.1.1
Generic Operating system Libraries for Embedded Multitasking
 All Data Structures Files Functions Variables Pages
/home/ruud/Engineering/software/projects/golem-project-code/trunk/glm_resmon.c
1 
11 /* INCLUDES *******************************************************************/
12 #include <stdlib.h>
13 #include "glm_resmon.h"
14 
15 
16 /* PUBLIC FUNCTIONS ***********************************************************/
17 void
18 resmon_task_iter(p_task_iter_func_t a_func)
19 {
20  unsigned int i=0;
21  task_t param;
22  task_stats_t stats;
23 
24  // Try to get task info and stats and pass them on to caller's function if
25  // it is valid
26  if(NULL != a_func)
27  {
28  while(scheduler_task_stats(i, &param, &stats))
29  {
30  a_func(&param, &stats);
31  i++;
32  }
33  }
34 }
35 
36 
37 void
38 resmon_mem_iter(p_mem_iter_func_t a_func)
39 {
40  unsigned int i=0;
41  heap_stats_t stats;
42 
43  // Try to get task info and stats and pass them on to caller's function if
44  // it is valid
45  if(NULL != a_func)
46  {
47  while(heap_stats(i, &stats))
48  {
49  a_func(&stats);
50  i++;
51  }
52  }
53 }