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