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