diff options
Diffstat (limited to 'include/linux/taskstats.h')
-rw-r--r-- | include/linux/taskstats.h | 64 |
1 files changed, 58 insertions, 6 deletions
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h index f1cb6cddd19d..45248806ae9c 100644 --- a/include/linux/taskstats.h +++ b/include/linux/taskstats.h | |||
@@ -2,6 +2,7 @@ | |||
2 | * | 2 | * |
3 | * Copyright (C) Shailabh Nagar, IBM Corp. 2006 | 3 | * Copyright (C) Shailabh Nagar, IBM Corp. 2006 |
4 | * (C) Balbir Singh, IBM Corp. 2006 | 4 | * (C) Balbir Singh, IBM Corp. 2006 |
5 | * (C) Jay Lan, SGI, 2006 | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of version 2.1 of the GNU Lesser General Public License | 8 | * under the terms of version 2.1 of the GNU Lesser General Public License |
@@ -29,16 +30,25 @@ | |||
29 | * c) add new fields after version comment; maintain 64-bit alignment | 30 | * c) add new fields after version comment; maintain 64-bit alignment |
30 | */ | 31 | */ |
31 | 32 | ||
32 | #define TASKSTATS_VERSION 1 | 33 | |
34 | #define TASKSTATS_VERSION 2 | ||
35 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN | ||
36 | * in linux/sched.h */ | ||
33 | 37 | ||
34 | struct taskstats { | 38 | struct taskstats { |
35 | 39 | ||
36 | /* 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 | */ | ||
37 | __u16 version; | 44 | __u16 version; |
38 | __u16 padding[3]; /* Userspace should not interpret the padding | 45 | __u32 ac_exitcode; /* Exit status */ |
39 | * field which can be replaced by useful | 46 | |
40 | * fields if struct taskstats is extended. | 47 | /* The accounting flags of a task as defined in <linux/acct.h> |
41 | */ | 48 | * Defined values are AFORK, ASU, ACOMPAT, ACORE, and AXSIG. |
49 | */ | ||
50 | __u8 ac_flag; /* Record flags */ | ||
51 | __u8 ac_nice; /* task_nice */ | ||
42 | 52 | ||
43 | /* Delay accounting fields start | 53 | /* Delay accounting fields start |
44 | * | 54 | * |
@@ -88,6 +98,48 @@ struct taskstats { | |||
88 | __u64 cpu_run_virtual_total; | 98 | __u64 cpu_run_virtual_total; |
89 | /* Delay accounting fields end */ | 99 | /* Delay accounting fields end */ |
90 | /* version 1 ends here */ | 100 | /* version 1 ends here */ |
101 | |||
102 | /* Basic Accounting Fields start */ | ||
103 | char ac_comm[TS_COMM_LEN]; /* Command name */ | ||
104 | __u8 ac_sched; /* Scheduling discipline */ | ||
105 | __u8 ac_pad[3]; | ||
106 | __u32 ac_uid; /* User ID */ | ||
107 | __u32 ac_gid; /* Group ID */ | ||
108 | __u32 ac_pid; /* Process ID */ | ||
109 | __u32 ac_ppid; /* Parent process ID */ | ||
110 | __u32 ac_btime; /* Begin time [sec since 1970] */ | ||
111 | __u64 ac_etime; /* Elapsed time [usec] */ | ||
112 | __u64 ac_utime; /* User CPU time [usec] */ | ||
113 | __u64 ac_stime; /* SYstem CPU time [usec] */ | ||
114 | __u64 ac_minflt; /* Minor Page Fault Count */ | ||
115 | __u64 ac_majflt; /* Major Page Fault Count */ | ||
116 | /* Basic Accounting Fields end */ | ||
117 | |||
118 | /* Extended accounting fields start */ | ||
119 | /* Accumulated RSS usage in duration of a task, in MBytes-usecs. | ||
120 | * The current rss usage is added to this counter every time | ||
121 | * a tick is charged to a task's system time. So, at the end we | ||
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. */ | ||
138 | __u64 read_char; /* bytes read */ | ||
139 | __u64 write_char; /* bytes written */ | ||
140 | __u64 read_syscalls; /* read syscalls */ | ||
141 | __u64 write_syscalls; /* write syscalls */ | ||
142 | /* Extended accounting fields end */ | ||
91 | }; | 143 | }; |
92 | 144 | ||
93 | 145 | ||