diff options
Diffstat (limited to 'include/trace/events/vmscan.h')
-rw-r--r-- | include/trace/events/vmscan.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index ea422aaa23e1..b2c33bd955fa 100644 --- a/include/trace/events/vmscan.h +++ b/include/trace/events/vmscan.h | |||
@@ -6,6 +6,8 @@ | |||
6 | 6 | ||
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
9 | #include <linux/mm.h> | ||
10 | #include <linux/memcontrol.h> | ||
9 | #include "gfpflags.h" | 11 | #include "gfpflags.h" |
10 | 12 | ||
11 | #define RECLAIM_WB_ANON 0x0001u | 13 | #define RECLAIM_WB_ANON 0x0001u |
@@ -310,6 +312,87 @@ TRACE_EVENT(mm_vmscan_lru_shrink_inactive, | |||
310 | show_reclaim_flags(__entry->reclaim_flags)) | 312 | show_reclaim_flags(__entry->reclaim_flags)) |
311 | ); | 313 | ); |
312 | 314 | ||
315 | TRACE_EVENT(replace_swap_token, | ||
316 | TP_PROTO(struct mm_struct *old_mm, | ||
317 | struct mm_struct *new_mm), | ||
318 | |||
319 | TP_ARGS(old_mm, new_mm), | ||
320 | |||
321 | TP_STRUCT__entry( | ||
322 | __field(struct mm_struct*, old_mm) | ||
323 | __field(unsigned int, old_prio) | ||
324 | __field(struct mm_struct*, new_mm) | ||
325 | __field(unsigned int, new_prio) | ||
326 | ), | ||
327 | |||
328 | TP_fast_assign( | ||
329 | __entry->old_mm = old_mm; | ||
330 | __entry->old_prio = old_mm ? old_mm->token_priority : 0; | ||
331 | __entry->new_mm = new_mm; | ||
332 | __entry->new_prio = new_mm->token_priority; | ||
333 | ), | ||
334 | |||
335 | TP_printk("old_token_mm=%p old_prio=%u new_token_mm=%p new_prio=%u", | ||
336 | __entry->old_mm, __entry->old_prio, | ||
337 | __entry->new_mm, __entry->new_prio) | ||
338 | ); | ||
339 | |||
340 | DECLARE_EVENT_CLASS(put_swap_token_template, | ||
341 | TP_PROTO(struct mm_struct *swap_token_mm), | ||
342 | |||
343 | TP_ARGS(swap_token_mm), | ||
344 | |||
345 | TP_STRUCT__entry( | ||
346 | __field(struct mm_struct*, swap_token_mm) | ||
347 | ), | ||
348 | |||
349 | TP_fast_assign( | ||
350 | __entry->swap_token_mm = swap_token_mm; | ||
351 | ), | ||
352 | |||
353 | TP_printk("token_mm=%p", __entry->swap_token_mm) | ||
354 | ); | ||
355 | |||
356 | DEFINE_EVENT(put_swap_token_template, put_swap_token, | ||
357 | TP_PROTO(struct mm_struct *swap_token_mm), | ||
358 | TP_ARGS(swap_token_mm) | ||
359 | ); | ||
360 | |||
361 | DEFINE_EVENT_CONDITION(put_swap_token_template, disable_swap_token, | ||
362 | TP_PROTO(struct mm_struct *swap_token_mm), | ||
363 | TP_ARGS(swap_token_mm), | ||
364 | TP_CONDITION(swap_token_mm != NULL) | ||
365 | ); | ||
366 | |||
367 | TRACE_EVENT_CONDITION(update_swap_token_priority, | ||
368 | TP_PROTO(struct mm_struct *mm, | ||
369 | unsigned int old_prio, | ||
370 | struct mm_struct *swap_token_mm), | ||
371 | |||
372 | TP_ARGS(mm, old_prio, swap_token_mm), | ||
373 | |||
374 | TP_CONDITION(mm->token_priority != old_prio), | ||
375 | |||
376 | TP_STRUCT__entry( | ||
377 | __field(struct mm_struct*, mm) | ||
378 | __field(unsigned int, old_prio) | ||
379 | __field(unsigned int, new_prio) | ||
380 | __field(struct mm_struct*, swap_token_mm) | ||
381 | __field(unsigned int, swap_token_prio) | ||
382 | ), | ||
383 | |||
384 | TP_fast_assign( | ||
385 | __entry->mm = mm; | ||
386 | __entry->old_prio = old_prio; | ||
387 | __entry->new_prio = mm->token_priority; | ||
388 | __entry->swap_token_mm = swap_token_mm; | ||
389 | __entry->swap_token_prio = swap_token_mm ? swap_token_mm->token_priority : 0; | ||
390 | ), | ||
391 | |||
392 | TP_printk("mm=%p old_prio=%u new_prio=%u swap_token_mm=%p token_prio=%u", | ||
393 | __entry->mm, __entry->old_prio, __entry->new_prio, | ||
394 | __entry->swap_token_mm, __entry->swap_token_prio) | ||
395 | ); | ||
313 | 396 | ||
314 | #endif /* _TRACE_VMSCAN_H */ | 397 | #endif /* _TRACE_VMSCAN_H */ |
315 | 398 | ||