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