@@ -13,6 +13,8 @@ a) waiting for a CPU (while being runnable)
13
13
b) completion of synchronous block I/O initiated by the task
14
14
c) swapping in pages
15
15
d) memory reclaim
16
+ e) thrashing page cache
17
+ f) direct compact
16
18
17
19
and makes these statistics available to userspace through
18
20
the taskstats interface.
@@ -41,11 +43,12 @@ generic data structure to userspace corresponding to per-pid and per-tgid
41
43
statistics. The delay accounting functionality populates specific fields of
42
44
this structure. See
43
45
44
- include/linux/taskstats.h
46
+ include/uapi/ linux/taskstats.h
45
47
46
48
for a description of the fields pertaining to delay accounting.
47
49
It will generally be in the form of counters returning the cumulative
48
- delay seen for cpu, sync block I/O, swapin, memory reclaim etc.
50
+ delay seen for cpu, sync block I/O, swapin, memory reclaim, thrash page
51
+ cache, direct compact etc.
49
52
50
53
Taking the difference of two successive readings of a given
51
54
counter (say cpu_delay_total) for a task will give the delay
@@ -88,41 +91,37 @@ seen.
88
91
89
92
General format of the getdelays command::
90
93
91
- getdelays [-t tgid] [-p pid] [-c cmd...]
92
-
94
+ getdelays [-dilv] [-t tgid] [-p pid]
93
95
94
96
Get delays, since system boot, for pid 10::
95
97
96
- # ./getdelays -p 10
98
+ # ./getdelays -d - p 10
97
99
(output similar to next case)
98
100
99
101
Get sum of delays, since system boot, for all pids with tgid 5::
100
102
101
- # ./getdelays -t 5
102
-
103
-
104
- CPU count real total virtual total delay total
105
- 7876 92005750 100000000 24001500
106
- IO count delay total
107
- 0 0
108
- SWAP count delay total
109
- 0 0
110
- RECLAIM count delay total
111
- 0 0
103
+ # ./getdelays -d -t 5
104
+ print delayacct stats ON
105
+ TGID 5
112
106
113
- Get delays seen in executing a given simple command::
114
107
115
- # ./getdelays -c ls /
108
+ CPU count real total virtual total delay total delay average
109
+ 8 7000000 6872122 3382277 0.423ms
110
+ IO count delay total delay average
111
+ 0 0 0ms
112
+ SWAP count delay total delay average
113
+ 0 0 0ms
114
+ RECLAIM count delay total delay average
115
+ 0 0 0ms
116
+ THRASHING count delay total delay average
117
+ 0 0 0ms
118
+ COMPACT count delay total delay average
119
+ 0 0 0ms
116
120
117
- bin data1 data3 data5 dev home media opt root srv sys usr
118
- boot data2 data4 data6 etc lib mnt proc sbin subdomain tmp var
121
+ Get IO accounting for pid 1, it works only with -p::
119
122
123
+ # ./getdelays -i -p 1
124
+ printing IO accounting
125
+ linuxrc: read=65536, write=0, cancelled_write=0
120
126
121
- CPU count real total virtual total delay total
122
- 6 4000250 4000000 0
123
- IO count delay total
124
- 0 0
125
- SWAP count delay total
126
- 0 0
127
- RECLAIM count delay total
128
- 0 0
127
+ The above command can be used with -v to get more debug information.
0 commit comments