0001
0002 #undef TRACE_SYSTEM
0003 #define TRACE_SYSTEM nilfs2
0004
0005 #if !defined(_TRACE_NILFS2_H) || defined(TRACE_HEADER_MULTI_READ)
0006 #define _TRACE_NILFS2_H
0007
0008 #include <linux/tracepoint.h>
0009
0010 struct nilfs_sc_info;
0011
0012 #define show_collection_stage(type) \
0013 __print_symbolic(type, \
0014 { NILFS_ST_INIT, "ST_INIT" }, \
0015 { NILFS_ST_GC, "ST_GC" }, \
0016 { NILFS_ST_FILE, "ST_FILE" }, \
0017 { NILFS_ST_IFILE, "ST_IFILE" }, \
0018 { NILFS_ST_CPFILE, "ST_CPFILE" }, \
0019 { NILFS_ST_SUFILE, "ST_SUFILE" }, \
0020 { NILFS_ST_DAT, "ST_DAT" }, \
0021 { NILFS_ST_SR, "ST_SR" }, \
0022 { NILFS_ST_DSYNC, "ST_DSYNC" }, \
0023 { NILFS_ST_DONE, "ST_DONE"})
0024
0025 TRACE_EVENT(nilfs2_collection_stage_transition,
0026
0027 TP_PROTO(struct nilfs_sc_info *sci),
0028
0029 TP_ARGS(sci),
0030
0031 TP_STRUCT__entry(
0032 __field(void *, sci)
0033 __field(int, stage)
0034 ),
0035
0036 TP_fast_assign(
0037 __entry->sci = sci;
0038 __entry->stage = sci->sc_stage.scnt;
0039 ),
0040
0041 TP_printk("sci = %p stage = %s",
0042 __entry->sci,
0043 show_collection_stage(__entry->stage))
0044 );
0045
0046 #ifndef TRACE_HEADER_MULTI_READ
0047 enum nilfs2_transaction_transition_state {
0048 TRACE_NILFS2_TRANSACTION_BEGIN,
0049 TRACE_NILFS2_TRANSACTION_COMMIT,
0050 TRACE_NILFS2_TRANSACTION_ABORT,
0051 TRACE_NILFS2_TRANSACTION_TRYLOCK,
0052 TRACE_NILFS2_TRANSACTION_LOCK,
0053 TRACE_NILFS2_TRANSACTION_UNLOCK,
0054 };
0055 #endif
0056
0057 #define show_transaction_state(type) \
0058 __print_symbolic(type, \
0059 { TRACE_NILFS2_TRANSACTION_BEGIN, "BEGIN" }, \
0060 { TRACE_NILFS2_TRANSACTION_COMMIT, "COMMIT" }, \
0061 { TRACE_NILFS2_TRANSACTION_ABORT, "ABORT" }, \
0062 { TRACE_NILFS2_TRANSACTION_TRYLOCK, "TRYLOCK" }, \
0063 { TRACE_NILFS2_TRANSACTION_LOCK, "LOCK" }, \
0064 { TRACE_NILFS2_TRANSACTION_UNLOCK, "UNLOCK" })
0065
0066 TRACE_EVENT(nilfs2_transaction_transition,
0067 TP_PROTO(struct super_block *sb,
0068 struct nilfs_transaction_info *ti,
0069 int count,
0070 unsigned int flags,
0071 enum nilfs2_transaction_transition_state state),
0072
0073 TP_ARGS(sb, ti, count, flags, state),
0074
0075 TP_STRUCT__entry(
0076 __field(void *, sb)
0077 __field(void *, ti)
0078 __field(int, count)
0079 __field(unsigned int, flags)
0080 __field(int, state)
0081 ),
0082
0083 TP_fast_assign(
0084 __entry->sb = sb;
0085 __entry->ti = ti;
0086 __entry->count = count;
0087 __entry->flags = flags;
0088 __entry->state = state;
0089 ),
0090
0091 TP_printk("sb = %p ti = %p count = %d flags = %x state = %s",
0092 __entry->sb,
0093 __entry->ti,
0094 __entry->count,
0095 __entry->flags,
0096 show_transaction_state(__entry->state))
0097 );
0098
0099 TRACE_EVENT(nilfs2_segment_usage_check,
0100 TP_PROTO(struct inode *sufile,
0101 __u64 segnum,
0102 unsigned long cnt),
0103
0104 TP_ARGS(sufile, segnum, cnt),
0105
0106 TP_STRUCT__entry(
0107 __field(struct inode *, sufile)
0108 __field(__u64, segnum)
0109 __field(unsigned long, cnt)
0110 ),
0111
0112 TP_fast_assign(
0113 __entry->sufile = sufile;
0114 __entry->segnum = segnum;
0115 __entry->cnt = cnt;
0116 ),
0117
0118 TP_printk("sufile = %p segnum = %llu cnt = %lu",
0119 __entry->sufile,
0120 __entry->segnum,
0121 __entry->cnt)
0122 );
0123
0124 TRACE_EVENT(nilfs2_segment_usage_allocated,
0125 TP_PROTO(struct inode *sufile,
0126 __u64 segnum),
0127
0128 TP_ARGS(sufile, segnum),
0129
0130 TP_STRUCT__entry(
0131 __field(struct inode *, sufile)
0132 __field(__u64, segnum)
0133 ),
0134
0135 TP_fast_assign(
0136 __entry->sufile = sufile;
0137 __entry->segnum = segnum;
0138 ),
0139
0140 TP_printk("sufile = %p segnum = %llu",
0141 __entry->sufile,
0142 __entry->segnum)
0143 );
0144
0145 TRACE_EVENT(nilfs2_segment_usage_freed,
0146 TP_PROTO(struct inode *sufile,
0147 __u64 segnum),
0148
0149 TP_ARGS(sufile, segnum),
0150
0151 TP_STRUCT__entry(
0152 __field(struct inode *, sufile)
0153 __field(__u64, segnum)
0154 ),
0155
0156 TP_fast_assign(
0157 __entry->sufile = sufile;
0158 __entry->segnum = segnum;
0159 ),
0160
0161 TP_printk("sufile = %p segnum = %llu",
0162 __entry->sufile,
0163 __entry->segnum)
0164 );
0165
0166 TRACE_EVENT(nilfs2_mdt_insert_new_block,
0167 TP_PROTO(struct inode *inode,
0168 unsigned long ino,
0169 unsigned long block),
0170
0171 TP_ARGS(inode, ino, block),
0172
0173 TP_STRUCT__entry(
0174 __field(struct inode *, inode)
0175 __field(unsigned long, ino)
0176 __field(unsigned long, block)
0177 ),
0178
0179 TP_fast_assign(
0180 __entry->inode = inode;
0181 __entry->ino = ino;
0182 __entry->block = block;
0183 ),
0184
0185 TP_printk("inode = %p ino = %lu block = %lu",
0186 __entry->inode,
0187 __entry->ino,
0188 __entry->block)
0189 );
0190
0191 TRACE_EVENT(nilfs2_mdt_submit_block,
0192 TP_PROTO(struct inode *inode,
0193 unsigned long ino,
0194 unsigned long blkoff,
0195 enum req_op mode),
0196
0197 TP_ARGS(inode, ino, blkoff, mode),
0198
0199 TP_STRUCT__entry(
0200 __field(struct inode *, inode)
0201 __field(unsigned long, ino)
0202 __field(unsigned long, blkoff)
0203 __field(enum req_op, mode)
0204 ),
0205
0206 TP_fast_assign(
0207 __entry->inode = inode;
0208 __entry->ino = ino;
0209 __entry->blkoff = blkoff;
0210 __entry->mode = mode;
0211 ),
0212
0213 TP_printk("inode = %p ino = %lu blkoff = %lu mode = %x",
0214 __entry->inode,
0215 __entry->ino,
0216 __entry->blkoff,
0217 __entry->mode)
0218 );
0219
0220 #endif
0221
0222
0223 #undef TRACE_INCLUDE_FILE
0224 #define TRACE_INCLUDE_FILE nilfs2
0225 #include <trace/define_trace.h>