summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2003-08-31 04:32:56 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-08-31 04:32:56 -0700
commita776ac8d7331991be8298247d3547761bf54779b (patch)
tree40c3cc4bb8f2867d60f99777f8094c062dcc13c8 /include/linux
parent8890739713c95dbd26da852acc73f24a1d58593f (diff)
[PATCH] add context switch counters
From: Peter Chubb <peterc@gelato.unsw.edu.au> Currently, the context switch counters reported by getrusage() are always zero. The appended patch adds fields to struct task_struct to count context switches, and adds code to do the counting. The patch adds 4 longs to struct task struct, and a single addition to the fast path in schedule().
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sched.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 054168543a45..3c6e3129144d 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -391,6 +391,7 @@ struct task_struct {
struct timer_list real_timer;
struct list_head posix_timers; /* POSIX.1b Interval Timers */
unsigned long utime, stime, cutime, cstime;
+ unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; /* context switch counts */
u64 start_time;
/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap;