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