fix: mm/vmscan: drop may_writepage and classzone_idx from direct reclaim begin templa...
[lttng-modules.git] / instrumentation / events / lttng-module / mm_vmscan.h
... / ...
CommitLineData
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))
24typedef 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
46LTTNG_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
59LTTNG_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
74LTTNG_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))
89LTTNG_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
103LTTNG_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(5,2,0))
118
119LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template,
120
121 TP_PROTO(int order, gfp_t gfp_flags),
122
123 TP_ARGS(order, gfp_flags),
124
125 TP_FIELDS(
126 ctf_integer(int, order, order)
127 ctf_integer(gfp_t, gfp_flags, gfp_flags)
128 )
129)
130
131LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin,
132
133 TP_PROTO(int order, gfp_t gfp_flags),
134
135 TP_ARGS(order, gfp_flags)
136)
137
138LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin,
139
140 TP_PROTO(int order, gfp_t gfp_flags),
141
142 TP_ARGS(order, gfp_flags)
143)
144
145LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin,
146
147 TP_PROTO(int order, gfp_t gfp_flags),
148
149 TP_ARGS(order, gfp_flags)
150)
151
152#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
153
154LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template,
155
156 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx),
157
158 TP_ARGS(order, may_writepage, gfp_flags, classzone_idx),
159
160 TP_FIELDS(
161 ctf_integer(int, order, order)
162 ctf_integer(int, may_writepage, may_writepage)
163 ctf_integer(gfp_t, gfp_flags, gfp_flags)
164 ctf_integer(int, classzone_idx, classzone_idx)
165 )
166)
167
168LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin,
169
170 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx),
171
172 TP_ARGS(order, may_writepage, gfp_flags, classzone_idx)
173)
174
175LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin,
176
177 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx),
178
179 TP_ARGS(order, may_writepage, gfp_flags, classzone_idx)
180)
181
182LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin,
183
184 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx),
185
186 TP_ARGS(order, may_writepage, gfp_flags, classzone_idx)
187)
188
189#else
190
191LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template,
192
193 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
194
195 TP_ARGS(order, may_writepage, gfp_flags),
196
197 TP_FIELDS(
198 ctf_integer(int, order, order)
199 ctf_integer(int, may_writepage, may_writepage)
200 ctf_integer(gfp_t, gfp_flags, gfp_flags)
201 )
202)
203
204LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin,
205
206 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
207
208 TP_ARGS(order, may_writepage, gfp_flags)
209)
210
211LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin,
212
213 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
214
215 TP_ARGS(order, may_writepage, gfp_flags)
216)
217
218LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin,
219
220 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
221
222 TP_ARGS(order, may_writepage, gfp_flags)
223)
224
225#endif
226
227LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template,
228
229 TP_PROTO(unsigned long nr_reclaimed),
230
231 TP_ARGS(nr_reclaimed),
232
233 TP_FIELDS(
234 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
235 )
236)
237
238LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_direct_reclaim_end,
239
240 TP_PROTO(unsigned long nr_reclaimed),
241
242 TP_ARGS(nr_reclaimed)
243)
244
245LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_reclaim_end,
246
247 TP_PROTO(unsigned long nr_reclaimed),
248
249 TP_ARGS(nr_reclaimed)
250)
251
252LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_reclaim_end,
253
254 TP_PROTO(unsigned long nr_reclaimed),
255
256 TP_ARGS(nr_reclaimed)
257)
258
259#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
260LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start,
261
262 mm_vmscan_shrink_slab_start,
263
264 TP_PROTO(struct shrinker *shr, struct shrink_control *sc,
265 long nr_objects_to_shrink, unsigned long cache_items,
266 unsigned long long delta, unsigned long total_scan,
267 int priority),
268
269 TP_ARGS(shr, sc, nr_objects_to_shrink, cache_items, delta, total_scan,
270 priority),
271
272 TP_FIELDS(
273 ctf_integer_hex(struct shrinker *, shr, shr)
274 ctf_integer_hex(void *, shrink, shr->scan_objects)
275 ctf_integer(int, nid, sc->nid)
276 ctf_integer(long, nr_objects_to_shrink, nr_objects_to_shrink)
277 ctf_integer(gfp_t, gfp_flags, sc->gfp_mask)
278 ctf_integer(unsigned long, cache_items, cache_items)
279 ctf_integer(unsigned long long, delta, delta)
280 ctf_integer(unsigned long, total_scan, total_scan)
281 ctf_integer(int, priority, priority)
282 )
283)
284#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
285LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start,
286
287 mm_vmscan_shrink_slab_start,
288
289 TP_PROTO(struct shrinker *shr, struct shrink_control *sc,
290 long nr_objects_to_shrink, unsigned long pgs_scanned,
291 unsigned long lru_pgs, unsigned long cache_items,
292 unsigned long long delta, unsigned long total_scan),
293
294 TP_ARGS(shr, sc, nr_objects_to_shrink, pgs_scanned, lru_pgs,
295 cache_items, delta, total_scan),
296
297 TP_FIELDS(
298 ctf_integer_hex(struct shrinker *, shr, shr)
299#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
300 ctf_integer_hex(void *, shrink, shr->scan_objects)
301#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
302 ctf_integer_hex(void *, shrink, shr->shrink)
303#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
304 ctf_integer(long, nr_objects_to_shrink, nr_objects_to_shrink)
305 ctf_integer(gfp_t, gfp_flags, sc->gfp_mask)
306 ctf_integer(unsigned long, pgs_scanned, pgs_scanned)
307 ctf_integer(unsigned long, lru_pgs, lru_pgs)
308 ctf_integer(unsigned long, cache_items, cache_items)
309 ctf_integer(unsigned long long, delta, delta)
310 ctf_integer(unsigned long, total_scan, total_scan)
311 )
312)
313#endif
314
315#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
316LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end,
317
318 mm_vmscan_shrink_slab_end,
319
320 TP_PROTO(struct shrinker *shr, int nid, int shrinker_retval,
321 long unused_scan_cnt, long new_scan_cnt, long total_scan),
322
323 TP_ARGS(shr, nid, shrinker_retval, unused_scan_cnt, new_scan_cnt,
324 total_scan),
325
326 TP_FIELDS(
327 ctf_integer_hex(struct shrinker *, shr, shr)
328 ctf_integer(int, nid, nid)
329 ctf_integer_hex(void *, shrink, shr->scan_objects)
330 ctf_integer(long, unused_scan, unused_scan_cnt)
331 ctf_integer(long, new_scan, new_scan_cnt)
332 ctf_integer(int, retval, shrinker_retval)
333 ctf_integer(long, total_scan, total_scan)
334 )
335)
336#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
337LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end,
338
339 mm_vmscan_shrink_slab_end,
340
341 TP_PROTO(struct shrinker *shr, int shrinker_retval,
342 long unused_scan_cnt, long new_scan_cnt),
343
344 TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt),
345
346 TP_FIELDS(
347 ctf_integer_hex(struct shrinker *, shr, shr)
348#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
349 ctf_integer_hex(void *, shrink, shr->scan_objects)
350#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
351 ctf_integer_hex(void *, shrink, shr->shrink)
352#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
353 ctf_integer(long, unused_scan, unused_scan_cnt)
354 ctf_integer(long, new_scan, new_scan_cnt)
355 ctf_integer(int, retval, shrinker_retval)
356 ctf_integer(long, total_scan, new_scan_cnt - unused_scan_cnt)
357 )
358)
359#endif
360
361#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
362LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate,
363
364 TP_PROTO(int classzone_idx,
365 int order,
366 unsigned long nr_requested,
367 unsigned long nr_scanned,
368 unsigned long nr_skipped,
369 unsigned long nr_taken,
370 isolate_mode_t isolate_mode,
371 int lru
372 ),
373
374 TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_skipped,
375 nr_taken, isolate_mode, lru
376 ),
377
378 TP_FIELDS(
379 ctf_integer(int, classzone_idx, classzone_idx)
380 ctf_integer(int, order, order)
381 ctf_integer(unsigned long, nr_requested, nr_requested)
382 ctf_integer(unsigned long, nr_scanned, nr_scanned)
383 ctf_integer(unsigned long, nr_skipped, nr_skipped)
384 ctf_integer(unsigned long, nr_taken, nr_taken)
385 ctf_integer(isolate_mode_t, isolate_mode, isolate_mode)
386 ctf_integer(int, lru, lru)
387 )
388)
389#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
390LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template,
391
392 TP_PROTO(int classzone_idx,
393 int order,
394 unsigned long nr_requested,
395 unsigned long nr_scanned,
396 unsigned long nr_taken,
397 isolate_mode_t isolate_mode,
398 int file
399 ),
400
401 TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken,
402 isolate_mode, file
403 ),
404
405
406 TP_FIELDS(
407 ctf_integer(int, classzone_idx, classzone_idx)
408 ctf_integer(int, order, order)
409 ctf_integer(unsigned long, nr_requested, nr_requested)
410 ctf_integer(unsigned long, nr_scanned, nr_scanned)
411 ctf_integer(unsigned long, nr_taken, nr_taken)
412 ctf_integer(isolate_mode_t, isolate_mode, isolate_mode)
413 ctf_integer(int, file, file)
414 )
415)
416
417LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate,
418
419 TP_PROTO(int classzone_idx,
420 int order,
421 unsigned long nr_requested,
422 unsigned long nr_scanned,
423 unsigned long nr_taken,
424 isolate_mode_t isolate_mode,
425 int file
426 ),
427
428 TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken,
429 isolate_mode, file
430 )
431
432)
433
434LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate,
435
436 TP_PROTO(int classzone_idx,
437 int order,
438 unsigned long nr_requested,
439 unsigned long nr_scanned,
440 unsigned long nr_taken,
441 isolate_mode_t isolate_mode,
442 int file
443 ),
444
445 TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken,
446 isolate_mode, file
447 )
448)
449#else
450LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template,
451
452 TP_PROTO(int order,
453 unsigned long nr_requested,
454 unsigned long nr_scanned,
455 unsigned long nr_taken,
456#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
457 unsigned long nr_lumpy_taken,
458 unsigned long nr_lumpy_dirty,
459 unsigned long nr_lumpy_failed,
460#endif
461#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
462 isolate_mode_t isolate_mode
463#else
464 isolate_mode_t isolate_mode,
465 int file
466#endif
467 ),
468
469 TP_ARGS(order, nr_requested, nr_scanned, nr_taken,
470#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
471 nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed,
472#endif
473#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
474 isolate_mode
475#else
476 isolate_mode, file
477#endif
478 ),
479
480
481 TP_FIELDS(
482 ctf_integer(int, order, order)
483 ctf_integer(unsigned long, nr_requested, nr_requested)
484 ctf_integer(unsigned long, nr_scanned, nr_scanned)
485 ctf_integer(unsigned long, nr_taken, nr_taken)
486#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
487 ctf_integer(unsigned long, nr_lumpy_taken, nr_lumpy_taken)
488 ctf_integer(unsigned long, nr_lumpy_dirty, nr_lumpy_dirty)
489 ctf_integer(unsigned long, nr_lumpy_failed, nr_lumpy_failed)
490#endif
491 ctf_integer(isolate_mode_t, isolate_mode, isolate_mode)
492#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
493 ctf_integer(int, file, file)
494#endif
495 )
496)
497
498LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate,
499
500 TP_PROTO(int order,
501 unsigned long nr_requested,
502 unsigned long nr_scanned,
503 unsigned long nr_taken,
504#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
505 unsigned long nr_lumpy_taken,
506 unsigned long nr_lumpy_dirty,
507 unsigned long nr_lumpy_failed,
508#endif
509#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
510 isolate_mode_t isolate_mode
511#else
512 isolate_mode_t isolate_mode,
513 int file
514#endif
515 ),
516
517 TP_ARGS(order, nr_requested, nr_scanned, nr_taken,
518#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
519 nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed,
520#endif
521#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
522 isolate_mode
523#else
524 isolate_mode, file
525#endif
526 )
527
528)
529
530LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate,
531
532 TP_PROTO(int order,
533 unsigned long nr_requested,
534 unsigned long nr_scanned,
535 unsigned long nr_taken,
536#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
537 unsigned long nr_lumpy_taken,
538 unsigned long nr_lumpy_dirty,
539 unsigned long nr_lumpy_failed,
540#endif
541#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
542 isolate_mode_t isolate_mode
543#else
544 isolate_mode_t isolate_mode,
545 int file
546#endif
547 ),
548
549 TP_ARGS(order, nr_requested, nr_scanned, nr_taken,
550#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
551 nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed,
552#endif
553#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
554 isolate_mode
555#else
556 isolate_mode, file
557#endif
558 )
559)
560#endif
561
562#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
563LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage,
564
565 TP_PROTO(struct page *page),
566
567 TP_ARGS(page),
568
569 TP_FIELDS(
570 ctf_integer_hex(struct page *, page, page)
571 ctf_integer(int, reclaim_flags, trace_reclaim_flags(page))
572 )
573)
574#else
575LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage,
576
577 TP_PROTO(struct page *page,
578 int reclaim_flags),
579
580 TP_ARGS(page, reclaim_flags),
581
582 TP_FIELDS(
583 ctf_integer_hex(struct page *, page, page)
584 ctf_integer(int, reclaim_flags, reclaim_flags)
585 )
586)
587#endif
588
589#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
590LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
591
592 TP_PROTO(int nid,
593 unsigned long nr_scanned, unsigned long nr_reclaimed,
594 struct reclaim_stat *stat, int priority, int file),
595
596 TP_ARGS(nid, nr_scanned, nr_reclaimed, stat, priority, file),
597
598 TP_FIELDS(
599 ctf_integer(int, nid, nid)
600 ctf_integer(unsigned long, nr_scanned, nr_scanned)
601 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
602 ctf_integer(unsigned long, nr_dirty, stat->nr_dirty)
603 ctf_integer(unsigned long, nr_writeback, stat->nr_writeback)
604 ctf_integer(unsigned long, nr_congested, stat->nr_congested)
605 ctf_integer(unsigned long, nr_immediate, stat->nr_immediate)
606 ctf_integer(unsigned long, nr_activate, stat->nr_activate)
607 ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep)
608 ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail)
609 ctf_integer(int, priority, priority)
610 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
611 )
612)
613#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
614LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
615
616 TP_PROTO(int nid,
617 unsigned long nr_scanned, unsigned long nr_reclaimed,
618 unsigned long nr_dirty, unsigned long nr_writeback,
619 unsigned long nr_congested, unsigned long nr_immediate,
620 unsigned long nr_activate, unsigned long nr_ref_keep,
621 unsigned long nr_unmap_fail,
622 int priority, int file),
623
624 TP_ARGS(nid, nr_scanned, nr_reclaimed, nr_dirty, nr_writeback,
625 nr_congested, nr_immediate, nr_activate, nr_ref_keep,
626 nr_unmap_fail, priority, file),
627
628 TP_FIELDS(
629 ctf_integer(int, nid, nid)
630 ctf_integer(unsigned long, nr_scanned, nr_scanned)
631 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
632 ctf_integer(unsigned long, nr_dirty, nr_dirty)
633 ctf_integer(unsigned long, nr_writeback, nr_writeback)
634 ctf_integer(unsigned long, nr_congested, nr_congested)
635 ctf_integer(unsigned long, nr_immediate, nr_immediate)
636 ctf_integer(unsigned long, nr_activate, nr_activate)
637 ctf_integer(unsigned long, nr_ref_keep, nr_ref_keep)
638 ctf_integer(unsigned long, nr_unmap_fail, nr_unmap_fail)
639 ctf_integer(int, priority, priority)
640 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
641 )
642)
643#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
644LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
645
646 TP_PROTO(int nid,
647 unsigned long nr_scanned, unsigned long nr_reclaimed,
648 int priority, int file),
649
650 TP_ARGS(nid, nr_scanned, nr_reclaimed, priority, file),
651
652 TP_FIELDS(
653 ctf_integer(int, nid, nid)
654 ctf_integer(unsigned long, nr_scanned, nr_scanned)
655 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
656 ctf_integer(int, priority, priority)
657 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
658 )
659)
660#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
661LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
662
663 TP_PROTO(struct zone *zone,
664 unsigned long nr_scanned, unsigned long nr_reclaimed,
665 int priority, int file),
666
667 TP_ARGS(zone, nr_scanned, nr_reclaimed, priority, file),
668
669 TP_FIELDS(
670 ctf_integer(int, nid, zone_to_nid(zone))
671 ctf_integer(int, zid, zone_idx(zone))
672 ctf_integer(unsigned long, nr_scanned, nr_scanned)
673 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
674 ctf_integer(int, priority, priority)
675 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
676 )
677)
678#else
679LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
680
681 TP_PROTO(int nid, int zid,
682 unsigned long nr_scanned, unsigned long nr_reclaimed,
683 int priority, int reclaim_flags),
684
685 TP_ARGS(nid, zid, nr_scanned, nr_reclaimed, priority, reclaim_flags),
686
687 TP_FIELDS(
688 ctf_integer(int, nid, nid)
689 ctf_integer(int, zid, zid)
690 ctf_integer(unsigned long, nr_scanned, nr_scanned)
691 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
692 ctf_integer(int, priority, priority)
693 ctf_integer(int, reclaim_flags, reclaim_flags)
694 )
695)
696#endif
697
698#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
699LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token,
700
701 mm_vmscan_replace_swap_token,
702
703 TP_PROTO(struct mm_struct *old_mm,
704 struct mm_struct *new_mm),
705
706 TP_ARGS(old_mm, new_mm),
707
708 TP_FIELDS(
709 ctf_integer_hex(struct mm_struct *, old_mm, old_mm)
710 ctf_integer(unsigned int, old_prio, old_mm ? old_mm->token_priority : 0)
711 ctf_integer_hex(struct mm_struct *, new_mm, new_mm)
712 ctf_integer(unsigned int, new_prio, new_mm->token_priority)
713 )
714)
715
716LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template,
717 TP_PROTO(struct mm_struct *swap_token_mm),
718
719 TP_ARGS(swap_token_mm),
720
721 TP_FIELDS(
722 ctf_integer_hex(struct mm_struct*, swap_token_mm, swap_token_mm)
723 )
724)
725
726LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, put_swap_token,
727
728 mm_vmscan_put_swap_token,
729
730 TP_PROTO(struct mm_struct *swap_token_mm),
731 TP_ARGS(swap_token_mm)
732)
733
734LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, disable_swap_token,
735
736 mm_vmscan_disable_swap_token,
737
738 TP_PROTO(struct mm_struct *swap_token_mm),
739 TP_ARGS(swap_token_mm)
740)
741
742LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority,
743
744 mm_vmscan_update_swap_token_priority,
745
746 TP_PROTO(struct mm_struct *mm,
747 unsigned int old_prio,
748 struct mm_struct *swap_token_mm),
749
750 TP_ARGS(mm, old_prio, swap_token_mm),
751
752 TP_FIELDS(
753 ctf_integer_hex(struct mm_struct *, mm, mm)
754 ctf_integer(unsigned int, old_prio, old_prio)
755 ctf_integer(unsigned int, new_prio, mm->token_priority)
756 ctf_integer_hex(struct mm_struct *, swap_token_mm, swap_token_mm)
757 ctf_integer(unsigned int, swap_token_prio, swap_token_mm ? swap_token_mm->token_priority : 0)
758 )
759)
760#endif
761
762#endif /* LTTNG_TRACE_MM_VMSCAN_H */
763
764/* This part must be outside protection */
765#include <probes/define_trace.h>
This page took 0.024786 seconds and 4 git commands to generate.