aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/taskstats.h
diff options
context:
space:
mode:
authorJay Lan <jlan@sgi.com>2006-10-01 02:29:00 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 03:39:29 -0400
commitdb5fed26b2e0beed939b773dd5896077a1794d65 (patch)
treebe7630821744aae53b2431383ef0b304a87f1268 /include/linux/taskstats.h
parent8f0ab5147951267134612570604cf8341901a80c (diff)
[PATCH] csa accounting taskstats update
ChangeLog: Feedbacks from Andrew Morton: - define TS_COMM_LEN to 32 - change acct_stimexpd field of task_struct to be of cputime_t, which is to be used to save the tsk->stime of last timer interrupt update. - a new Documentation/accounting/taskstats-struct.txt to describe fields of taskstats struct. Feedback from Balbir Singh: - keep the stime of a task to be zero when both stime and utime are zero as recoreded in task_struct. Misc: - convert accumulated RSS/VM from platform dependent pages-ticks to MBytes-usecs in the kernel 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 'include/linux/taskstats.h')
-rw-r--r--include/linux/taskstats.h40
1 files changed, 31 insertions, 9 deletions
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h
index 3d2c304886b..45248806ae9 100644
--- a/include/linux/taskstats.h
+++ b/include/linux/taskstats.h
@@ -32,14 +32,21 @@
32 32
33 33
34#define TASKSTATS_VERSION 2 34#define TASKSTATS_VERSION 2
35#define TS_COMM_LEN 16 /* should sync up with TASK_COMM_LEN 35#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
36 * in linux/sched.h */ 36 * in linux/sched.h */
37 37
38struct taskstats { 38struct taskstats {
39 39
40 /* Version 1 */ 40 /* The version number of this struct. This field is always set to
41 * TAKSTATS_VERSION, which is defined in <linux/taskstats.h>.
42 * Each time the struct is changed, the value should be incremented.
43 */
41 __u16 version; 44 __u16 version;
42 __u32 ac_exitcode; /* Exit status */ 45 __u32 ac_exitcode; /* Exit status */
46
47 /* The accounting flags of a task as defined in <linux/acct.h>
48 * Defined values are AFORK, ASU, ACOMPAT, ACORE, and AXSIG.
49 */
43 __u8 ac_flag; /* Record flags */ 50 __u8 ac_flag; /* Record flags */
44 __u8 ac_nice; /* task_nice */ 51 __u8 ac_nice; /* task_nice */
45 52
@@ -104,15 +111,30 @@ struct taskstats {
104 __u64 ac_etime; /* Elapsed time [usec] */ 111 __u64 ac_etime; /* Elapsed time [usec] */
105 __u64 ac_utime; /* User CPU time [usec] */ 112 __u64 ac_utime; /* User CPU time [usec] */
106 __u64 ac_stime; /* SYstem CPU time [usec] */ 113 __u64 ac_stime; /* SYstem CPU time [usec] */
107 __u64 ac_minflt; /* Minor Page Fault */ 114 __u64 ac_minflt; /* Minor Page Fault Count */
108 __u64 ac_majflt; /* Major Page Fault */ 115 __u64 ac_majflt; /* Major Page Fault Count */
109 /* Basic Accounting Fields end */ 116 /* Basic Accounting Fields end */
110 117
111 /* Extended accounting fields start */ 118 /* Extended accounting fields start */
112 __u64 acct_rss_mem1; /* accumulated rss usage */ 119 /* Accumulated RSS usage in duration of a task, in MBytes-usecs.
113 __u64 acct_vm_mem1; /* accumulated virtual memory usage */ 120 * The current rss usage is added to this counter every time
114 __u64 hiwater_rss; /* High-watermark of RSS usage */ 121 * a tick is charged to a task's system time. So, at the end we
115 __u64 hiwater_vm; /* High-water virtual memory usage */ 122 * will have memory usage multiplied by system time. Thus an
123 * average usage per system time unit can be calculated.
124 */
125 __u64 coremem; /* accumulated RSS usage in MB-usec */
126 /* Accumulated virtual memory usage in duration of a task.
127 * Same as acct_rss_mem1 above except that we keep track of VM usage.
128 */
129 __u64 virtmem; /* accumulated VM usage in MB-usec */
130
131 /* High watermark of RSS and virtual memory usage in duration of
132 * a task, in KBytes.
133 */
134 __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */
135 __u64 hiwater_vm; /* High-water VM usage, in KB */
136
137 /* The following four fields are I/O statistics of a task. */
116 __u64 read_char; /* bytes read */ 138 __u64 read_char; /* bytes read */
117 __u64 write_char; /* bytes written */ 139 __u64 write_char; /* bytes written */
118 __u64 read_syscalls; /* read syscalls */ 140 __u64 read_syscalls; /* read syscalls */