diff options
author | Jay Lan <jlan@engr.sgi.com> | 2006-10-01 02:28:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-01 03:39:29 -0400 |
commit | 9acc1853519a0473620d424105f9d49ea5b4e62e (patch) | |
tree | fd4d03bf82ea604e71f8e805e557023226c2dd42 /kernel/tsacct.c | |
parent | f3cef7a99469afc159fec3a61b42dc7ca5b6824f (diff) |
[PATCH] csa: Extended system accounting over taskstats
Add extended system accounting handling over taskstats interface. A
CONFIG_TASK_XACCT flag is created to enable the extended accounting code.
Signed-off-by: Jay Lan <jlan@sgi.com>
Cc: Shailabh Nagar <nagar@watson.ibm.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Jes Sorensen <jes@sgi.com>
Cc: Chris Sturtivant <csturtiv@sgi.com>
Cc: Tony Ernst <tee@sgi.com>
Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/tsacct.c')
-rw-r--r-- | kernel/tsacct.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/kernel/tsacct.c b/kernel/tsacct.c index 899067950a88..410483490cf6 100644 --- a/kernel/tsacct.c +++ b/kernel/tsacct.c | |||
@@ -70,3 +70,22 @@ void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk) | |||
70 | strncpy(stats->ac_comm, tsk->comm, sizeof(stats->ac_comm)); | 70 | strncpy(stats->ac_comm, tsk->comm, sizeof(stats->ac_comm)); |
71 | } | 71 | } |
72 | 72 | ||
73 | |||
74 | #ifdef CONFIG_TASK_XACCT | ||
75 | /* | ||
76 | * fill in extended accounting fields | ||
77 | */ | ||
78 | void xacct_add_tsk(struct taskstats *stats, struct task_struct *p) | ||
79 | { | ||
80 | stats->acct_rss_mem1 = p->acct_rss_mem1; | ||
81 | stats->acct_vm_mem1 = p->acct_vm_mem1; | ||
82 | if (p->mm) { | ||
83 | stats->hiwater_rss = p->mm->hiwater_rss; | ||
84 | stats->hiwater_vm = p->mm->hiwater_vm; | ||
85 | } | ||
86 | stats->read_char = p->rchar; | ||
87 | stats->write_char = p->wchar; | ||
88 | stats->read_syscalls = p->syscr; | ||
89 | stats->write_syscalls = p->syscw; | ||
90 | } | ||
91 | #endif | ||