]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] csa: convert CONFIG tag for extended accounting routines
authorJay Lan <jlan@engr.sgi.com>
Sun, 1 Oct 2006 06:28:59 +0000 (23:28 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 1 Oct 2006 07:39:29 +0000 (00:39 -0700)
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>
fs/compat.c
fs/exec.c
include/linux/acct.h
include/linux/sched.h
include/linux/tsacct_kern.h
kernel/acct.c
kernel/exit.c
kernel/fork.c
kernel/sched.c
kernel/tsacct.c

index 6b90bf35f61d0c99e59e5714df3c7035b2365735..13fb08d096c436f5caba903abd57420935baa0cd 100644 (file)
@@ -44,7 +44,7 @@
 #include <linux/nfsd/syscall.h>
 #include <linux/personality.h>
 #include <linux/rwsem.h>
-#include <linux/acct.h>
+#include <linux/tsacct_kern.h>
 #include <linux/mm.h>
 
 #include <net/sock.h>          /* siocdevprivate_ioctl */
index a8efe35176b025626e4e49732ec49a1843862250..0db3fc3c5f0fe713af2d9a515c7cfdc7670d0223 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -46,7 +46,7 @@
 #include <linux/security.h>
 #include <linux/syscalls.h>
 #include <linux/rmap.h>
-#include <linux/acct.h>
+#include <linux/tsacct_kern.h>
 #include <linux/cn_proc.h>
 #include <linux/audit.h>
 
index e86bae7324d2f7eac86826f6686c69f66b532977..0496d1f0995212b4c8ae873ac5e7159fcab318cb 100644 (file)
@@ -124,16 +124,12 @@ extern void acct_auto_close(struct super_block *sb);
 extern void acct_init_pacct(struct pacct_struct *pacct);
 extern void acct_collect(long exitcode, int group_dead);
 extern void acct_process(void);
-extern void acct_update_integrals(struct task_struct *tsk);
-extern void acct_clear_integrals(struct task_struct *tsk);
 #else
 #define acct_auto_close_mnt(x) do { } while (0)
 #define acct_auto_close(x)     do { } while (0)
 #define acct_init_pacct(x)     do { } while (0)
 #define acct_collect(x,y)      do { } while (0)
 #define acct_process()         do { } while (0)
-#define acct_update_integrals(x)               do { } while (0)
-#define acct_clear_integrals(task)     do { } while (0)
 #endif
 
 /*
index fc4a9873ec10fb5cdb603671fc0d266f9ecd1646..4ddeb0f982fbc2c0c4be90d968983b39da84ab07 100644 (file)
@@ -981,7 +981,7 @@ struct task_struct {
        wait_queue_t *io_wait;
 /* i/o counters(bytes read/written, #syscalls */
        u64 rchar, wchar, syscr, syscw;
-#if defined(CONFIG_BSD_PROCESS_ACCT)
+#if defined(CONFIG_TASK_XACCT)
        u64 acct_rss_mem1;      /* accumulated rss usage */
        u64 acct_vm_mem1;       /* accumulated virtual memory usage */
        clock_t acct_stimexpd;  /* clock_t-converted stime since last update */
index 74102dcae67a6d51dba2a866705f88ceaee87b1c..7e50ac795b0b05b55b747fc96b07da8bcfcb6977 100644 (file)
@@ -18,9 +18,15 @@ static inline void bacct_add_tsk(struct taskstats *stats, struct task_struct *ts
 
 #ifdef CONFIG_TASK_XACCT
 extern void xacct_add_tsk(struct taskstats *stats, struct task_struct *p);
+extern void acct_update_integrals(struct task_struct *tsk);
+extern void acct_clear_integrals(struct task_struct *tsk);
 #else
 static inline void xacct_add_tsk(struct taskstats *stats, struct task_struct *p)
 {}
+static inline void acct_update_integrals(struct task_struct *tsk)
+{}
+static inline void acct_clear_integrals(struct task_struct *tsk)
+{}
 #endif /* CONFIG_TASK_XACCT */
 
 #endif
index f4330acead468a8cd228d0249918dbd748e7fbf2..0aad5ca36a8125e205e85978aa32e8712ddc957a 100644 (file)
@@ -602,33 +602,3 @@ void acct_process(void)
        do_acct_process(file);
        fput(file);
 }
-
-
-/**
- * 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;
-}
index c189de2927ab6b55ab47baf199d347d65481e906..3b47f26985f2bed8a2895a3974ff413c086409f5 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/security.h>
 #include <linux/cpu.h>
 #include <linux/acct.h>
+#include <linux/tsacct_kern.h>
 #include <linux/file.h>
 #include <linux/binfmts.h>
 #include <linux/ptrace.h>
index 1c999f3e0b47f02a4fd805daf90f9b914c44282b..89f666491d1f91d2ff2c7f4090003465299bcb6a 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/profile.h>
 #include <linux/rmap.h>
 #include <linux/acct.h>
+#include <linux/tsacct_kern.h>
 #include <linux/cn_proc.h>
 #include <linux/delayacct.h>
 #include <linux/taskstats_kern.h>
index 74f169ac0773cd2ac3eeac0bfbb3c3a631d70c65..2bbd948f0169dc3361d8b8924b0dce59eda1a825 100644 (file)
@@ -49,7 +49,7 @@
 #include <linux/seq_file.h>
 #include <linux/syscalls.h>
 #include <linux/times.h>
-#include <linux/acct.h>
+#include <linux/tsacct_kern.h>
 #include <linux/kprobes.h>
 #include <linux/delayacct.h>
 #include <asm/tlb.h>
index 410483490cf6c1e7756f3381dbc49090eea3fdaa..47c71daa416f80fd3dea1a1408e6ca60f1fce2fc 100644 (file)
@@ -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