Browse Source

proper inttype runtime, declare to import

define runtime long as hwtimer_now() uses long
import hwtimer.h instead of declaring hwtimer_now()
dev/timer
Ludwig Ortmann 9 years ago
parent
commit
ffd8088d1d
  1. 2
      core/include/sched.h
  2. 12
      core/sched.c

2
core/include/sched.h

@ -90,7 +90,7 @@ typedef struct {
unsigned int laststart; /*< Time stamp of the last time this thread was
scheduled to run */
unsigned int schedules; /*< How often the thread was scheduled to run */
unsigned int runtime; /*< The total runtime of this thread */
unsigned long runtime; /*< The total runtime of this thread */
} schedstat;
/**

12
core/sched.c

@ -7,6 +7,8 @@
* Public License. See the file LICENSE in the top level directory for more
* details.
*
* TODO: setup dependency from SCHEDSTATISTICS to MODULE_HWTIMER
*
* @ingroup kernel
* @{
* @file
@ -21,6 +23,10 @@
#include <clist.h>
#include <bitarithm.h>
#if SCHEDSTATISTICS
#include "hwtimer.h"
#endif
#define ENABLE_DEBUG (0)
#include <debug.h>
@ -87,10 +93,8 @@ void sched_run()
}
#if SCHEDSTATISTICS
/* TODO: setup dependency from SCHEDSTATISTICS to MODULE_HWTIMER */
extern unsigned long hwtimer_now(void);
unsigned int time = hwtimer_now();
#ifdef SCHEDSTATISTICS
unsigned long time = hwtimer_now();
if (my_active_thread && (pidlist[my_active_thread->pid].laststart)) {
pidlist[my_active_thread->pid].runtime += time - pidlist[my_active_thread->pid].laststart;

Loading…
Cancel
Save