diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2011-06-15 18:08:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-15 23:03:59 -0400 |
commit | 83cd81a34357a632509f7491eec81e62e71d65f7 (patch) | |
tree | cc96e65bd3000fd9090dacfabdd8810e9c66e0c9 /include/trace | |
parent | a433658c30974fc87ba3ff52d7e4e6299762aa3d (diff) |
vmscan: implement swap token trace
This is useful for observing swap token activity.
example output:
zsh-1845 [000] 598.962716: update_swap_token_priority:
mm=ffff88015eaf7700 old_prio=1 new_prio=0
memtoy-1830 [001] 602.033900: update_swap_token_priority:
mm=ffff880037a45880 old_prio=947 new_prio=949
memtoy-1830 [000] 602.041509: update_swap_token_priority:
mm=ffff880037a45880 old_prio=949 new_prio=951
memtoy-1830 [000] 602.051959: update_swap_token_priority:
mm=ffff880037a45880 old_prio=951 new_prio=953
memtoy-1830 [000] 602.052188: update_swap_token_priority:
mm=ffff880037a45880 old_prio=953 new_prio=955
memtoy-1830 [001] 602.427184: put_swap_token:
token_mm=ffff880037a45880
zsh-1789 [000] 602.427281: replace_swap_token:
old_token_mm= (null) old_prio=0 new_token_mm=ffff88015eaf7018
new_prio=2
zsh-1789 [001] 602.433456: update_swap_token_priority:
mm=ffff88015eaf7018 old_prio=2 new_prio=4
zsh-1789 [000] 602.437613: update_swap_token_priority:
mm=ffff88015eaf7018 old_prio=4 new_prio=6
zsh-1789 [000] 602.443924: update_swap_token_priority:
mm=ffff88015eaf7018 old_prio=6 new_prio=8
zsh-1789 [000] 602.451873: update_swap_token_priority:
mm=ffff88015eaf7018 old_prio=8 new_prio=10
zsh-1789 [001] 602.462639: update_swap_token_priority:
mm=ffff88015eaf7018 old_prio=10 new_prio=12
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Rik van Riel<riel@redhat.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/vmscan.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index ea422aaa23e1..1798e0cee2a9 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,81 @@ 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 | |||
371 | TP_ARGS(mm, old_prio), | ||
372 | |||
373 | TP_CONDITION(mm->token_priority != old_prio), | ||
374 | |||
375 | TP_STRUCT__entry( | ||
376 | __field(struct mm_struct*, mm) | ||
377 | __field(unsigned int, old_prio) | ||
378 | __field(unsigned int, new_prio) | ||
379 | ), | ||
380 | |||
381 | TP_fast_assign( | ||
382 | __entry->mm = mm; | ||
383 | __entry->old_prio = old_prio; | ||
384 | __entry->new_prio = mm->token_priority; | ||
385 | ), | ||
386 | |||
387 | TP_printk("mm=%p old_prio=%u new_prio=%u", | ||
388 | __entry->mm, __entry->old_prio, __entry->new_prio) | ||
389 | ); | ||
313 | 390 | ||
314 | #endif /* _TRACE_VMSCAN_H */ | 391 | #endif /* _TRACE_VMSCAN_H */ |
315 | 392 | ||