Time accounting based on TSC

- as thre are still KERNEL and IDLE entries, time accounting for
  kernel and idle time works the same as for any other process

- everytime we stop accounting for the currently running process,
  kernel or idle, we read the TSC counter and increment the p_cycles
  entry.

- the process cycles inherently include some of the kernel cycles as
  we can stop accounting for the process only after we save its
  context and we start accounting just before we restore its context

- this assumes that the system does not scale the CPU frequency which
  will be true for ... long time ;-)
This commit is contained in:
Tomas Hruby
2010-02-10 15:36:54 +00:00
parent f08f2bd88c
commit 1b56fdb33c
14 changed files with 94 additions and 52 deletions

View File

@@ -13,8 +13,6 @@
/* We only support 1 cpu now */
#define CONFIG_MAX_CPUS 1
#define cpuid 0
/* measure cumulative idle timestamp counter ticks */
#undef CONFIG_IDLE_TSC
/* This is the master header for the kernel. It includes some other files
* and defines the principal constants.