Commit | Line | Data |
---|---|---|
b283666f | 1 | #undef TRACE_SYSTEM |
9bbf98da | 2 | #define TRACE_SYSTEM mm_vmscan |
b283666f | 3 | |
9bbf98da MD |
4 | #if !defined(LTTNG_TRACE_MM_VMSCAN_H) || defined(TRACE_HEADER_MULTI_READ) |
5 | #define LTTNG_TRACE_MM_VMSCAN_H | |
b283666f | 6 | |
6ec43db8 | 7 | #include <probes/lttng-tracepoint-event.h> |
7c68b363 | 8 | #include <linux/types.h> |
7c68b363 AG |
9 | #include <linux/mm.h> |
10 | #include <linux/memcontrol.h> | |
7c68b363 AG |
11 | #include <linux/version.h> |
12 | ||
13 | #ifndef _TRACE_VMSCAN_DEF | |
14 | #define _TRACE_VMSCAN_DEF | |
15 | #define RECLAIM_WB_ANON 0x0001u | |
16 | #define RECLAIM_WB_FILE 0x0002u | |
17 | #define RECLAIM_WB_MIXED 0x0010u | |
18 | #define RECLAIM_WB_SYNC 0x0004u /* Unused, all reclaim async */ | |
19 | #define RECLAIM_WB_ASYNC 0x0008u | |
20 | ||
7c68b363 AG |
21 | #if ((LINUX_VERSION_CODE <= KERNEL_VERSION(3,0,38)) || \ |
22 | LTTNG_KERNEL_RANGE(3,1,0, 3,2,0)) | |
23 | typedef int isolate_mode_t; | |
24 | #endif | |
25 | ||
26 | #endif | |
27 | ||
62cb41b0 MJ |
28 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) |
29 | ||
30 | #include <linux/mm_inline.h> | |
31 | ||
32 | #define trace_reclaim_flags(file) ( \ | |
33 | (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ | |
34 | (RECLAIM_WB_ASYNC) \ | |
35 | ) | |
36 | ||
37 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) | |
01e289f7 MD |
38 | |
39 | #include <linux/mm_inline.h> | |
40 | ||
41 | #define trace_reclaim_flags(page) ( \ | |
42 | (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ | |
43 | (RECLAIM_WB_ASYNC) \ | |
44 | ) | |
45 | ||
46 | #define trace_shrink_flags(file) \ | |
47 | ( \ | |
48 | (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ | |
49 | (RECLAIM_WB_ASYNC) \ | |
50 | ) | |
51 | ||
52 | #endif | |
53 | ||
3bc29f0a | 54 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_sleep, |
b283666f PW |
55 | |
56 | TP_PROTO(int nid), | |
57 | ||
58 | TP_ARGS(nid), | |
59 | ||
f127e61e MD |
60 | TP_FIELDS( |
61 | ctf_integer(int, nid, nid) | |
62 | ) | |
b283666f PW |
63 | ) |
64 | ||
b2641821 MD |
65 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) |
66 | ||
67 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake, | |
68 | ||
69 | TP_PROTO(int nid, int zid, int order), | |
70 | ||
71 | TP_ARGS(nid, zid, order), | |
72 | ||
73 | TP_FIELDS( | |
74 | ctf_integer(int, nid, nid) | |
75 | ctf_integer(int, zid, zid) | |
76 | ctf_integer(int, order, order) | |
77 | ) | |
78 | ) | |
79 | ||
80 | #else | |
81 | ||
3bc29f0a | 82 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake, |
b283666f PW |
83 | |
84 | TP_PROTO(int nid, int order), | |
85 | ||
86 | TP_ARGS(nid, order), | |
87 | ||
f127e61e MD |
88 | TP_FIELDS( |
89 | ctf_integer(int, nid, nid) | |
90 | ctf_integer(int, order, order) | |
91 | ) | |
b283666f PW |
92 | ) |
93 | ||
b2641821 MD |
94 | #endif |
95 | ||
872fce6c MJ |
96 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) |
97 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd, | |
98 | ||
99 | TP_PROTO(int nid, int zid, int order, gfp_t gfp_flags), | |
100 | ||
101 | TP_ARGS(nid, zid, order, gfp_flags), | |
102 | ||
103 | TP_FIELDS( | |
104 | ctf_integer(int, nid, nid) | |
105 | ctf_integer(int, zid, zid) | |
106 | ctf_integer(int, order, order) | |
107 | ctf_integer(gfp_t, gfp_flags, gfp_flags) | |
108 | ) | |
109 | ) | |
110 | #else | |
3bc29f0a | 111 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd, |
b283666f PW |
112 | |
113 | TP_PROTO(int nid, int zid, int order), | |
114 | ||
115 | TP_ARGS(nid, zid, order), | |
116 | ||
f127e61e MD |
117 | TP_FIELDS( |
118 | ctf_integer(int, nid, nid) | |
119 | ctf_integer(int, zid, zid) | |
120 | ctf_integer(int, order, order) | |
121 | ) | |
b283666f | 122 | ) |
872fce6c | 123 | #endif |
b283666f | 124 | |
cc1ba302 MJ |
125 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) |
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 | ||
160 | #elif (LINUX_VERSION_CODE >= 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 | ||
3721727b MJ |
267 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0)) |
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 | ) | |
292 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) | |
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) |
5465fedd | 307 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
fa91fcac | 308 | ctf_integer_hex(void *, shrink, shr->scan_objects) |
5465fedd | 309 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
fa91fcac | 310 | ctf_integer_hex(void *, shrink, shr->shrink) |
5465fedd | 311 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
f127e61e MD |
312 | ctf_integer(long, nr_objects_to_shrink, nr_objects_to_shrink) |
313 | ctf_integer(gfp_t, gfp_flags, sc->gfp_mask) | |
314 | ctf_integer(unsigned long, pgs_scanned, pgs_scanned) | |
315 | ctf_integer(unsigned long, lru_pgs, lru_pgs) | |
316 | ctf_integer(unsigned long, cache_items, cache_items) | |
317 | ctf_integer(unsigned long long, delta, delta) | |
318 | ctf_integer(unsigned long, total_scan, total_scan) | |
319 | ) | |
b283666f | 320 | ) |
3721727b | 321 | #endif |
b283666f | 322 | |
5defe623 | 323 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) |
9bbf98da MD |
324 | LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end, |
325 | ||
326 | mm_vmscan_shrink_slab_end, | |
327 | ||
5defe623 MD |
328 | TP_PROTO(struct shrinker *shr, int nid, int shrinker_retval, |
329 | long unused_scan_cnt, long new_scan_cnt, long total_scan), | |
330 | ||
331 | TP_ARGS(shr, nid, shrinker_retval, unused_scan_cnt, new_scan_cnt, | |
332 | total_scan), | |
333 | ||
f127e61e | 334 | TP_FIELDS( |
fa91fcac | 335 | ctf_integer_hex(struct shrinker *, shr, shr) |
f127e61e | 336 | ctf_integer(int, nid, nid) |
fa91fcac | 337 | ctf_integer_hex(void *, shrink, shr->scan_objects) |
f127e61e MD |
338 | ctf_integer(long, unused_scan, unused_scan_cnt) |
339 | ctf_integer(long, new_scan, new_scan_cnt) | |
340 | ctf_integer(int, retval, shrinker_retval) | |
341 | ctf_integer(long, total_scan, total_scan) | |
342 | ) | |
5defe623 | 343 | ) |
3721727b | 344 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) |
9bbf98da MD |
345 | LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end, |
346 | ||
347 | mm_vmscan_shrink_slab_end, | |
348 | ||
b283666f PW |
349 | TP_PROTO(struct shrinker *shr, int shrinker_retval, |
350 | long unused_scan_cnt, long new_scan_cnt), | |
351 | ||
352 | TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt), | |
353 | ||
f127e61e | 354 | TP_FIELDS( |
fa91fcac | 355 | ctf_integer_hex(struct shrinker *, shr, shr) |
5465fedd | 356 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
fa91fcac | 357 | ctf_integer_hex(void *, shrink, shr->scan_objects) |
5465fedd | 358 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
fa91fcac | 359 | ctf_integer_hex(void *, shrink, shr->shrink) |
5465fedd | 360 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
f127e61e MD |
361 | ctf_integer(long, unused_scan, unused_scan_cnt) |
362 | ctf_integer(long, new_scan, new_scan_cnt) | |
363 | ctf_integer(int, retval, shrinker_retval) | |
364 | ctf_integer(long, total_scan, new_scan_cnt - unused_scan_cnt) | |
365 | ) | |
b283666f | 366 | ) |
7c68b363 | 367 | #endif |
b283666f | 368 | |
75833a88 FD |
369 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) |
370 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate, | |
371 | ||
372 | TP_PROTO(int classzone_idx, | |
373 | int order, | |
374 | unsigned long nr_requested, | |
375 | unsigned long nr_scanned, | |
376 | unsigned long nr_skipped, | |
377 | unsigned long nr_taken, | |
378 | isolate_mode_t isolate_mode, | |
379 | int lru | |
380 | ), | |
b2641821 | 381 | |
75833a88 FD |
382 | TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_skipped, |
383 | nr_taken, isolate_mode, lru | |
384 | ), | |
385 | ||
386 | TP_FIELDS( | |
387 | ctf_integer(int, classzone_idx, classzone_idx) | |
388 | ctf_integer(int, order, order) | |
389 | ctf_integer(unsigned long, nr_requested, nr_requested) | |
390 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
391 | ctf_integer(unsigned long, nr_skipped, nr_skipped) | |
392 | ctf_integer(unsigned long, nr_taken, nr_taken) | |
393 | ctf_integer(isolate_mode_t, isolate_mode, isolate_mode) | |
394 | ctf_integer(int, lru, lru) | |
395 | ) | |
396 | ) | |
397 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
b2641821 MD |
398 | LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template, |
399 | ||
400 | TP_PROTO(int classzone_idx, | |
401 | int order, | |
402 | unsigned long nr_requested, | |
403 | unsigned long nr_scanned, | |
404 | unsigned long nr_taken, | |
405 | isolate_mode_t isolate_mode, | |
406 | int file | |
407 | ), | |
408 | ||
409 | TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, | |
410 | isolate_mode, file | |
411 | ), | |
412 | ||
413 | ||
414 | TP_FIELDS( | |
415 | ctf_integer(int, classzone_idx, classzone_idx) | |
416 | ctf_integer(int, order, order) | |
417 | ctf_integer(unsigned long, nr_requested, nr_requested) | |
418 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
419 | ctf_integer(unsigned long, nr_taken, nr_taken) | |
420 | ctf_integer(isolate_mode_t, isolate_mode, isolate_mode) | |
421 | ctf_integer(int, file, file) | |
422 | ) | |
423 | ) | |
424 | ||
425 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate, | |
426 | ||
427 | TP_PROTO(int classzone_idx, | |
428 | int order, | |
429 | unsigned long nr_requested, | |
430 | unsigned long nr_scanned, | |
431 | unsigned long nr_taken, | |
432 | isolate_mode_t isolate_mode, | |
433 | int file | |
434 | ), | |
435 | ||
436 | TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, | |
437 | isolate_mode, file | |
438 | ) | |
439 | ||
440 | ) | |
441 | ||
442 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate, | |
443 | ||
444 | TP_PROTO(int classzone_idx, | |
445 | int order, | |
446 | unsigned long nr_requested, | |
447 | unsigned long nr_scanned, | |
448 | unsigned long nr_taken, | |
449 | isolate_mode_t isolate_mode, | |
450 | int file | |
451 | ), | |
452 | ||
453 | TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, | |
454 | isolate_mode, file | |
455 | ) | |
456 | ) | |
b2641821 | 457 | #else |
3bc29f0a | 458 | LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template, |
b283666f PW |
459 | |
460 | TP_PROTO(int order, | |
461 | unsigned long nr_requested, | |
462 | unsigned long nr_scanned, | |
463 | unsigned long nr_taken, | |
7c68b363 | 464 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
b283666f PW |
465 | unsigned long nr_lumpy_taken, |
466 | unsigned long nr_lumpy_dirty, | |
467 | unsigned long nr_lumpy_failed, | |
7c68b363 | 468 | #endif |
b283666f | 469 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |
7c68b363 | 470 | isolate_mode_t isolate_mode |
b283666f PW |
471 | #else |
472 | isolate_mode_t isolate_mode, | |
7c68b363 | 473 | int file |
b283666f | 474 | #endif |
7c68b363 | 475 | ), |
b283666f | 476 | |
7c68b363 AG |
477 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, |
478 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
479 | nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, | |
480 | #endif | |
b283666f | 481 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |
7c68b363 | 482 | isolate_mode |
b283666f | 483 | #else |
7c68b363 | 484 | isolate_mode, file |
b283666f | 485 | #endif |
7c68b363 AG |
486 | ), |
487 | ||
b283666f | 488 | |
f127e61e MD |
489 | TP_FIELDS( |
490 | ctf_integer(int, order, order) | |
491 | ctf_integer(unsigned long, nr_requested, nr_requested) | |
492 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
493 | ctf_integer(unsigned long, nr_taken, nr_taken) | |
7c68b363 | 494 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
f127e61e MD |
495 | ctf_integer(unsigned long, nr_lumpy_taken, nr_lumpy_taken) |
496 | ctf_integer(unsigned long, nr_lumpy_dirty, nr_lumpy_dirty) | |
497 | ctf_integer(unsigned long, nr_lumpy_failed, nr_lumpy_failed) | |
7c68b363 | 498 | #endif |
f127e61e | 499 | ctf_integer(isolate_mode_t, isolate_mode, isolate_mode) |
b283666f | 500 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) |
f127e61e | 501 | ctf_integer(int, file, file) |
b283666f | 502 | #endif |
f127e61e | 503 | ) |
b283666f PW |
504 | ) |
505 | ||
3bc29f0a | 506 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate, |
b283666f PW |
507 | |
508 | TP_PROTO(int order, | |
509 | unsigned long nr_requested, | |
510 | unsigned long nr_scanned, | |
511 | unsigned long nr_taken, | |
512 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
513 | unsigned long nr_lumpy_taken, | |
514 | unsigned long nr_lumpy_dirty, | |
515 | unsigned long nr_lumpy_failed, | |
516 | #endif | |
517 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) | |
7c68b363 | 518 | isolate_mode_t isolate_mode |
b283666f PW |
519 | #else |
520 | isolate_mode_t isolate_mode, | |
7c68b363 | 521 | int file |
b283666f | 522 | #endif |
7c68b363 | 523 | ), |
b283666f | 524 | |
7c68b363 AG |
525 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, |
526 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
527 | nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, | |
528 | #endif | |
b283666f | 529 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |
7c68b363 | 530 | isolate_mode |
b283666f | 531 | #else |
7c68b363 | 532 | isolate_mode, file |
b283666f | 533 | #endif |
7c68b363 | 534 | ) |
b283666f PW |
535 | |
536 | ) | |
537 | ||
3bc29f0a | 538 | LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate, |
b283666f PW |
539 | |
540 | TP_PROTO(int order, | |
541 | unsigned long nr_requested, | |
542 | unsigned long nr_scanned, | |
543 | unsigned long nr_taken, | |
544 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
545 | unsigned long nr_lumpy_taken, | |
546 | unsigned long nr_lumpy_dirty, | |
547 | unsigned long nr_lumpy_failed, | |
548 | #endif | |
549 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) | |
7c68b363 | 550 | isolate_mode_t isolate_mode |
b283666f PW |
551 | #else |
552 | isolate_mode_t isolate_mode, | |
7c68b363 | 553 | int file |
b283666f | 554 | #endif |
7c68b363 | 555 | ), |
b283666f | 556 | |
7c68b363 AG |
557 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, |
558 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
559 | nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, | |
560 | #endif | |
b283666f | 561 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) |
7c68b363 | 562 | isolate_mode |
b283666f | 563 | #else |
7c68b363 | 564 | isolate_mode, file |
b283666f | 565 | #endif |
7c68b363 | 566 | ) |
b283666f | 567 | ) |
b2641821 MD |
568 | #endif |
569 | ||
62cb41b0 MJ |
570 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) |
571 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, | |
572 | ||
573 | TP_PROTO(struct page *page), | |
574 | ||
575 | TP_ARGS(page), | |
576 | ||
577 | TP_FIELDS( | |
578 | ctf_integer_hex(struct page *, page, page) | |
579 | ctf_integer(int, reclaim_flags, trace_reclaim_flags( | |
580 | page_is_file_cache(page))) | |
581 | ) | |
582 | ) | |
583 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) | |
01e289f7 MD |
584 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, |
585 | ||
586 | TP_PROTO(struct page *page), | |
587 | ||
588 | TP_ARGS(page), | |
589 | ||
590 | TP_FIELDS( | |
fa91fcac | 591 | ctf_integer_hex(struct page *, page, page) |
01e289f7 MD |
592 | ctf_integer(int, reclaim_flags, trace_reclaim_flags(page)) |
593 | ) | |
594 | ) | |
595 | #else | |
3bc29f0a | 596 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, |
b283666f PW |
597 | |
598 | TP_PROTO(struct page *page, | |
599 | int reclaim_flags), | |
600 | ||
601 | TP_ARGS(page, reclaim_flags), | |
602 | ||
f127e61e | 603 | TP_FIELDS( |
fa91fcac | 604 | ctf_integer_hex(struct page *, page, page) |
f127e61e MD |
605 | ctf_integer(int, reclaim_flags, reclaim_flags) |
606 | ) | |
b283666f | 607 | ) |
01e289f7 MD |
608 | #endif |
609 | ||
62cb41b0 MJ |
610 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) |
611 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, | |
612 | ||
613 | TP_PROTO(int nid, | |
614 | unsigned long nr_scanned, unsigned long nr_reclaimed, | |
615 | struct reclaim_stat *stat, int priority, int file), | |
616 | ||
617 | TP_ARGS(nid, nr_scanned, nr_reclaimed, stat, priority, file), | |
618 | ||
619 | TP_FIELDS( | |
620 | ctf_integer(int, nid, nid) | |
621 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
622 | ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) | |
623 | ctf_integer(unsigned long, nr_dirty, stat->nr_dirty) | |
624 | ctf_integer(unsigned long, nr_writeback, stat->nr_writeback) | |
625 | ctf_integer(unsigned long, nr_congested, stat->nr_congested) | |
626 | ctf_integer(unsigned long, nr_immediate, stat->nr_immediate) | |
a2a56901 MJ |
627 | ctf_integer(unsigned long, nr_activate_anon, stat->nr_activate[0]) |
628 | ctf_integer(unsigned long, nr_activate_file, stat->nr_activate[1]) | |
62cb41b0 MJ |
629 | ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep) |
630 | ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail) | |
631 | ctf_integer(int, priority, priority) | |
632 | ctf_integer(int, reclaim_flags, trace_reclaim_flags(file)) | |
633 | ) | |
634 | ) | |
635 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) | |
6570d499 MJ |
636 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, |
637 | ||
638 | TP_PROTO(int nid, | |
639 | unsigned long nr_scanned, unsigned long nr_reclaimed, | |
640 | struct reclaim_stat *stat, int priority, int file), | |
641 | ||
642 | TP_ARGS(nid, nr_scanned, nr_reclaimed, stat, priority, file), | |
643 | ||
644 | TP_FIELDS( | |
645 | ctf_integer(int, nid, nid) | |
646 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
647 | ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) | |
648 | ctf_integer(unsigned long, nr_dirty, stat->nr_dirty) | |
649 | ctf_integer(unsigned long, nr_writeback, stat->nr_writeback) | |
650 | ctf_integer(unsigned long, nr_congested, stat->nr_congested) | |
651 | ctf_integer(unsigned long, nr_immediate, stat->nr_immediate) | |
652 | ctf_integer(unsigned long, nr_activate, stat->nr_activate) | |
653 | ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep) | |
654 | ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail) | |
655 | ctf_integer(int, priority, priority) | |
656 | ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) | |
657 | ) | |
658 | ) | |
659 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) | |
75833a88 FD |
660 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, |
661 | ||
662 | TP_PROTO(int nid, | |
663 | unsigned long nr_scanned, unsigned long nr_reclaimed, | |
664 | unsigned long nr_dirty, unsigned long nr_writeback, | |
665 | unsigned long nr_congested, unsigned long nr_immediate, | |
666 | unsigned long nr_activate, unsigned long nr_ref_keep, | |
667 | unsigned long nr_unmap_fail, | |
668 | int priority, int file), | |
669 | ||
670 | TP_ARGS(nid, nr_scanned, nr_reclaimed, nr_dirty, nr_writeback, | |
671 | nr_congested, nr_immediate, nr_activate, nr_ref_keep, | |
672 | nr_unmap_fail, priority, file), | |
673 | ||
674 | TP_FIELDS( | |
675 | ctf_integer(int, nid, nid) | |
676 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
677 | ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) | |
678 | ctf_integer(unsigned long, nr_dirty, nr_dirty) | |
679 | ctf_integer(unsigned long, nr_writeback, nr_writeback) | |
680 | ctf_integer(unsigned long, nr_congested, nr_congested) | |
681 | ctf_integer(unsigned long, nr_immediate, nr_immediate) | |
682 | ctf_integer(unsigned long, nr_activate, nr_activate) | |
683 | ctf_integer(unsigned long, nr_ref_keep, nr_ref_keep) | |
684 | ctf_integer(unsigned long, nr_unmap_fail, nr_unmap_fail) | |
685 | ctf_integer(int, priority, priority) | |
686 | ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) | |
687 | ) | |
688 | ) | |
689 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
b2641821 MD |
690 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, |
691 | ||
692 | TP_PROTO(int nid, | |
693 | unsigned long nr_scanned, unsigned long nr_reclaimed, | |
694 | int priority, int file), | |
695 | ||
696 | TP_ARGS(nid, nr_scanned, nr_reclaimed, priority, file), | |
697 | ||
698 | TP_FIELDS( | |
699 | ctf_integer(int, nid, nid) | |
700 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
701 | ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) | |
702 | ctf_integer(int, priority, priority) | |
703 | ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) | |
704 | ) | |
705 | ) | |
706 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) | |
01e289f7 MD |
707 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, |
708 | ||
709 | TP_PROTO(struct zone *zone, | |
710 | unsigned long nr_scanned, unsigned long nr_reclaimed, | |
711 | int priority, int file), | |
b283666f | 712 | |
01e289f7 MD |
713 | TP_ARGS(zone, nr_scanned, nr_reclaimed, priority, file), |
714 | ||
715 | TP_FIELDS( | |
716 | ctf_integer(int, nid, zone_to_nid(zone)) | |
717 | ctf_integer(int, zid, zone_idx(zone)) | |
718 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
719 | ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) | |
720 | ctf_integer(int, priority, priority) | |
721 | ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) | |
722 | ) | |
723 | ) | |
724 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) | |
3bc29f0a | 725 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, |
b283666f PW |
726 | |
727 | TP_PROTO(int nid, int zid, | |
728 | unsigned long nr_scanned, unsigned long nr_reclaimed, | |
729 | int priority, int reclaim_flags), | |
730 | ||
731 | TP_ARGS(nid, zid, nr_scanned, nr_reclaimed, priority, reclaim_flags), | |
732 | ||
f127e61e MD |
733 | TP_FIELDS( |
734 | ctf_integer(int, nid, nid) | |
735 | ctf_integer(int, zid, zid) | |
736 | ctf_integer(unsigned long, nr_scanned, nr_scanned) | |
737 | ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) | |
738 | ctf_integer(int, priority, priority) | |
739 | ctf_integer(int, reclaim_flags, reclaim_flags) | |
740 | ) | |
b283666f | 741 | ) |
7c68b363 | 742 | #endif |
b283666f PW |
743 | |
744 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
3bc29f0a | 745 | LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token, |
9cf29d3e MD |
746 | |
747 | mm_vmscan_replace_swap_token, | |
748 | ||
b283666f PW |
749 | TP_PROTO(struct mm_struct *old_mm, |
750 | struct mm_struct *new_mm), | |
751 | ||
752 | TP_ARGS(old_mm, new_mm), | |
753 | ||
f127e61e | 754 | TP_FIELDS( |
fa91fcac | 755 | ctf_integer_hex(struct mm_struct *, old_mm, old_mm) |
f127e61e | 756 | ctf_integer(unsigned int, old_prio, old_mm ? old_mm->token_priority : 0) |
fa91fcac | 757 | ctf_integer_hex(struct mm_struct *, new_mm, new_mm) |
f127e61e MD |
758 | ctf_integer(unsigned int, new_prio, new_mm->token_priority) |
759 | ) | |
b283666f PW |
760 | ) |
761 | ||
3bc29f0a | 762 | LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template, |
b283666f PW |
763 | TP_PROTO(struct mm_struct *swap_token_mm), |
764 | ||
765 | TP_ARGS(swap_token_mm), | |
766 | ||
f127e61e | 767 | TP_FIELDS( |
fa91fcac | 768 | ctf_integer_hex(struct mm_struct*, swap_token_mm, swap_token_mm) |
f127e61e | 769 | ) |
b283666f PW |
770 | ) |
771 | ||
3bc29f0a | 772 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, put_swap_token, |
9cf29d3e MD |
773 | |
774 | mm_vmscan_put_swap_token, | |
775 | ||
b283666f PW |
776 | TP_PROTO(struct mm_struct *swap_token_mm), |
777 | TP_ARGS(swap_token_mm) | |
778 | ) | |
779 | ||
f127e61e | 780 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, disable_swap_token, |
9cf29d3e MD |
781 | |
782 | mm_vmscan_disable_swap_token, | |
783 | ||
b283666f | 784 | TP_PROTO(struct mm_struct *swap_token_mm), |
f127e61e | 785 | TP_ARGS(swap_token_mm) |
b283666f PW |
786 | ) |
787 | ||
f127e61e | 788 | LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority, |
9cf29d3e MD |
789 | |
790 | mm_vmscan_update_swap_token_priority, | |
791 | ||
b283666f PW |
792 | TP_PROTO(struct mm_struct *mm, |
793 | unsigned int old_prio, | |
794 | struct mm_struct *swap_token_mm), | |
795 | ||
796 | TP_ARGS(mm, old_prio, swap_token_mm), | |
797 | ||
f127e61e | 798 | TP_FIELDS( |
fa91fcac | 799 | ctf_integer_hex(struct mm_struct *, mm, mm) |
f127e61e MD |
800 | ctf_integer(unsigned int, old_prio, old_prio) |
801 | ctf_integer(unsigned int, new_prio, mm->token_priority) | |
fa91fcac | 802 | ctf_integer_hex(struct mm_struct *, swap_token_mm, swap_token_mm) |
f127e61e MD |
803 | ctf_integer(unsigned int, swap_token_prio, swap_token_mm ? swap_token_mm->token_priority : 0) |
804 | ) | |
b283666f | 805 | ) |
b283666f PW |
806 | #endif |
807 | ||
9bbf98da | 808 | #endif /* LTTNG_TRACE_MM_VMSCAN_H */ |
b283666f PW |
809 | |
810 | /* This part must be outside protection */ | |
6ec43db8 | 811 | #include <probes/define_trace.h> |