2 #define TRACE_SYSTEM nilfs2
4 #if !defined(_TRACE_NILFS2_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_NILFS2_H
7 #include <linux/tracepoint.h>
11 #define show_collection_stage(type) \
12 __print_symbolic(type, \
13 { NILFS_ST_INIT, "ST_INIT" }, \
14 { NILFS_ST_GC, "ST_GC" }, \
15 { NILFS_ST_FILE, "ST_FILE" }, \
16 { NILFS_ST_IFILE, "ST_IFILE" }, \
17 { NILFS_ST_CPFILE, "ST_CPFILE" }, \
18 { NILFS_ST_SUFILE, "ST_SUFILE" }, \
19 { NILFS_ST_DAT, "ST_DAT" }, \
20 { NILFS_ST_SR, "ST_SR" }, \
21 { NILFS_ST_DSYNC, "ST_DSYNC" }, \
22 { NILFS_ST_DONE, "ST_DONE"})
24 TRACE_EVENT(nilfs2_collection_stage_transition
,
26 TP_PROTO(struct nilfs_sc_info
*sci
),
37 __entry
->stage
= sci
->sc_stage
.scnt
;
40 TP_printk("sci = %p stage = %s",
42 show_collection_stage(__entry
->stage
))
45 #ifndef TRACE_HEADER_MULTI_READ
46 enum nilfs2_transaction_transition_state
{
47 TRACE_NILFS2_TRANSACTION_BEGIN
,
48 TRACE_NILFS2_TRANSACTION_COMMIT
,
49 TRACE_NILFS2_TRANSACTION_ABORT
,
50 TRACE_NILFS2_TRANSACTION_TRYLOCK
,
51 TRACE_NILFS2_TRANSACTION_LOCK
,
52 TRACE_NILFS2_TRANSACTION_UNLOCK
,
56 #define show_transaction_state(type) \
57 __print_symbolic(type, \
58 { TRACE_NILFS2_TRANSACTION_BEGIN, "BEGIN" }, \
59 { TRACE_NILFS2_TRANSACTION_COMMIT, "COMMIT" }, \
60 { TRACE_NILFS2_TRANSACTION_ABORT, "ABORT" }, \
61 { TRACE_NILFS2_TRANSACTION_TRYLOCK, "TRYLOCK" }, \
62 { TRACE_NILFS2_TRANSACTION_LOCK, "LOCK" }, \
63 { TRACE_NILFS2_TRANSACTION_UNLOCK, "UNLOCK" })
65 TRACE_EVENT(nilfs2_transaction_transition
,
66 TP_PROTO(struct super_block
*sb
,
67 struct nilfs_transaction_info
*ti
,
70 enum nilfs2_transaction_transition_state state
),
72 TP_ARGS(sb
, ti
, count
, flags
, state
),
78 __field(unsigned int, flags
)
85 __entry
->count
= count
;
86 __entry
->flags
= flags
;
87 __entry
->state
= state
;
90 TP_printk("sb = %p ti = %p count = %d flags = %x state = %s",
95 show_transaction_state(__entry
->state
))
98 TRACE_EVENT(nilfs2_segment_usage_check
,
99 TP_PROTO(struct inode
*sufile
,
103 TP_ARGS(sufile
, segnum
, cnt
),
106 __field(struct inode
*, sufile
)
107 __field(__u64
, segnum
)
108 __field(unsigned long, cnt
)
112 __entry
->sufile
= sufile
;
113 __entry
->segnum
= segnum
;
117 TP_printk("sufile = %p segnum = %llu cnt = %lu",
123 TRACE_EVENT(nilfs2_segment_usage_allocated
,
124 TP_PROTO(struct inode
*sufile
,
127 TP_ARGS(sufile
, segnum
),
130 __field(struct inode
*, sufile
)
131 __field(__u64
, segnum
)
135 __entry
->sufile
= sufile
;
136 __entry
->segnum
= segnum
;
139 TP_printk("sufile = %p segnum = %llu",
144 TRACE_EVENT(nilfs2_segment_usage_freed
,
145 TP_PROTO(struct inode
*sufile
,
148 TP_ARGS(sufile
, segnum
),
151 __field(struct inode
*, sufile
)
152 __field(__u64
, segnum
)
156 __entry
->sufile
= sufile
;
157 __entry
->segnum
= segnum
;
160 TP_printk("sufile = %p segnum = %llu",
165 TRACE_EVENT(nilfs2_mdt_insert_new_block
,
166 TP_PROTO(struct inode
*inode
,
168 unsigned long block
),
170 TP_ARGS(inode
, ino
, block
),
173 __field(struct inode
*, inode
)
174 __field(unsigned long, ino
)
175 __field(unsigned long, block
)
179 __entry
->inode
= inode
;
181 __entry
->block
= block
;
184 TP_printk("inode = %p ino = %lu block = %lu",
190 TRACE_EVENT(nilfs2_mdt_submit_block
,
191 TP_PROTO(struct inode
*inode
,
193 unsigned long blkoff
,
196 TP_ARGS(inode
, ino
, blkoff
, mode
),
199 __field(struct inode
*, inode
)
200 __field(unsigned long, ino
)
201 __field(unsigned long, blkoff
)
206 __entry
->inode
= inode
;
208 __entry
->blkoff
= blkoff
;
209 __entry
->mode
= mode
;
212 TP_printk("inode = %p ino = %lu blkoff = %lu mode = %x",
219 #endif /* _TRACE_NILFS2_H */
221 /* This part must be outside protection */
222 #undef TRACE_INCLUDE_FILE
223 #define TRACE_INCLUDE_FILE nilfs2
224 #include <trace/define_trace.h>