Commit | Line | Data |
---|---|---|
9f36eaed | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
b283666f | 2 | #undef TRACE_SYSTEM |
9bbf98da | 3 | #define TRACE_SYSTEM mm_vmscan |
b283666f | 4 | |
9bbf98da MD |
5 | #if !defined(LTTNG_TRACE_MM_VMSCAN_H) || defined(TRACE_HEADER_MULTI_READ) |
6 | #define LTTNG_TRACE_MM_VMSCAN_H | |
b283666f | 7 | |
6ec43db8 | 8 | #include <probes/lttng-tracepoint-event.h> |
7c68b363 | 9 | #include <linux/types.h> |
7c68b363 AG |
10 | #include <linux/mm.h> |
11 | #include <linux/memcontrol.h> | |
7c68b363 AG |
12 | #include <linux/version.h> |
13 | ||
14 | #ifndef _TRACE_VMSCAN_DEF | |
15 | #define _TRACE_VMSCAN_DEF | |
16 | #define RECLAIM_WB_ANON 0x0001u | |
17 | #define RECLAIM_WB_FILE 0x0002u | |
18 | #define RECLAIM_WB_MIXED 0x0010u | |
19 | #define RECLAIM_WB_SYNC 0x0004u /* Unused, all reclaim async */ | |
20 | #define RECLAIM_WB_ASYNC 0x0008u | |
21 | ||
7c68b363 AG |
22 | #if ((LINUX_VERSION_CODE <= KERNEL_VERSION(3,0,38)) || \ |
23 | LTTNG_KERNEL_RANGE(3,1,0, 3,2,0)) | |
24 | typedef int isolate_mode_t; | |
25 | #endif | |
26 | ||
27 | #endif | |
28 | ||
01e289f7 MD |
29 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) |
30 | ||
31 | #include <linux/mm_inline.h> | |
32 | ||
33 | #define trace_reclaim_flags(page) ( \ | |
34 | (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ | |
35 | (RECLAIM_WB_ASYNC) \ | |
36 | ) | |
37 | ||
38 | #define trace_shrink_flags(file) \ | |
39 | ( \ | |
40 | (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ | |
41 | (RECLAIM_WB_ASYNC) \ | |
42 | ) | |
43 | ||
44 | #endif | |
45 | ||
3bc29f0a | 46 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_sleep, |
b283666f PW |
47 | |
48 | TP_PROTO(int nid), | |
49 | ||
50 | TP_ARGS(nid), | |
51 | ||
f127e61e MD |
52 | TP_FIELDS( |
53 | ctf_integer(int, nid, nid) | |
54 | ) | |
b283666f PW |
55 | ) |
56 | ||
b2641821 MD |
57 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) |
58 | ||
59 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake, | |
60 | ||
61 | TP_PROTO(int nid, int zid, int order), | |
62 | ||
63 | TP_ARGS(nid, zid, order), | |
64 | ||
65 | TP_FIELDS( | |
66 | ctf_integer(int, nid, nid) | |
67 | ctf_integer(int, zid, zid) | |
68 | ctf_integer(int, order, order) | |
69 | ) | |
70 | ) | |
71 | ||
72 | #else | |
73 | ||
3bc29f0a | 74 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake, |
b283666f PW |
75 | |
76 | TP_PROTO(int nid, int order), | |
77 | ||
78 | TP_ARGS(nid, order), | |
79 | ||
f127e61e MD |
80 | TP_FIELDS( |
81 | ctf_integer(int, nid, nid) | |
82 | ctf_integer(int, order, order) | |
83 | ) | |
b283666f PW |
84 | ) |
85 | ||
b2641821 MD |
86 | #endif |
87 | ||
95265e58 MJ |
88 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) |
89 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd, | |
90 | ||
91 | TP_PROTO(int nid, int zid, int order, gfp_t gfp_flags), | |
92 | ||
93 | TP_ARGS(nid, zid, order, gfp_flags), | |
94 | ||
95 | TP_FIELDS( | |
96 | ctf_integer(int, nid, nid) | |
97 | ctf_integer(int, zid, zid) | |
98 | ctf_integer(int, order, order) | |
99 | ctf_integer(gfp_t, gfp_flags, gfp_flags) | |
100 | ) | |
101 | ) | |
102 | #else | |
3bc29f0a | 103 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd, |
b283666f PW |
104 | |
105 | TP_PROTO(int nid, int zid, int order), | |
106 | ||
107 | TP_ARGS(nid, zid, order), | |
108 | ||
f127e61e MD |
109 | TP_FIELDS( |
110 | ctf_integer(int, nid, nid) | |
111 | ctf_integer(int, zid, zid) | |
112 | ctf_integer(int, order, order) | |
113 | ) | |
b283666f | 114 | ) |
95265e58 | 115 | #endif |
b283666f | 116 | |
b2641821 MD |
117 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) |
118 | ||
119 | LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, | |
120 | ||
121 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), | |
122 | ||
123 | TP_ARGS(order, may_writepage, gfp_flags, classzone_idx), | |
124 | ||
125 | TP_FIELDS( | |
126 | ctf_integer(int, order, order) | |
127 | ctf_integer(int, may_writepage, may_writepage) | |
128 | ctf_integer(gfp_t, gfp_flags, gfp_flags) | |
129 | ctf_integer(int, classzone_idx, classzone_idx) | |
130 | ) | |
131 | ) | |
132 | ||
133 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin, | |
134 | ||
135 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), | |
136 | ||
137 | TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) | |
138 | ) | |
139 | ||
140 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin, | |
141 | ||
142 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), | |
143 | ||
144 | TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) | |
145 | ) | |
146 | ||
147 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin, | |
148 | ||
149 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), | |
150 | ||
151 | TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) | |
152 | ) | |
153 | ||
154 | #else | |
155 | ||
3bc29f0a | 156 | LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, |
b283666f PW |
157 | |
158 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), | |
159 | ||
160 | TP_ARGS(order, may_writepage, gfp_flags), | |
161 | ||
f127e61e MD |
162 | TP_FIELDS( |
163 | ctf_integer(int, order, order) | |
164 | ctf_integer(int, may_writepage, may_writepage) | |
165 | ctf_integer(gfp_t, gfp_flags, gfp_flags) | |
166 | ) | |
b283666f PW |
167 | ) |
168 | ||
3bc29f0a | 169 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin, |
b283666f PW |
170 | |
171 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), | |
172 | ||
173 | TP_ARGS(order, may_writepage, gfp_flags) | |
174 | ) | |
175 | ||
3bc29f0a | 176 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin, |
b283666f PW |
177 | |
178 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), | |
179 | ||
180 | TP_ARGS(order, may_writepage, gfp_flags) | |
181 | ) | |
182 | ||
3bc29f0a | 183 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin, |
b283666f PW |
184 | |
185 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), | |
186 | ||
187 | TP_ARGS(order, may_writepage, gfp_flags) | |
188 | ) | |
189 | ||
b2641821 MD |
190 | #endif |
191 | ||
3bc29f0a | 192 | LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template, |
b283666f PW |
193 | |
194 | TP_PROTO(unsigned long nr_reclaimed), | |
195 | ||
196 | TP_ARGS(nr_reclaimed), | |
197 | ||
f127e61e MD |
198 | TP_FIELDS( |
199 | ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) | |
200 | ) | |
b283666f PW |
201 | ) |
202 | ||
3bc29f0a | 203 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_direct_reclaim_end, |
b283666f PW |
204 | |
205 | TP_PROTO(unsigned long nr_reclaimed), | |
206 | ||
207 | TP_ARGS(nr_reclaimed) | |
208 | ) | |
209 | ||
3bc29f0a | 210 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_reclaim_end, |
b283666f PW |
211 | |
212 | TP_PROTO(unsigned long nr_reclaimed), | |
213 | ||
214 | TP_ARGS(nr_reclaimed) | |
215 | ) | |
216 | ||
3bc29f0a | 217 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_reclaim_end, |
b283666f PW |
218 | |
219 | TP_PROTO(unsigned long nr_reclaimed), | |
220 | ||
221 | TP_ARGS(nr_reclaimed) | |
222 | ) | |
223 | ||
9cf057fc MJ |
224 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0)) |
225 | LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start, | |
226 | ||
227 | mm_vmscan_shrink_slab_start, | |
228 | ||
229 | TP_PROTO(struct shrinker *shr, struct shrink_control *sc, | |
230 | long nr_objects_to_shrink, unsigned long cache_items, | |
231 | unsigned long long delta, unsigned long total_scan, | |
232 | int priority), | |
233 | ||
234 | TP_ARGS(shr, sc, nr_objects_to_shrink, cache_items, delta, total_scan, | |
235 | priority), | |
236 | ||
237 | TP_FIELDS( | |
238 | ctf_integer_hex(struct shrinker *, shr, shr) | |
239 | ctf_integer_hex(void *, shrink, shr->scan_objects) | |
240 | ctf_integer(int, nid, sc->nid) | |
241 | ctf_integer(long, nr_objects_to_shrink, nr_objects_to_shrink) | |
242 | ctf_integer(gfp_t, gfp_flags, sc->gfp_mask) | |
243 | ctf_integer(unsigned long, cache_items, cache_items) | |
244 | ctf_integer(unsigned long long, delta, delta) | |
245 | ctf_integer(unsigned long, total_scan, total_scan) | |
246 | ctf_integer(int, priority, priority) | |
247 | ) | |
248 | ) | |
249 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) | |
9bbf98da MD |
250 | LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start, |
251 | ||
252 | mm_vmscan_shrink_slab_start, | |
253 | ||
b283666f PW |
254 | TP_PROTO(struct shrinker *shr, struct shrink_control *sc, |
255 | long nr_objects_to_shrink, unsigned long pgs_scanned, | |
256 | unsigned long lru_pgs, unsigned long cache_items, | |
257 | unsigned long long delta, unsigned long total_scan), | |
258 | ||
259 | TP_ARGS(shr, sc, nr_objects_to_shrink, pgs_scanned, lru_pgs, | |
260 | cache_items, delta, total_scan), | |
261 | ||
f127e61e | 262 | TP_FIELDS( |
fa91fcac | 263 | ctf_integer_hex(struct shrinker *, shr, shr) |
5465fedd | 264 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
fa91fcac | 265 | ctf_integer_hex(void *, shrink, shr->scan_objects) |
5465fedd | 266 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
fa91fcac | 267 | ctf_integer_hex(void *, shrink, shr->shrink) |
5465fedd | 268 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
f127e61e MD |
269 | ctf_integer(long, nr_objects_to_shrink, nr_objects_to_shrink) |
270 | ctf_integer(gfp_t, gfp_flags, sc->gfp_mask) | |
271 | ctf_integer(unsigned long, pgs_scanned, pgs_scanned) | |
272 | ctf_integer(unsigned long, lru_pgs, lru_pgs) | |
273 | ctf_integer(unsigned long, cache_items, cache_items) | |
274 | ctf_integer(unsigned long long, delta, delta) | |
275 | ctf_integer(unsigned long, total_scan, total_scan) | |
276 | ) | |
b283666f | 277 | ) |
9cf057fc | 278 | #endif |
b283666f | 279 | |
5defe623 | 280 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) |
9bbf98da MD |
281 | LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end, |
282 | ||
283 | mm_vmscan_shrink_slab_end, | |
284 | ||
5defe623 MD |
285 | TP_PROTO(struct shrinker *shr, int nid, int shrinker_retval, |
286 | long unused_scan_cnt, long new_scan_cnt, long total_scan), | |
287 | ||
288 | TP_ARGS(shr, nid, shrinker_retval, unused_scan_cnt, new_scan_cnt, | |
289 | total_scan), | |
290 | ||
f127e61e | 291 | TP_FIELDS( |
fa91fcac | 292 | ctf_integer_hex(struct shrinker *, shr, shr) |
f127e61e | 293 | ctf_integer(int, nid, nid) |
fa91fcac | 294 | ctf_integer_hex(void *, shrink, shr->scan_objects) |
f127e61e MD |
295 | ctf_integer(long, unused_scan, unused_scan_cnt) |
296 | ctf_integer(long, new_scan, new_scan_cnt) | |
297 | ctf_integer(int, retval, shrinker_retval) | |
298 | ctf_integer(long, total_scan, total_scan) | |
299 | ) | |
5defe623 | 300 | ) |
9cf057fc | 301 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) |
9bbf98da MD |
302 | LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end, |
303 | ||
304 | mm_vmscan_shrink_slab_end, | |
305 | ||
b283666f PW |
306 | TP_PROTO(struct shrinker *shr, int shrinker_retval, |
307 | long unused_scan_cnt, long new_scan_cnt), | |
308 | ||
309 | TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt), | |
310 | ||
f127e61e | 311 | TP_FIELDS( |
fa91fcac | 312 | ctf_integer_hex(struct shrinker *, shr, shr) |
5465fedd | 313 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
fa91fcac | 314 | ctf_integer_hex(void *, shrink, shr->scan_objects) |
5465fedd | 315 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
fa91fcac | 316 | ctf_integer_hex(void *, shrink, shr->shrink) |
5465fedd | 317 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
f127e61e MD |
318 | ctf_integer(long, unused_scan, unused_scan_cnt) |
319 | ctf_integer(long, new_scan, new_scan_cnt) | |
320 | ctf_integer(int, retval, shrinker_retval) | |
321 | ctf_integer(long, total_scan, new_scan_cnt - unused_scan_cnt) | |
322 | ) | |
b283666f | 323 | ) |
7c68b363 | 324 | #endif |
b283666f | 325 | |
75833a88 FD |
326 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) |
327 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate, | |
328 | ||
329 | TP_PROTO(int classzone_idx, | |
330 | int order, | |
331 | unsigned long nr_requested, | |
332 | unsigned long nr_scanned, | |
333 | unsigned long nr_skipped, | |
334 | unsigned long nr_taken, | |
335 | isolate_mode_t isolate_mode, | |
336 | int lru | |
337 | ), | |
b2641821 | 338 | |
75833a88 FD |
339 | TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_skipped, |
340 | nr_taken, isolate_mode, lru | |
341 | ), | |
342 | ||
343 | TP_FIELDS( | |
344 | ctf_integer(int, classzone_idx, classzone_idx) | |
345 | ctf_integer(int, order, order) | |
346 | ctf_integer(unsigned long, nr_requested, nr_requested) | |
347 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
348 | ctf_integer(unsigned long, nr_skipped, nr_skipped) | |
349 | ctf_integer(unsigned long, nr_taken, nr_taken) | |
350 | ctf_integer(isolate_mode_t, isolate_mode, isolate_mode) | |
351 | ctf_integer(int, lru, lru) | |
352 | ) | |
353 | ) | |
354 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
b2641821 MD |
355 | LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template, |
356 | ||
357 | TP_PROTO(int classzone_idx, | |
358 | int order, | |
359 | unsigned long nr_requested, | |
360 | unsigned long nr_scanned, | |
361 | unsigned long nr_taken, | |
362 | isolate_mode_t isolate_mode, | |
363 | int file | |
364 | ), | |
365 | ||
366 | TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, | |
367 | isolate_mode, file | |
368 | ), | |
369 | ||
370 | ||
371 | TP_FIELDS( | |
372 | ctf_integer(int, classzone_idx, classzone_idx) | |
373 | ctf_integer(int, order, order) | |
374 | ctf_integer(unsigned long, nr_requested, nr_requested) | |
375 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
376 | ctf_integer(unsigned long, nr_taken, nr_taken) | |
377 | ctf_integer(isolate_mode_t, isolate_mode, isolate_mode) | |
378 | ctf_integer(int, file, file) | |
379 | ) | |
380 | ) | |
381 | ||
382 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate, | |
383 | ||
384 | TP_PROTO(int classzone_idx, | |
385 | int order, | |
386 | unsigned long nr_requested, | |
387 | unsigned long nr_scanned, | |
388 | unsigned long nr_taken, | |
389 | isolate_mode_t isolate_mode, | |
390 | int file | |
391 | ), | |
392 | ||
393 | TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, | |
394 | isolate_mode, file | |
395 | ) | |
396 | ||
397 | ) | |
398 | ||
399 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate, | |
400 | ||
401 | TP_PROTO(int classzone_idx, | |
402 | int order, | |
403 | unsigned long nr_requested, | |
404 | unsigned long nr_scanned, | |
405 | unsigned long nr_taken, | |
406 | isolate_mode_t isolate_mode, | |
407 | int file | |
408 | ), | |
409 | ||
410 | TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, | |
411 | isolate_mode, file | |
412 | ) | |
413 | ) | |
b2641821 | 414 | #else |
3bc29f0a | 415 | LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template, |
b283666f PW |
416 | |
417 | TP_PROTO(int order, | |
418 | unsigned long nr_requested, | |
419 | unsigned long nr_scanned, | |
420 | unsigned long nr_taken, | |
7c68b363 | 421 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
b283666f PW |
422 | unsigned long nr_lumpy_taken, |
423 | unsigned long nr_lumpy_dirty, | |
424 | unsigned long nr_lumpy_failed, | |
7c68b363 | 425 | #endif |
b283666f | 426 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |
7c68b363 | 427 | isolate_mode_t isolate_mode |
b283666f PW |
428 | #else |
429 | isolate_mode_t isolate_mode, | |
7c68b363 | 430 | int file |
b283666f | 431 | #endif |
7c68b363 | 432 | ), |
b283666f | 433 | |
7c68b363 AG |
434 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, |
435 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
436 | nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, | |
437 | #endif | |
b283666f | 438 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |
7c68b363 | 439 | isolate_mode |
b283666f | 440 | #else |
7c68b363 | 441 | isolate_mode, file |
b283666f | 442 | #endif |
7c68b363 AG |
443 | ), |
444 | ||
b283666f | 445 | |
f127e61e MD |
446 | TP_FIELDS( |
447 | ctf_integer(int, order, order) | |
448 | ctf_integer(unsigned long, nr_requested, nr_requested) | |
449 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
450 | ctf_integer(unsigned long, nr_taken, nr_taken) | |
7c68b363 | 451 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
f127e61e MD |
452 | ctf_integer(unsigned long, nr_lumpy_taken, nr_lumpy_taken) |
453 | ctf_integer(unsigned long, nr_lumpy_dirty, nr_lumpy_dirty) | |
454 | ctf_integer(unsigned long, nr_lumpy_failed, nr_lumpy_failed) | |
7c68b363 | 455 | #endif |
f127e61e | 456 | ctf_integer(isolate_mode_t, isolate_mode, isolate_mode) |
b283666f | 457 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) |
f127e61e | 458 | ctf_integer(int, file, file) |
b283666f | 459 | #endif |
f127e61e | 460 | ) |
b283666f PW |
461 | ) |
462 | ||
3bc29f0a | 463 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate, |
b283666f PW |
464 | |
465 | TP_PROTO(int order, | |
466 | unsigned long nr_requested, | |
467 | unsigned long nr_scanned, | |
468 | unsigned long nr_taken, | |
469 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
470 | unsigned long nr_lumpy_taken, | |
471 | unsigned long nr_lumpy_dirty, | |
472 | unsigned long nr_lumpy_failed, | |
473 | #endif | |
474 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) | |
7c68b363 | 475 | isolate_mode_t isolate_mode |
b283666f PW |
476 | #else |
477 | isolate_mode_t isolate_mode, | |
7c68b363 | 478 | int file |
b283666f | 479 | #endif |
7c68b363 | 480 | ), |
b283666f | 481 | |
7c68b363 AG |
482 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, |
483 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
484 | nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, | |
485 | #endif | |
b283666f | 486 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |
7c68b363 | 487 | isolate_mode |
b283666f | 488 | #else |
7c68b363 | 489 | isolate_mode, file |
b283666f | 490 | #endif |
7c68b363 | 491 | ) |
b283666f PW |
492 | |
493 | ) | |
494 | ||
3bc29f0a | 495 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate, |
b283666f PW |
496 | |
497 | TP_PROTO(int order, | |
498 | unsigned long nr_requested, | |
499 | unsigned long nr_scanned, | |
500 | unsigned long nr_taken, | |
501 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
502 | unsigned long nr_lumpy_taken, | |
503 | unsigned long nr_lumpy_dirty, | |
504 | unsigned long nr_lumpy_failed, | |
505 | #endif | |
506 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) | |
7c68b363 | 507 | isolate_mode_t isolate_mode |
b283666f PW |
508 | #else |
509 | isolate_mode_t isolate_mode, | |
7c68b363 | 510 | int file |
b283666f | 511 | #endif |
7c68b363 | 512 | ), |
b283666f | 513 | |
7c68b363 AG |
514 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, |
515 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
516 | nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, | |
517 | #endif | |
b283666f | 518 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |
7c68b363 | 519 | isolate_mode |
b283666f | 520 | #else |
7c68b363 | 521 | isolate_mode, file |
b283666f | 522 | #endif |
7c68b363 | 523 | ) |
b283666f | 524 | ) |
b2641821 MD |
525 | #endif |
526 | ||
01e289f7 MD |
527 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) |
528 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, | |
529 | ||
530 | TP_PROTO(struct page *page), | |
531 | ||
532 | TP_ARGS(page), | |
533 | ||
534 | TP_FIELDS( | |
fa91fcac | 535 | ctf_integer_hex(struct page *, page, page) |
01e289f7 MD |
536 | ctf_integer(int, reclaim_flags, trace_reclaim_flags(page)) |
537 | ) | |
538 | ) | |
539 | #else | |
3bc29f0a | 540 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, |
b283666f PW |
541 | |
542 | TP_PROTO(struct page *page, | |
543 | int reclaim_flags), | |
544 | ||
545 | TP_ARGS(page, reclaim_flags), | |
546 | ||
f127e61e | 547 | TP_FIELDS( |
fa91fcac | 548 | ctf_integer_hex(struct page *, page, page) |
f127e61e MD |
549 | ctf_integer(int, reclaim_flags, reclaim_flags) |
550 | ) | |
b283666f | 551 | ) |
01e289f7 MD |
552 | #endif |
553 | ||
00017921 MJ |
554 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) |
555 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, | |
556 | ||
557 | TP_PROTO(int nid, | |
558 | unsigned long nr_scanned, unsigned long nr_reclaimed, | |
559 | struct reclaim_stat *stat, int priority, int file), | |
560 | ||
561 | TP_ARGS(nid, nr_scanned, nr_reclaimed, stat, priority, file), | |
562 | ||
563 | TP_FIELDS( | |
564 | ctf_integer(int, nid, nid) | |
565 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
566 | ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) | |
567 | ctf_integer(unsigned long, nr_dirty, stat->nr_dirty) | |
568 | ctf_integer(unsigned long, nr_writeback, stat->nr_writeback) | |
569 | ctf_integer(unsigned long, nr_congested, stat->nr_congested) | |
570 | ctf_integer(unsigned long, nr_immediate, stat->nr_immediate) | |
571 | ctf_integer(unsigned long, nr_activate, stat->nr_activate) | |
572 | ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep) | |
573 | ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail) | |
574 | ctf_integer(int, priority, priority) | |
575 | ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) | |
576 | ) | |
577 | ) | |
578 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) | |
75833a88 FD |
579 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, |
580 | ||
581 | TP_PROTO(int nid, | |
582 | unsigned long nr_scanned, unsigned long nr_reclaimed, | |
583 | unsigned long nr_dirty, unsigned long nr_writeback, | |
584 | unsigned long nr_congested, unsigned long nr_immediate, | |
585 | unsigned long nr_activate, unsigned long nr_ref_keep, | |
586 | unsigned long nr_unmap_fail, | |
587 | int priority, int file), | |
588 | ||
589 | TP_ARGS(nid, nr_scanned, nr_reclaimed, nr_dirty, nr_writeback, | |
590 | nr_congested, nr_immediate, nr_activate, nr_ref_keep, | |
591 | nr_unmap_fail, priority, file), | |
592 | ||
593 | TP_FIELDS( | |
594 | ctf_integer(int, nid, nid) | |
595 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
596 | ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) | |
597 | ctf_integer(unsigned long, nr_dirty, nr_dirty) | |
598 | ctf_integer(unsigned long, nr_writeback, nr_writeback) | |
599 | ctf_integer(unsigned long, nr_congested, nr_congested) | |
600 | ctf_integer(unsigned long, nr_immediate, nr_immediate) | |
601 | ctf_integer(unsigned long, nr_activate, nr_activate) | |
602 | ctf_integer(unsigned long, nr_ref_keep, nr_ref_keep) | |
603 | ctf_integer(unsigned long, nr_unmap_fail, nr_unmap_fail) | |
604 | ctf_integer(int, priority, priority) | |
605 | ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) | |
606 | ) | |
607 | ) | |
608 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
b2641821 MD |
609 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, |
610 | ||
611 | TP_PROTO(int nid, | |
612 | unsigned long nr_scanned, unsigned long nr_reclaimed, | |
613 | int priority, int file), | |
614 | ||
615 | TP_ARGS(nid, nr_scanned, nr_reclaimed, priority, file), | |
616 | ||
617 | TP_FIELDS( | |
618 | ctf_integer(int, nid, nid) | |
619 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
620 | ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) | |
621 | ctf_integer(int, priority, priority) | |
622 | ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) | |
623 | ) | |
624 | ) | |
625 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) | |
01e289f7 MD |
626 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, |
627 | ||
628 | TP_PROTO(struct zone *zone, | |
629 | unsigned long nr_scanned, unsigned long nr_reclaimed, | |
630 | int priority, int file), | |
b283666f | 631 | |
01e289f7 MD |
632 | TP_ARGS(zone, nr_scanned, nr_reclaimed, priority, file), |
633 | ||
634 | TP_FIELDS( | |
635 | ctf_integer(int, nid, zone_to_nid(zone)) | |
636 | ctf_integer(int, zid, zone_idx(zone)) | |
637 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
638 | ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) | |
639 | ctf_integer(int, priority, priority) | |
640 | ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) | |
641 | ) | |
642 | ) | |
643 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) | |
3bc29f0a | 644 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, |
b283666f PW |
645 | |
646 | TP_PROTO(int nid, int zid, | |
647 | unsigned long nr_scanned, unsigned long nr_reclaimed, | |
648 | int priority, int reclaim_flags), | |
649 | ||
650 | TP_ARGS(nid, zid, nr_scanned, nr_reclaimed, priority, reclaim_flags), | |
651 | ||
f127e61e MD |
652 | TP_FIELDS( |
653 | ctf_integer(int, nid, nid) | |
654 | ctf_integer(int, zid, zid) | |
655 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
656 | ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) | |
657 | ctf_integer(int, priority, priority) | |
658 | ctf_integer(int, reclaim_flags, reclaim_flags) | |
659 | ) | |
b283666f | 660 | ) |
7c68b363 | 661 | #endif |
b283666f PW |
662 | |
663 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
3bc29f0a | 664 | LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token, |
9cf29d3e MD |
665 | |
666 | mm_vmscan_replace_swap_token, | |
667 | ||
b283666f PW |
668 | TP_PROTO(struct mm_struct *old_mm, |
669 | struct mm_struct *new_mm), | |
670 | ||
671 | TP_ARGS(old_mm, new_mm), | |
672 | ||
f127e61e | 673 | TP_FIELDS( |
fa91fcac | 674 | ctf_integer_hex(struct mm_struct *, old_mm, old_mm) |
f127e61e | 675 | ctf_integer(unsigned int, old_prio, old_mm ? old_mm->token_priority : 0) |
fa91fcac | 676 | ctf_integer_hex(struct mm_struct *, new_mm, new_mm) |
f127e61e MD |
677 | ctf_integer(unsigned int, new_prio, new_mm->token_priority) |
678 | ) | |
b283666f PW |
679 | ) |
680 | ||
3bc29f0a | 681 | LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template, |
b283666f PW |
682 | TP_PROTO(struct mm_struct *swap_token_mm), |
683 | ||
684 | TP_ARGS(swap_token_mm), | |
685 | ||
f127e61e | 686 | TP_FIELDS( |
fa91fcac | 687 | ctf_integer_hex(struct mm_struct*, swap_token_mm, swap_token_mm) |
f127e61e | 688 | ) |
b283666f PW |
689 | ) |
690 | ||
3bc29f0a | 691 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, put_swap_token, |
9cf29d3e MD |
692 | |
693 | mm_vmscan_put_swap_token, | |
694 | ||
b283666f PW |
695 | TP_PROTO(struct mm_struct *swap_token_mm), |
696 | TP_ARGS(swap_token_mm) | |
697 | ) | |
698 | ||
f127e61e | 699 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, disable_swap_token, |
9cf29d3e MD |
700 | |
701 | mm_vmscan_disable_swap_token, | |
702 | ||
b283666f | 703 | TP_PROTO(struct mm_struct *swap_token_mm), |
f127e61e | 704 | TP_ARGS(swap_token_mm) |
b283666f PW |
705 | ) |
706 | ||
f127e61e | 707 | LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority, |
9cf29d3e MD |
708 | |
709 | mm_vmscan_update_swap_token_priority, | |
710 | ||
b283666f PW |
711 | TP_PROTO(struct mm_struct *mm, |
712 | unsigned int old_prio, | |
713 | struct mm_struct *swap_token_mm), | |
714 | ||
715 | TP_ARGS(mm, old_prio, swap_token_mm), | |
716 | ||
f127e61e | 717 | TP_FIELDS( |
fa91fcac | 718 | ctf_integer_hex(struct mm_struct *, mm, mm) |
f127e61e MD |
719 | ctf_integer(unsigned int, old_prio, old_prio) |
720 | ctf_integer(unsigned int, new_prio, mm->token_priority) | |
fa91fcac | 721 | ctf_integer_hex(struct mm_struct *, swap_token_mm, swap_token_mm) |
f127e61e MD |
722 | ctf_integer(unsigned int, swap_token_prio, swap_token_mm ? swap_token_mm->token_priority : 0) |
723 | ) | |
b283666f | 724 | ) |
b283666f PW |
725 | #endif |
726 | ||
9bbf98da | 727 | #endif /* LTTNG_TRACE_MM_VMSCAN_H */ |
b283666f PW |
728 | |
729 | /* This part must be outside protection */ | |
6ec43db8 | 730 | #include <probes/define_trace.h> |