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