4 This document contains an explanation of the struct taskstats fields.
6 There are three different groups of fields in the struct taskstats:
8 1) Common and basic accounting fields
9 If CONFIG_TASKSTATS is set, the taskstats inteface is enabled and
10 the common fields and basic accounting fields are collected for
11 delivery at do_exit() of a task.
12 2) Delay accounting fields
13 These fields are placed between
14 /* Delay accounting fields start */
16 /* Delay accounting fields end */
17 Their values are collected if CONFIG_TASK_DELAY_ACCT is set.
18 3) Extended accounting fields
19 These fields are placed between
20 /* Extended accounting fields start */
22 /* Extended accounting fields end */
23 Their values are collected if CONFIG_TASK_XACCT is set.
25 Future extension should add fields to the end of the taskstats struct, and
26 should not change the relative position of each field within the struct.
31 1) Common and basic accounting fields:
32 /* The version number of this struct. This field is always set to
33 * TAKSTATS_VERSION, which is defined in <linux/taskstats.h>.
34 * Each time the struct is changed, the value should be incremented.
38 /* The exit code of a task. */
39 __u32 ac_exitcode; /* Exit status */
41 /* The accounting flags of a task as defined in <linux/acct.h>
42 * Defined values are AFORK, ASU, ACOMPAT, ACORE, and AXSIG.
44 __u8 ac_flag; /* Record flags */
46 /* The value of task_nice() of a task. */
47 __u8 ac_nice; /* task_nice */
49 /* The name of the command that started this task. */
50 char ac_comm[TS_COMM_LEN]; /* Command name */
52 /* The scheduling discipline as set in task->policy field. */
53 __u8 ac_sched; /* Scheduling discipline */
56 __u32 ac_uid; /* User ID */
57 __u32 ac_gid; /* Group ID */
58 __u32 ac_pid; /* Process ID */
59 __u32 ac_ppid; /* Parent process ID */
61 /* The time when a task begins, in [secs] since 1970. */
62 __u32 ac_btime; /* Begin time [sec since 1970] */
64 /* The elapsed time of a task, in [usec]. */
65 __u64 ac_etime; /* Elapsed time [usec] */
67 /* The user CPU time of a task, in [usec]. */
68 __u64 ac_utime; /* User CPU time [usec] */
70 /* The system CPU time of a task, in [usec]. */
71 __u64 ac_stime; /* System CPU time [usec] */
73 /* The minor page fault count of a task, as set in task->min_flt. */
74 __u64 ac_minflt; /* Minor Page Fault Count */
76 /* The major page fault count of a task, as set in task->maj_flt. */
77 __u64 ac_majflt; /* Major Page Fault Count */
80 2) Delay accounting fields:
81 /* Delay accounting fields start
83 * All values, until the comment "Delay accounting fields end" are
84 * available only if delay accounting is enabled, even though the last
85 * few fields are not delays
87 * xxx_count is the number of delay values recorded
88 * xxx_delay_total is the corresponding cumulative delay in nanoseconds
90 * xxx_delay_total wraps around to zero on overflow
91 * xxx_count incremented regardless of overflow
94 /* Delay waiting for cpu, while runnable
95 * count, delay_total NOT updated atomically
98 __u64 cpu_delay_total;
100 /* Following four fields atomically updated using task->delays->lock */
102 /* Delay waiting for synchronous block I/O to complete
103 * does not account for delays in I/O submission
106 __u64 blkio_delay_total;
108 /* Delay waiting for page fault I/O (swap in only) */
110 __u64 swapin_delay_total;
112 /* cpu "wall-clock" running time
113 * On some architectures, value will adjust for cpu time stolen
114 * from the kernel in involuntary waits due to virtualization.
115 * Value is cumulative, in nanoseconds, without a corresponding count
116 * and wraps around to zero silently on overflow
118 __u64 cpu_run_real_total;
120 /* cpu "virtual" running time
121 * Uses time intervals seen by the kernel i.e. no adjustment
122 * for kernel's involuntary waits due to virtualization.
123 * Value is cumulative, in nanoseconds, without a corresponding count
124 * and wraps around to zero silently on overflow
126 __u64 cpu_run_virtual_total;
127 /* Delay accounting fields end */
128 /* version 1 ends here */
131 3) Extended accounting fields
132 /* Extended accounting fields start */
134 /* Accumulated RSS usage in duration of a task, in MBytes-usecs.
135 * The current rss usage is added to this counter every time
136 * a tick is charged to a task's system time. So, at the end we
137 * will have memory usage multiplied by system time. Thus an
138 * average usage per system time unit can be calculated.
140 __u64 coremem; /* accumulated RSS usage in MB-usec */
142 /* Accumulated virtual memory usage in duration of a task.
143 * Same as acct_rss_mem1 above except that we keep track of VM usage.
145 __u64 virtmem; /* accumulated VM usage in MB-usec */
147 /* High watermark of RSS usage in duration of a task, in KBytes. */
148 __u64 hiwater_rss; /* High-watermark of RSS usage */
150 /* High watermark of VM usage in duration of a task, in KBytes. */
151 __u64 hiwater_vm; /* High-water virtual memory usage */
153 /* The following four fields are I/O statistics of a task. */
154 __u64 read_char; /* bytes read */
155 __u64 write_char; /* bytes written */
156 __u64 read_syscalls; /* read syscalls */
157 __u64 write_syscalls; /* write syscalls */
159 /* Extended accounting fields end */