aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJay Lan <jlan@engr.sgi.com>2006-10-01 02:28:59 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 03:39:29 -0400
commit8f0ab5147951267134612570604cf8341901a80c (patch)
treed394edb3ab69396128e7971136f05fd71d863ece /kernel
parent9acc1853519a0473620d424105f9d49ea5b4e62e (diff)
[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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/acct.c30
-rw-r--r--kernel/exit.c1
-rw-r--r--kernel/fork.c1
-rw-r--r--kernel/sched.c2
-rw-r--r--kernel/tsacct.c30
5 files changed, 33 insertions, 31 deletions
diff --git a/kernel/acct.c b/kernel/acct.c
index f4330acead46..0aad5ca36a81 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -602,33 +602,3 @@ void acct_process(void)
602 do_acct_process(file); 602 do_acct_process(file);
603 fput(file); 603 fput(file);
604} 604}
605
606
607/**
608 * acct_update_integrals - update mm integral fields in task_struct
609 * @tsk: task_struct for accounting
610 */
611void acct_update_integrals(struct task_struct *tsk)
612{
613 if (likely(tsk->mm)) {
614 long delta =
615 cputime_to_jiffies(tsk->stime) - tsk->acct_stimexpd;
616
617 if (delta == 0)
618 return;
619 tsk->acct_stimexpd = tsk->stime;
620 tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm);
621 tsk->acct_vm_mem1 += delta * tsk->mm->total_vm;
622 }
623}
624
625/**
626 * acct_clear_integrals - clear the mm integral fields in task_struct
627 * @tsk: task_struct whose accounting fields are cleared
628 */
629void acct_clear_integrals(struct task_struct *tsk)
630{
631 tsk->acct_stimexpd = 0;
632 tsk->acct_rss_mem1 = 0;
633 tsk->acct_vm_mem1 = 0;
634}
diff --git a/kernel/exit.c b/kernel/exit.c
index c189de2927ab..3b47f26985f2 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -18,6 +18,7 @@
18#include <linux/security.h> 18#include <linux/security.h>
19#include <linux/cpu.h> 19#include <linux/cpu.h>
20#include <linux/acct.h> 20#include <linux/acct.h>
21#include <linux/tsacct_kern.h>
21#include <linux/file.h> 22#include <linux/file.h>
22#include <linux/binfmts.h> 23#include <linux/binfmts.h>
23#include <linux/ptrace.h> 24#include <linux/ptrace.h>
diff --git a/kernel/fork.c b/kernel/fork.c
index 1c999f3e0b47..89f666491d1f 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -42,6 +42,7 @@
42#include <linux/profile.h> 42#include <linux/profile.h>
43#include <linux/rmap.h> 43#include <linux/rmap.h>
44#include <linux/acct.h> 44#include <linux/acct.h>
45#include <linux/tsacct_kern.h>
45#include <linux/cn_proc.h> 46#include <linux/cn_proc.h>
46#include <linux/delayacct.h> 47#include <linux/delayacct.h>
47#include <linux/taskstats_kern.h> 48#include <linux/taskstats_kern.h>
diff --git a/kernel/sched.c b/kernel/sched.c
index 74f169ac0773..2bbd948f0169 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -49,7 +49,7 @@
49#include <linux/seq_file.h> 49#include <linux/seq_file.h>
50#include <linux/syscalls.h> 50#include <linux/syscalls.h>
51#include <linux/times.h> 51#include <linux/times.h>
52#include <linux/acct.h> 52#include <linux/tsacct_kern.h>
53#include <linux/kprobes.h> 53#include <linux/kprobes.h>
54#include <linux/delayacct.h> 54#include <linux/delayacct.h>
55#include <asm/tlb.h> 55#include <asm/tlb.h>
diff --git a/kernel/tsacct.c b/kernel/tsacct.c
index 410483490cf6..47c71daa416f 100644
--- a/kernel/tsacct.c
+++ b/kernel/tsacct.c
@@ -88,4 +88,34 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p)
88 stats->read_syscalls = p->syscr; 88 stats->read_syscalls = p->syscr;
89 stats->write_syscalls = p->syscw; 89 stats->write_syscalls = p->syscw;
90} 90}
91
92
93/**
94 * acct_update_integrals - update mm integral fields in task_struct
95 * @tsk: task_struct for accounting
96 */
97void acct_update_integrals(struct task_struct *tsk)
98{
99 if (likely(tsk->mm)) {
100 long delta =
101 cputime_to_jiffies(tsk->stime) - tsk->acct_stimexpd;
102
103 if (delta == 0)
104 return;
105 tsk->acct_stimexpd = tsk->stime;
106 tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm);
107 tsk->acct_vm_mem1 += delta * tsk->mm->total_vm;
108 }
109}
110
111/**
112 * acct_clear_integrals - clear the mm integral fields in task_struct
113 * @tsk: task_struct whose accounting fields are cleared
114 */
115void acct_clear_integrals(struct task_struct *tsk)
116{
117 tsk->acct_stimexpd = 0;
118 tsk->acct_rss_mem1 = 0;
119 tsk->acct_vm_mem1 = 0;
120}
91#endif 121#endif