[PATCH] csa: convert CONFIG tag for extended accounting routines
There were a few accounting data/macros that are used in CSA but are #ifdef'ed inside CONFIG_BSD_PROCESS_ACCT. This patch is to change those ifdef's from CONFIG_BSD_PROCESS_ACCT to CONFIG_TASK_XACCT. A few defines are moved from kernel/acct.c and include/linux/acct.h to kernel/tsacct.c and include/linux/tsacct_kern.h. 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>
This commit is contained in:
parent
9acc185351
commit
8f0ab51479
10 changed files with 42 additions and 38 deletions
|
@ -88,4 +88,34 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p)
|
|||
stats->read_syscalls = p->syscr;
|
||||
stats->write_syscalls = p->syscw;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* acct_update_integrals - update mm integral fields in task_struct
|
||||
* @tsk: task_struct for accounting
|
||||
*/
|
||||
void acct_update_integrals(struct task_struct *tsk)
|
||||
{
|
||||
if (likely(tsk->mm)) {
|
||||
long delta =
|
||||
cputime_to_jiffies(tsk->stime) - tsk->acct_stimexpd;
|
||||
|
||||
if (delta == 0)
|
||||
return;
|
||||
tsk->acct_stimexpd = tsk->stime;
|
||||
tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm);
|
||||
tsk->acct_vm_mem1 += delta * tsk->mm->total_vm;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* acct_clear_integrals - clear the mm integral fields in task_struct
|
||||
* @tsk: task_struct whose accounting fields are cleared
|
||||
*/
|
||||
void acct_clear_integrals(struct task_struct *tsk)
|
||||
{
|
||||
tsk->acct_stimexpd = 0;
|
||||
tsk->acct_rss_mem1 = 0;
|
||||
tsk->acct_vm_mem1 = 0;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue