2d052cb91cbfff7e4ab32b3f581606ee2eef1a59
[lttng-modules.git] / instrumentation / events / lttng-module / mm_vmscan.h
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM mm_vmscan
3
4 #if !defined(LTTNG_TRACE_MM_VMSCAN_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define LTTNG_TRACE_MM_VMSCAN_H
6
7 #include <probes/lttng-tracepoint-event.h>
8 #include <linux/types.h>
9 #include <linux/mm.h>
10 #include <linux/memcontrol.h>
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
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
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))
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
54 LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_sleep,
55
56 TP_PROTO(int nid),
57
58 TP_ARGS(nid),
59
60 TP_FIELDS(
61 ctf_integer(int, nid, nid)
62 )
63 )
64
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
82 LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake,
83
84 TP_PROTO(int nid, int order),
85
86 TP_ARGS(nid, order),
87
88 TP_FIELDS(
89 ctf_integer(int, nid, nid)
90 ctf_integer(int, order, order)
91 )
92 )
93
94 #endif
95
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
111 LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd,
112
113 TP_PROTO(int nid, int zid, int order),
114
115 TP_ARGS(nid, zid, order),
116
117 TP_FIELDS(
118 ctf_integer(int, nid, nid)
119 ctf_integer(int, zid, zid)
120 ctf_integer(int, order, order)
121 )
122 )
123 #endif
124
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))
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
199 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template,
200
201 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
202
203 TP_ARGS(order, may_writepage, gfp_flags),
204
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 )
210 )
211
212 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin,
213
214 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
215
216 TP_ARGS(order, may_writepage, gfp_flags)
217 )
218
219 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin,
220
221 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
222
223 TP_ARGS(order, may_writepage, gfp_flags)
224 )
225
226 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin,
227
228 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
229
230 TP_ARGS(order, may_writepage, gfp_flags)
231 )
232
233 #endif
234
235 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template,
236
237 TP_PROTO(unsigned long nr_reclaimed),
238
239 TP_ARGS(nr_reclaimed),
240
241 TP_FIELDS(
242 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
243 )
244 )
245
246 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_direct_reclaim_end,
247
248 TP_PROTO(unsigned long nr_reclaimed),
249
250 TP_ARGS(nr_reclaimed)
251 )
252
253 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_reclaim_end,
254
255 TP_PROTO(unsigned long nr_reclaimed),
256
257 TP_ARGS(nr_reclaimed)
258 )
259
260 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_reclaim_end,
261
262 TP_PROTO(unsigned long nr_reclaimed),
263
264 TP_ARGS(nr_reclaimed)
265 )
266
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))
293 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start,
294
295 mm_vmscan_shrink_slab_start,
296
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
305 TP_FIELDS(
306 ctf_integer_hex(struct shrinker *, shr, shr)
307 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
308 ctf_integer_hex(void *, shrink, shr->scan_objects)
309 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
310 ctf_integer_hex(void *, shrink, shr->shrink)
311 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
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 )
320 )
321 #endif
322
323 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
324 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end,
325
326 mm_vmscan_shrink_slab_end,
327
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
334 TP_FIELDS(
335 ctf_integer_hex(struct shrinker *, shr, shr)
336 ctf_integer(int, nid, nid)
337 ctf_integer_hex(void *, shrink, shr->scan_objects)
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 )
343 )
344 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
345 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end,
346
347 mm_vmscan_shrink_slab_end,
348
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
354 TP_FIELDS(
355 ctf_integer_hex(struct shrinker *, shr, shr)
356 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
357 ctf_integer_hex(void *, shrink, shr->scan_objects)
358 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
359 ctf_integer_hex(void *, shrink, shr->shrink)
360 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
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 )
366 )
367 #endif
368
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 ),
381
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))
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 )
457 #else
458 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template,
459
460 TP_PROTO(int order,
461 unsigned long nr_requested,
462 unsigned long nr_scanned,
463 unsigned long nr_taken,
464 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
465 unsigned long nr_lumpy_taken,
466 unsigned long nr_lumpy_dirty,
467 unsigned long nr_lumpy_failed,
468 #endif
469 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
470 isolate_mode_t isolate_mode
471 #else
472 isolate_mode_t isolate_mode,
473 int file
474 #endif
475 ),
476
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
481 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
482 isolate_mode
483 #else
484 isolate_mode, file
485 #endif
486 ),
487
488
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)
494 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
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)
498 #endif
499 ctf_integer(isolate_mode_t, isolate_mode, isolate_mode)
500 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
501 ctf_integer(int, file, file)
502 #endif
503 )
504 )
505
506 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate,
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))
518 isolate_mode_t isolate_mode
519 #else
520 isolate_mode_t isolate_mode,
521 int file
522 #endif
523 ),
524
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
529 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
530 isolate_mode
531 #else
532 isolate_mode, file
533 #endif
534 )
535
536 )
537
538 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate,
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))
550 isolate_mode_t isolate_mode
551 #else
552 isolate_mode_t isolate_mode,
553 int file
554 #endif
555 ),
556
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
561 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
562 isolate_mode
563 #else
564 isolate_mode, file
565 #endif
566 )
567 )
568 #endif
569
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))
584 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage,
585
586 TP_PROTO(struct page *page),
587
588 TP_ARGS(page),
589
590 TP_FIELDS(
591 ctf_integer_hex(struct page *, page, page)
592 ctf_integer(int, reclaim_flags, trace_reclaim_flags(page))
593 )
594 )
595 #else
596 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage,
597
598 TP_PROTO(struct page *page,
599 int reclaim_flags),
600
601 TP_ARGS(page, reclaim_flags),
602
603 TP_FIELDS(
604 ctf_integer_hex(struct page *, page, page)
605 ctf_integer(int, reclaim_flags, reclaim_flags)
606 )
607 )
608 #endif
609
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)
627 ctf_integer(unsigned long, nr_activate, stat->nr_activate)
628 ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep)
629 ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail)
630 ctf_integer(int, priority, priority)
631 ctf_integer(int, reclaim_flags, trace_reclaim_flags(file))
632 )
633 )
634 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
635 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
636
637 TP_PROTO(int nid,
638 unsigned long nr_scanned, unsigned long nr_reclaimed,
639 struct reclaim_stat *stat, int priority, int file),
640
641 TP_ARGS(nid, nr_scanned, nr_reclaimed, stat, priority, file),
642
643 TP_FIELDS(
644 ctf_integer(int, nid, nid)
645 ctf_integer(unsigned long, nr_scanned, nr_scanned)
646 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
647 ctf_integer(unsigned long, nr_dirty, stat->nr_dirty)
648 ctf_integer(unsigned long, nr_writeback, stat->nr_writeback)
649 ctf_integer(unsigned long, nr_congested, stat->nr_congested)
650 ctf_integer(unsigned long, nr_immediate, stat->nr_immediate)
651 ctf_integer(unsigned long, nr_activate, stat->nr_activate)
652 ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep)
653 ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail)
654 ctf_integer(int, priority, priority)
655 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
656 )
657 )
658 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
659 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
660
661 TP_PROTO(int nid,
662 unsigned long nr_scanned, unsigned long nr_reclaimed,
663 unsigned long nr_dirty, unsigned long nr_writeback,
664 unsigned long nr_congested, unsigned long nr_immediate,
665 unsigned long nr_activate, unsigned long nr_ref_keep,
666 unsigned long nr_unmap_fail,
667 int priority, int file),
668
669 TP_ARGS(nid, nr_scanned, nr_reclaimed, nr_dirty, nr_writeback,
670 nr_congested, nr_immediate, nr_activate, nr_ref_keep,
671 nr_unmap_fail, priority, file),
672
673 TP_FIELDS(
674 ctf_integer(int, nid, nid)
675 ctf_integer(unsigned long, nr_scanned, nr_scanned)
676 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
677 ctf_integer(unsigned long, nr_dirty, nr_dirty)
678 ctf_integer(unsigned long, nr_writeback, nr_writeback)
679 ctf_integer(unsigned long, nr_congested, nr_congested)
680 ctf_integer(unsigned long, nr_immediate, nr_immediate)
681 ctf_integer(unsigned long, nr_activate, nr_activate)
682 ctf_integer(unsigned long, nr_ref_keep, nr_ref_keep)
683 ctf_integer(unsigned long, nr_unmap_fail, nr_unmap_fail)
684 ctf_integer(int, priority, priority)
685 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
686 )
687 )
688 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
689 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
690
691 TP_PROTO(int nid,
692 unsigned long nr_scanned, unsigned long nr_reclaimed,
693 int priority, int file),
694
695 TP_ARGS(nid, nr_scanned, nr_reclaimed, priority, file),
696
697 TP_FIELDS(
698 ctf_integer(int, nid, nid)
699 ctf_integer(unsigned long, nr_scanned, nr_scanned)
700 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
701 ctf_integer(int, priority, priority)
702 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
703 )
704 )
705 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
706 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
707
708 TP_PROTO(struct zone *zone,
709 unsigned long nr_scanned, unsigned long nr_reclaimed,
710 int priority, int file),
711
712 TP_ARGS(zone, nr_scanned, nr_reclaimed, priority, file),
713
714 TP_FIELDS(
715 ctf_integer(int, nid, zone_to_nid(zone))
716 ctf_integer(int, zid, zone_idx(zone))
717 ctf_integer(unsigned long, nr_scanned, nr_scanned)
718 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
719 ctf_integer(int, priority, priority)
720 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
721 )
722 )
723 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
724 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
725
726 TP_PROTO(int nid, int zid,
727 unsigned long nr_scanned, unsigned long nr_reclaimed,
728 int priority, int reclaim_flags),
729
730 TP_ARGS(nid, zid, nr_scanned, nr_reclaimed, priority, reclaim_flags),
731
732 TP_FIELDS(
733 ctf_integer(int, nid, nid)
734 ctf_integer(int, zid, zid)
735 ctf_integer(unsigned long, nr_scanned, nr_scanned)
736 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
737 ctf_integer(int, priority, priority)
738 ctf_integer(int, reclaim_flags, reclaim_flags)
739 )
740 )
741 #endif
742
743 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
744 LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token,
745
746 mm_vmscan_replace_swap_token,
747
748 TP_PROTO(struct mm_struct *old_mm,
749 struct mm_struct *new_mm),
750
751 TP_ARGS(old_mm, new_mm),
752
753 TP_FIELDS(
754 ctf_integer_hex(struct mm_struct *, old_mm, old_mm)
755 ctf_integer(unsigned int, old_prio, old_mm ? old_mm->token_priority : 0)
756 ctf_integer_hex(struct mm_struct *, new_mm, new_mm)
757 ctf_integer(unsigned int, new_prio, new_mm->token_priority)
758 )
759 )
760
761 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template,
762 TP_PROTO(struct mm_struct *swap_token_mm),
763
764 TP_ARGS(swap_token_mm),
765
766 TP_FIELDS(
767 ctf_integer_hex(struct mm_struct*, swap_token_mm, swap_token_mm)
768 )
769 )
770
771 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, put_swap_token,
772
773 mm_vmscan_put_swap_token,
774
775 TP_PROTO(struct mm_struct *swap_token_mm),
776 TP_ARGS(swap_token_mm)
777 )
778
779 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, disable_swap_token,
780
781 mm_vmscan_disable_swap_token,
782
783 TP_PROTO(struct mm_struct *swap_token_mm),
784 TP_ARGS(swap_token_mm)
785 )
786
787 LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority,
788
789 mm_vmscan_update_swap_token_priority,
790
791 TP_PROTO(struct mm_struct *mm,
792 unsigned int old_prio,
793 struct mm_struct *swap_token_mm),
794
795 TP_ARGS(mm, old_prio, swap_token_mm),
796
797 TP_FIELDS(
798 ctf_integer_hex(struct mm_struct *, mm, mm)
799 ctf_integer(unsigned int, old_prio, old_prio)
800 ctf_integer(unsigned int, new_prio, mm->token_priority)
801 ctf_integer_hex(struct mm_struct *, swap_token_mm, swap_token_mm)
802 ctf_integer(unsigned int, swap_token_prio, swap_token_mm ? swap_token_mm->token_priority : 0)
803 )
804 )
805 #endif
806
807 #endif /* LTTNG_TRACE_MM_VMSCAN_H */
808
809 /* This part must be outside protection */
810 #include <probes/define_trace.h>
This page took 0.045628 seconds and 3 git commands to generate.