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