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