diff options
author | Namjae Jeon <namjae.jeon@samsung.com> | 2013-04-23 03:42:53 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-04-23 05:15:10 -0400 |
commit | 8e46b3ed11b750a740fec0a313ad9118059fc37b (patch) | |
tree | d6843e692a91a6b6b83d33a22c05098c30dc7e00 /include/trace | |
parent | 848753aa3b19a6513315ca54f22ba1e2732ea94a (diff) |
f2fs: add tracepoints for GC threads
Add tracepoints for tracing the garbage collector
threads in f2fs with status of collection & type.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Pankaj Kumar <pankaj.km@samsung.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
[Jaegeuk: modify slightly to show information]
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/f2fs.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index 924e69aa984f..6f7cf7af8899 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h | |||
@@ -18,6 +18,33 @@ | |||
18 | { WRITE_FLUSH, "WRITE_FLUSH" }, \ | 18 | { WRITE_FLUSH, "WRITE_FLUSH" }, \ |
19 | { WRITE_FUA, "WRITE_FUA" }) | 19 | { WRITE_FUA, "WRITE_FUA" }) |
20 | 20 | ||
21 | #define show_data_type(type) \ | ||
22 | __print_symbolic(type, \ | ||
23 | { CURSEG_HOT_DATA, "Hot DATA" }, \ | ||
24 | { CURSEG_WARM_DATA, "Warm DATA" }, \ | ||
25 | { CURSEG_COLD_DATA, "Cold DATA" }, \ | ||
26 | { CURSEG_HOT_NODE, "Hot NODE" }, \ | ||
27 | { CURSEG_WARM_NODE, "Warm NODE" }, \ | ||
28 | { CURSEG_COLD_NODE, "Cold NODE" }, \ | ||
29 | { NO_CHECK_TYPE, "No TYPE" }) | ||
30 | |||
31 | #define show_gc_type(type) \ | ||
32 | __print_symbolic(type, \ | ||
33 | { FG_GC, "Foreground GC" }, \ | ||
34 | { BG_GC, "Background GC" }) | ||
35 | |||
36 | #define show_alloc_mode(type) \ | ||
37 | __print_symbolic(type, \ | ||
38 | { LFS, "LFS-mode" }, \ | ||
39 | { SSR, "SSR-mode" }) | ||
40 | |||
41 | #define show_victim_policy(type) \ | ||
42 | __print_symbolic(type, \ | ||
43 | { GC_GREEDY, "Greedy" }, \ | ||
44 | { GC_CB, "Cost-Benefit" }) | ||
45 | |||
46 | struct victim_sel_policy; | ||
47 | |||
21 | DECLARE_EVENT_CLASS(f2fs__inode, | 48 | DECLARE_EVENT_CLASS(f2fs__inode, |
22 | 49 | ||
23 | TP_PROTO(struct inode *inode), | 50 | TP_PROTO(struct inode *inode), |
@@ -439,6 +466,54 @@ TRACE_EVENT(f2fs_get_data_block, | |||
439 | __entry->ret) | 466 | __entry->ret) |
440 | ); | 467 | ); |
441 | 468 | ||
469 | TRACE_EVENT(f2fs_get_victim, | ||
470 | |||
471 | TP_PROTO(struct super_block *sb, int type, int gc_type, | ||
472 | struct victim_sel_policy *p, unsigned int pre_victim, | ||
473 | unsigned int prefree, unsigned int free), | ||
474 | |||
475 | TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free), | ||
476 | |||
477 | TP_STRUCT__entry( | ||
478 | __field(dev_t, dev) | ||
479 | __field(int, type) | ||
480 | __field(int, gc_type) | ||
481 | __field(int, alloc_mode) | ||
482 | __field(int, gc_mode) | ||
483 | __field(unsigned int, victim) | ||
484 | __field(unsigned int, ofs_unit) | ||
485 | __field(unsigned int, pre_victim) | ||
486 | __field(unsigned int, prefree) | ||
487 | __field(unsigned int, free) | ||
488 | ), | ||
489 | |||
490 | TP_fast_assign( | ||
491 | __entry->dev = sb->s_dev; | ||
492 | __entry->type = type; | ||
493 | __entry->gc_type = gc_type; | ||
494 | __entry->alloc_mode = p->alloc_mode; | ||
495 | __entry->gc_mode = p->gc_mode; | ||
496 | __entry->victim = p->min_segno; | ||
497 | __entry->ofs_unit = p->ofs_unit; | ||
498 | __entry->pre_victim = pre_victim; | ||
499 | __entry->prefree = prefree; | ||
500 | __entry->free = free; | ||
501 | ), | ||
502 | |||
503 | TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), victim = %u " | ||
504 | "ofs_unit = %u, pre_victim_secno = %d, prefree = %u, free = %u", | ||
505 | show_dev(__entry), | ||
506 | show_data_type(__entry->type), | ||
507 | show_gc_type(__entry->gc_type), | ||
508 | show_alloc_mode(__entry->alloc_mode), | ||
509 | show_victim_policy(__entry->gc_mode), | ||
510 | __entry->victim, | ||
511 | __entry->ofs_unit, | ||
512 | (int)__entry->pre_victim, | ||
513 | __entry->prefree, | ||
514 | __entry->free) | ||
515 | ); | ||
516 | |||
442 | #endif /* _TRACE_F2FS_H */ | 517 | #endif /* _TRACE_F2FS_H */ |
443 | 518 | ||
444 | /* This part must be outside protection */ | 519 | /* This part must be outside protection */ |