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