Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM f2fs |
| 3 | |
| 4 | #if !defined(_TRACE_F2FS_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_F2FS_H |
| 6 | |
| 7 | #include <linux/tracepoint.h> |
| 8 | |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 9 | #define show_dev(dev) MAJOR(dev), MINOR(dev) |
| 10 | #define show_dev_ino(entry) show_dev(entry->dev), (unsigned long)entry->ino |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 11 | |
Steven Rostedt (Red Hat) | 5511b9a | 2015-03-27 16:18:07 -0400 | [diff] [blame] | 12 | TRACE_DEFINE_ENUM(NODE); |
| 13 | TRACE_DEFINE_ENUM(DATA); |
| 14 | TRACE_DEFINE_ENUM(META); |
| 15 | TRACE_DEFINE_ENUM(META_FLUSH); |
Jaegeuk Kim | 5d79988 | 2015-04-22 16:07:38 -0700 | [diff] [blame] | 16 | TRACE_DEFINE_ENUM(INMEM); |
| 17 | TRACE_DEFINE_ENUM(INMEM_DROP); |
Jaegeuk Kim | 8c242db | 2017-03-17 09:55:52 +0800 | [diff] [blame] | 18 | TRACE_DEFINE_ENUM(INMEM_INVALIDATE); |
Chao Yu | a58f244 | 2017-03-17 18:46:14 +0800 | [diff] [blame] | 19 | TRACE_DEFINE_ENUM(INMEM_REVOKE); |
Jaegeuk Kim | 5d79988 | 2015-04-22 16:07:38 -0700 | [diff] [blame] | 20 | TRACE_DEFINE_ENUM(IPU); |
| 21 | TRACE_DEFINE_ENUM(OPU); |
Jaegeuk Kim | a912b54 | 2017-05-10 11:18:25 -0700 | [diff] [blame] | 22 | TRACE_DEFINE_ENUM(HOT); |
| 23 | TRACE_DEFINE_ENUM(WARM); |
| 24 | TRACE_DEFINE_ENUM(COLD); |
Steven Rostedt (Red Hat) | 5511b9a | 2015-03-27 16:18:07 -0400 | [diff] [blame] | 25 | TRACE_DEFINE_ENUM(CURSEG_HOT_DATA); |
| 26 | TRACE_DEFINE_ENUM(CURSEG_WARM_DATA); |
| 27 | TRACE_DEFINE_ENUM(CURSEG_COLD_DATA); |
| 28 | TRACE_DEFINE_ENUM(CURSEG_HOT_NODE); |
| 29 | TRACE_DEFINE_ENUM(CURSEG_WARM_NODE); |
| 30 | TRACE_DEFINE_ENUM(CURSEG_COLD_NODE); |
| 31 | TRACE_DEFINE_ENUM(NO_CHECK_TYPE); |
| 32 | TRACE_DEFINE_ENUM(GC_GREEDY); |
| 33 | TRACE_DEFINE_ENUM(GC_CB); |
| 34 | TRACE_DEFINE_ENUM(FG_GC); |
| 35 | TRACE_DEFINE_ENUM(BG_GC); |
| 36 | TRACE_DEFINE_ENUM(LFS); |
| 37 | TRACE_DEFINE_ENUM(SSR); |
| 38 | TRACE_DEFINE_ENUM(__REQ_RAHEAD); |
Steven Rostedt (Red Hat) | 5511b9a | 2015-03-27 16:18:07 -0400 | [diff] [blame] | 39 | TRACE_DEFINE_ENUM(__REQ_SYNC); |
Christoph Hellwig | a2b8096 | 2016-11-01 07:40:09 -0600 | [diff] [blame] | 40 | TRACE_DEFINE_ENUM(__REQ_IDLE); |
Mike Christie | 28a8f0d | 2016-06-05 14:32:25 -0500 | [diff] [blame] | 41 | TRACE_DEFINE_ENUM(__REQ_PREFLUSH); |
Steven Rostedt (Red Hat) | 5511b9a | 2015-03-27 16:18:07 -0400 | [diff] [blame] | 42 | TRACE_DEFINE_ENUM(__REQ_FUA); |
| 43 | TRACE_DEFINE_ENUM(__REQ_PRIO); |
| 44 | TRACE_DEFINE_ENUM(__REQ_META); |
| 45 | TRACE_DEFINE_ENUM(CP_UMOUNT); |
| 46 | TRACE_DEFINE_ENUM(CP_FASTBOOT); |
| 47 | TRACE_DEFINE_ENUM(CP_SYNC); |
Jaegeuk Kim | 5d79988 | 2015-04-22 16:07:38 -0700 | [diff] [blame] | 48 | TRACE_DEFINE_ENUM(CP_RECOVERY); |
Steven Rostedt (Red Hat) | 5511b9a | 2015-03-27 16:18:07 -0400 | [diff] [blame] | 49 | TRACE_DEFINE_ENUM(CP_DISCARD); |
Chao Yu | 1f43e2a | 2017-04-28 13:56:08 +0800 | [diff] [blame] | 50 | TRACE_DEFINE_ENUM(CP_TRIMMED); |
Steven Rostedt (Red Hat) | 5511b9a | 2015-03-27 16:18:07 -0400 | [diff] [blame] | 51 | |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 52 | #define show_block_type(type) \ |
| 53 | __print_symbolic(type, \ |
| 54 | { NODE, "NODE" }, \ |
| 55 | { DATA, "DATA" }, \ |
| 56 | { META, "META" }, \ |
Jaegeuk Kim | 8ce67cb | 2015-03-17 17:58:08 -0700 | [diff] [blame] | 57 | { META_FLUSH, "META_FLUSH" }, \ |
| 58 | { INMEM, "INMEM" }, \ |
| 59 | { INMEM_DROP, "INMEM_DROP" }, \ |
Jaegeuk Kim | 8c242db | 2017-03-17 09:55:52 +0800 | [diff] [blame] | 60 | { INMEM_INVALIDATE, "INMEM_INVALIDATE" }, \ |
Chao Yu | 28bc106 | 2016-02-06 14:40:34 +0800 | [diff] [blame] | 61 | { INMEM_REVOKE, "INMEM_REVOKE" }, \ |
Jaegeuk Kim | 8ce67cb | 2015-03-17 17:58:08 -0700 | [diff] [blame] | 62 | { IPU, "IN-PLACE" }, \ |
| 63 | { OPU, "OUT-OF-PLACE" }) |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 64 | |
Jaegeuk Kim | a912b54 | 2017-05-10 11:18:25 -0700 | [diff] [blame] | 65 | #define show_block_temp(temp) \ |
| 66 | __print_symbolic(temp, \ |
| 67 | { HOT, "HOT" }, \ |
| 68 | { WARM, "WARM" }, \ |
| 69 | { COLD, "COLD" }) |
| 70 | |
Chao Yu | baaabbb | 2017-05-04 09:35:43 +0800 | [diff] [blame] | 71 | #define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_META | REQ_PRIO | \ |
| 72 | REQ_PREFLUSH | REQ_FUA) |
Jaegeuk Kim | d621e6b | 2016-12-21 14:26:39 -0800 | [diff] [blame] | 73 | #define F2FS_BIO_FLAG_MASK(t) (t & F2FS_OP_FLAGS) |
Jaegeuk Kim | a709f4a | 2013-11-24 14:42:23 +0900 | [diff] [blame] | 74 | |
Jaegeuk Kim | d621e6b | 2016-12-21 14:26:39 -0800 | [diff] [blame] | 75 | #define show_bio_type(op,op_flags) show_bio_op(op), \ |
| 76 | show_bio_op_flags(op_flags) |
| 77 | |
| 78 | #define show_bio_op(op) \ |
| 79 | __print_symbolic(op, \ |
| 80 | { REQ_OP_READ, "READ" }, \ |
| 81 | { REQ_OP_WRITE, "WRITE" }, \ |
| 82 | { REQ_OP_FLUSH, "FLUSH" }, \ |
| 83 | { REQ_OP_DISCARD, "DISCARD" }, \ |
| 84 | { REQ_OP_ZONE_REPORT, "ZONE_REPORT" }, \ |
| 85 | { REQ_OP_SECURE_ERASE, "SECURE_ERASE" }, \ |
| 86 | { REQ_OP_ZONE_RESET, "ZONE_RESET" }, \ |
| 87 | { REQ_OP_WRITE_SAME, "WRITE_SAME" }, \ |
| 88 | { REQ_OP_WRITE_ZEROES, "WRITE_ZEROES" }) |
Mike Christie | 04d328d | 2016-06-05 14:31:55 -0500 | [diff] [blame] | 89 | |
| 90 | #define show_bio_op_flags(flags) \ |
Chao Yu | baaabbb | 2017-05-04 09:35:43 +0800 | [diff] [blame] | 91 | __print_flags(F2FS_BIO_FLAG_MASK(flags), "|", \ |
| 92 | { REQ_RAHEAD, "R" }, \ |
| 93 | { REQ_SYNC, "S" }, \ |
| 94 | { REQ_META, "M" }, \ |
| 95 | { REQ_PRIO, "P" }, \ |
| 96 | { REQ_PREFLUSH, "PF" }, \ |
| 97 | { REQ_FUA, "FUA" }) |
Jaegeuk Kim | a709f4a | 2013-11-24 14:42:23 +0900 | [diff] [blame] | 98 | |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 99 | #define show_data_type(type) \ |
| 100 | __print_symbolic(type, \ |
| 101 | { CURSEG_HOT_DATA, "Hot DATA" }, \ |
| 102 | { CURSEG_WARM_DATA, "Warm DATA" }, \ |
| 103 | { CURSEG_COLD_DATA, "Cold DATA" }, \ |
| 104 | { CURSEG_HOT_NODE, "Hot NODE" }, \ |
| 105 | { CURSEG_WARM_NODE, "Warm NODE" }, \ |
| 106 | { CURSEG_COLD_NODE, "Cold NODE" }, \ |
| 107 | { NO_CHECK_TYPE, "No TYPE" }) |
| 108 | |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 109 | #define show_file_type(type) \ |
| 110 | __print_symbolic(type, \ |
| 111 | { 0, "FILE" }, \ |
| 112 | { 1, "DIR" }) |
| 113 | |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 114 | #define show_gc_type(type) \ |
| 115 | __print_symbolic(type, \ |
| 116 | { FG_GC, "Foreground GC" }, \ |
| 117 | { BG_GC, "Background GC" }) |
| 118 | |
| 119 | #define show_alloc_mode(type) \ |
| 120 | __print_symbolic(type, \ |
| 121 | { LFS, "LFS-mode" }, \ |
| 122 | { SSR, "SSR-mode" }) |
| 123 | |
| 124 | #define show_victim_policy(type) \ |
| 125 | __print_symbolic(type, \ |
| 126 | { GC_GREEDY, "Greedy" }, \ |
| 127 | { GC_CB, "Cost-Benefit" }) |
| 128 | |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 129 | #define show_cpreason(type) \ |
Chao Yu | baaabbb | 2017-05-04 09:35:43 +0800 | [diff] [blame] | 130 | __print_flags(type, "|", \ |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 131 | { CP_UMOUNT, "Umount" }, \ |
Jaegeuk Kim | 119ee91 | 2015-01-29 11:45:33 -0800 | [diff] [blame] | 132 | { CP_FASTBOOT, "Fastboot" }, \ |
Jaegeuk Kim | 4b2fecc | 2014-09-20 22:06:39 -0700 | [diff] [blame] | 133 | { CP_SYNC, "Sync" }, \ |
Jaegeuk Kim | 1002755 | 2015-04-09 17:03:53 -0700 | [diff] [blame] | 134 | { CP_RECOVERY, "Recovery" }, \ |
Chao Yu | 1f43e2a | 2017-04-28 13:56:08 +0800 | [diff] [blame] | 135 | { CP_DISCARD, "Discard" }, \ |
Chao Yu | baaabbb | 2017-05-04 09:35:43 +0800 | [diff] [blame] | 136 | { CP_UMOUNT, "Umount" }, \ |
| 137 | { CP_TRIMMED, "Trimmed" }) |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 138 | |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame^] | 139 | #define show_fsync_cpreason(type) \ |
| 140 | __print_symbolic(type, \ |
| 141 | { CP_NO_NEEDED, "no needed" }, \ |
| 142 | { CP_NON_REGULAR, "non regular" }, \ |
| 143 | { CP_HARDLINK, "hardlink" }, \ |
| 144 | { CP_SB_NEED_CP, "sb needs cp" }, \ |
| 145 | { CP_WRONG_PINO, "wrong pino" }, \ |
| 146 | { CP_NO_SPC_ROLL, "no space roll forward" }, \ |
| 147 | { CP_NODE_NEED_CP, "node needs cp" }, \ |
| 148 | { CP_FASTBOOT_MODE, "fastboot mode" }, \ |
| 149 | { CP_SPEC_LOG_NUM, "log type is 2" }) |
| 150 | |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 151 | struct victim_sel_policy; |
Jaegeuk Kim | 003a3e1 | 2015-04-06 19:55:34 -0700 | [diff] [blame] | 152 | struct f2fs_map_blocks; |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 153 | |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 154 | DECLARE_EVENT_CLASS(f2fs__inode, |
| 155 | |
| 156 | TP_PROTO(struct inode *inode), |
| 157 | |
| 158 | TP_ARGS(inode), |
| 159 | |
| 160 | TP_STRUCT__entry( |
| 161 | __field(dev_t, dev) |
| 162 | __field(ino_t, ino) |
| 163 | __field(ino_t, pino) |
| 164 | __field(umode_t, mode) |
| 165 | __field(loff_t, size) |
| 166 | __field(unsigned int, nlink) |
| 167 | __field(blkcnt_t, blocks) |
| 168 | __field(__u8, advise) |
| 169 | ), |
| 170 | |
| 171 | TP_fast_assign( |
| 172 | __entry->dev = inode->i_sb->s_dev; |
| 173 | __entry->ino = inode->i_ino; |
| 174 | __entry->pino = F2FS_I(inode)->i_pino; |
| 175 | __entry->mode = inode->i_mode; |
| 176 | __entry->nlink = inode->i_nlink; |
| 177 | __entry->size = inode->i_size; |
| 178 | __entry->blocks = inode->i_blocks; |
| 179 | __entry->advise = F2FS_I(inode)->i_advise; |
| 180 | ), |
| 181 | |
| 182 | TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, " |
| 183 | "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x", |
| 184 | show_dev_ino(__entry), |
| 185 | (unsigned long)__entry->pino, |
| 186 | __entry->mode, |
| 187 | __entry->size, |
| 188 | (unsigned int)__entry->nlink, |
| 189 | (unsigned long long)__entry->blocks, |
| 190 | (unsigned char)__entry->advise) |
| 191 | ); |
| 192 | |
| 193 | DECLARE_EVENT_CLASS(f2fs__inode_exit, |
| 194 | |
| 195 | TP_PROTO(struct inode *inode, int ret), |
| 196 | |
| 197 | TP_ARGS(inode, ret), |
| 198 | |
| 199 | TP_STRUCT__entry( |
| 200 | __field(dev_t, dev) |
| 201 | __field(ino_t, ino) |
| 202 | __field(int, ret) |
| 203 | ), |
| 204 | |
| 205 | TP_fast_assign( |
| 206 | __entry->dev = inode->i_sb->s_dev; |
| 207 | __entry->ino = inode->i_ino; |
| 208 | __entry->ret = ret; |
| 209 | ), |
| 210 | |
| 211 | TP_printk("dev = (%d,%d), ino = %lu, ret = %d", |
| 212 | show_dev_ino(__entry), |
| 213 | __entry->ret) |
| 214 | ); |
| 215 | |
| 216 | DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter, |
| 217 | |
| 218 | TP_PROTO(struct inode *inode), |
| 219 | |
| 220 | TP_ARGS(inode) |
| 221 | ); |
| 222 | |
| 223 | TRACE_EVENT(f2fs_sync_file_exit, |
| 224 | |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame^] | 225 | TP_PROTO(struct inode *inode, int cp_reason, int datasync, int ret), |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 226 | |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame^] | 227 | TP_ARGS(inode, cp_reason, datasync, ret), |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 228 | |
| 229 | TP_STRUCT__entry( |
| 230 | __field(dev_t, dev) |
| 231 | __field(ino_t, ino) |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame^] | 232 | __field(int, cp_reason) |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 233 | __field(int, datasync) |
| 234 | __field(int, ret) |
| 235 | ), |
| 236 | |
| 237 | TP_fast_assign( |
| 238 | __entry->dev = inode->i_sb->s_dev; |
| 239 | __entry->ino = inode->i_ino; |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame^] | 240 | __entry->cp_reason = cp_reason; |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 241 | __entry->datasync = datasync; |
| 242 | __entry->ret = ret; |
| 243 | ), |
| 244 | |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame^] | 245 | TP_printk("dev = (%d,%d), ino = %lu, cp_reason: %s, " |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 246 | "datasync = %d, ret = %d", |
| 247 | show_dev_ino(__entry), |
Chao Yu | a5fd505 | 2017-11-06 22:51:45 +0800 | [diff] [blame^] | 248 | show_fsync_cpreason(__entry->cp_reason), |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 249 | __entry->datasync, |
| 250 | __entry->ret) |
| 251 | ); |
| 252 | |
| 253 | TRACE_EVENT(f2fs_sync_fs, |
| 254 | |
| 255 | TP_PROTO(struct super_block *sb, int wait), |
| 256 | |
| 257 | TP_ARGS(sb, wait), |
| 258 | |
| 259 | TP_STRUCT__entry( |
| 260 | __field(dev_t, dev) |
Jaegeuk Kim | 29e7043 | 2015-02-10 16:23:12 -0800 | [diff] [blame] | 261 | __field(int, dirty) |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 262 | __field(int, wait) |
| 263 | ), |
| 264 | |
| 265 | TP_fast_assign( |
| 266 | __entry->dev = sb->s_dev; |
Chao Yu | caf0047 | 2015-01-28 17:48:42 +0800 | [diff] [blame] | 267 | __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY); |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 268 | __entry->wait = wait; |
| 269 | ), |
| 270 | |
| 271 | TP_printk("dev = (%d,%d), superblock is %s, wait = %d", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 272 | show_dev(__entry->dev), |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 273 | __entry->dirty ? "dirty" : "not dirty", |
| 274 | __entry->wait) |
| 275 | ); |
| 276 | |
| 277 | DEFINE_EVENT(f2fs__inode, f2fs_iget, |
| 278 | |
| 279 | TP_PROTO(struct inode *inode), |
| 280 | |
| 281 | TP_ARGS(inode) |
| 282 | ); |
| 283 | |
| 284 | DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit, |
| 285 | |
| 286 | TP_PROTO(struct inode *inode, int ret), |
| 287 | |
| 288 | TP_ARGS(inode, ret) |
| 289 | ); |
| 290 | |
| 291 | DEFINE_EVENT(f2fs__inode, f2fs_evict_inode, |
| 292 | |
| 293 | TP_PROTO(struct inode *inode), |
| 294 | |
| 295 | TP_ARGS(inode) |
| 296 | ); |
| 297 | |
Jaegeuk Kim | d70b4f5 | 2013-04-25 13:24:33 +0900 | [diff] [blame] | 298 | DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode, |
| 299 | |
| 300 | TP_PROTO(struct inode *inode, int ret), |
| 301 | |
| 302 | TP_ARGS(inode, ret) |
| 303 | ); |
| 304 | |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 305 | TRACE_EVENT(f2fs_unlink_enter, |
| 306 | |
| 307 | TP_PROTO(struct inode *dir, struct dentry *dentry), |
| 308 | |
| 309 | TP_ARGS(dir, dentry), |
| 310 | |
| 311 | TP_STRUCT__entry( |
| 312 | __field(dev_t, dev) |
| 313 | __field(ino_t, ino) |
| 314 | __field(loff_t, size) |
| 315 | __field(blkcnt_t, blocks) |
| 316 | __field(const char *, name) |
| 317 | ), |
| 318 | |
| 319 | TP_fast_assign( |
| 320 | __entry->dev = dir->i_sb->s_dev; |
| 321 | __entry->ino = dir->i_ino; |
| 322 | __entry->size = dir->i_size; |
| 323 | __entry->blocks = dir->i_blocks; |
| 324 | __entry->name = dentry->d_name.name; |
| 325 | ), |
| 326 | |
| 327 | TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, " |
| 328 | "i_blocks = %llu, name = %s", |
| 329 | show_dev_ino(__entry), |
| 330 | __entry->size, |
| 331 | (unsigned long long)__entry->blocks, |
| 332 | __entry->name) |
| 333 | ); |
| 334 | |
| 335 | DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit, |
| 336 | |
| 337 | TP_PROTO(struct inode *inode, int ret), |
| 338 | |
| 339 | TP_ARGS(inode, ret) |
| 340 | ); |
Namjae Jeon | 51dd624 | 2013-04-20 01:28:52 +0900 | [diff] [blame] | 341 | |
Hou Pengyang | b8d96a3 | 2017-02-27 13:02:58 +0000 | [diff] [blame] | 342 | DEFINE_EVENT(f2fs__inode_exit, f2fs_drop_inode, |
| 343 | |
| 344 | TP_PROTO(struct inode *inode, int ret), |
| 345 | |
| 346 | TP_ARGS(inode, ret) |
| 347 | ); |
| 348 | |
Namjae Jeon | 51dd624 | 2013-04-20 01:28:52 +0900 | [diff] [blame] | 349 | DEFINE_EVENT(f2fs__inode, f2fs_truncate, |
| 350 | |
| 351 | TP_PROTO(struct inode *inode), |
| 352 | |
| 353 | TP_ARGS(inode) |
| 354 | ); |
| 355 | |
| 356 | TRACE_EVENT(f2fs_truncate_data_blocks_range, |
| 357 | |
| 358 | TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free), |
| 359 | |
| 360 | TP_ARGS(inode, nid, ofs, free), |
| 361 | |
| 362 | TP_STRUCT__entry( |
| 363 | __field(dev_t, dev) |
| 364 | __field(ino_t, ino) |
| 365 | __field(nid_t, nid) |
| 366 | __field(unsigned int, ofs) |
| 367 | __field(int, free) |
| 368 | ), |
| 369 | |
| 370 | TP_fast_assign( |
| 371 | __entry->dev = inode->i_sb->s_dev; |
| 372 | __entry->ino = inode->i_ino; |
| 373 | __entry->nid = nid; |
| 374 | __entry->ofs = ofs; |
| 375 | __entry->free = free; |
| 376 | ), |
| 377 | |
| 378 | TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d", |
| 379 | show_dev_ino(__entry), |
| 380 | (unsigned int)__entry->nid, |
| 381 | __entry->ofs, |
| 382 | __entry->free) |
| 383 | ); |
| 384 | |
| 385 | DECLARE_EVENT_CLASS(f2fs__truncate_op, |
| 386 | |
| 387 | TP_PROTO(struct inode *inode, u64 from), |
| 388 | |
| 389 | TP_ARGS(inode, from), |
| 390 | |
| 391 | TP_STRUCT__entry( |
| 392 | __field(dev_t, dev) |
| 393 | __field(ino_t, ino) |
| 394 | __field(loff_t, size) |
| 395 | __field(blkcnt_t, blocks) |
| 396 | __field(u64, from) |
| 397 | ), |
| 398 | |
| 399 | TP_fast_assign( |
| 400 | __entry->dev = inode->i_sb->s_dev; |
| 401 | __entry->ino = inode->i_ino; |
| 402 | __entry->size = inode->i_size; |
| 403 | __entry->blocks = inode->i_blocks; |
| 404 | __entry->from = from; |
| 405 | ), |
| 406 | |
| 407 | TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, " |
| 408 | "start file offset = %llu", |
| 409 | show_dev_ino(__entry), |
| 410 | __entry->size, |
| 411 | (unsigned long long)__entry->blocks, |
| 412 | (unsigned long long)__entry->from) |
| 413 | ); |
| 414 | |
| 415 | DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter, |
| 416 | |
| 417 | TP_PROTO(struct inode *inode, u64 from), |
| 418 | |
| 419 | TP_ARGS(inode, from) |
| 420 | ); |
| 421 | |
| 422 | DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit, |
| 423 | |
| 424 | TP_PROTO(struct inode *inode, int ret), |
| 425 | |
| 426 | TP_ARGS(inode, ret) |
| 427 | ); |
| 428 | |
| 429 | DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter, |
| 430 | |
| 431 | TP_PROTO(struct inode *inode, u64 from), |
| 432 | |
| 433 | TP_ARGS(inode, from) |
| 434 | ); |
| 435 | |
| 436 | DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit, |
| 437 | |
| 438 | TP_PROTO(struct inode *inode, int ret), |
| 439 | |
| 440 | TP_ARGS(inode, ret) |
| 441 | ); |
| 442 | |
| 443 | DECLARE_EVENT_CLASS(f2fs__truncate_node, |
| 444 | |
| 445 | TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr), |
| 446 | |
| 447 | TP_ARGS(inode, nid, blk_addr), |
| 448 | |
| 449 | TP_STRUCT__entry( |
| 450 | __field(dev_t, dev) |
| 451 | __field(ino_t, ino) |
| 452 | __field(nid_t, nid) |
| 453 | __field(block_t, blk_addr) |
| 454 | ), |
| 455 | |
| 456 | TP_fast_assign( |
| 457 | __entry->dev = inode->i_sb->s_dev; |
| 458 | __entry->ino = inode->i_ino; |
| 459 | __entry->nid = nid; |
| 460 | __entry->blk_addr = blk_addr; |
| 461 | ), |
| 462 | |
| 463 | TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx", |
| 464 | show_dev_ino(__entry), |
| 465 | (unsigned int)__entry->nid, |
| 466 | (unsigned long long)__entry->blk_addr) |
| 467 | ); |
| 468 | |
| 469 | DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter, |
| 470 | |
| 471 | TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr), |
| 472 | |
| 473 | TP_ARGS(inode, nid, blk_addr) |
| 474 | ); |
| 475 | |
| 476 | DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit, |
| 477 | |
| 478 | TP_PROTO(struct inode *inode, int ret), |
| 479 | |
| 480 | TP_ARGS(inode, ret) |
| 481 | ); |
| 482 | |
| 483 | DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node, |
| 484 | |
| 485 | TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr), |
| 486 | |
| 487 | TP_ARGS(inode, nid, blk_addr) |
| 488 | ); |
| 489 | |
| 490 | TRACE_EVENT(f2fs_truncate_partial_nodes, |
| 491 | |
| 492 | TP_PROTO(struct inode *inode, nid_t nid[], int depth, int err), |
| 493 | |
| 494 | TP_ARGS(inode, nid, depth, err), |
| 495 | |
| 496 | TP_STRUCT__entry( |
| 497 | __field(dev_t, dev) |
| 498 | __field(ino_t, ino) |
| 499 | __field(nid_t, nid[3]) |
| 500 | __field(int, depth) |
| 501 | __field(int, err) |
| 502 | ), |
| 503 | |
| 504 | TP_fast_assign( |
| 505 | __entry->dev = inode->i_sb->s_dev; |
| 506 | __entry->ino = inode->i_ino; |
| 507 | __entry->nid[0] = nid[0]; |
| 508 | __entry->nid[1] = nid[1]; |
| 509 | __entry->nid[2] = nid[2]; |
| 510 | __entry->depth = depth; |
| 511 | __entry->err = err; |
| 512 | ), |
| 513 | |
| 514 | TP_printk("dev = (%d,%d), ino = %lu, " |
| 515 | "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d", |
| 516 | show_dev_ino(__entry), |
| 517 | (unsigned int)__entry->nid[0], |
| 518 | (unsigned int)__entry->nid[1], |
| 519 | (unsigned int)__entry->nid[2], |
| 520 | __entry->depth, |
| 521 | __entry->err) |
| 522 | ); |
| 523 | |
Jaegeuk Kim | 003a3e1 | 2015-04-06 19:55:34 -0700 | [diff] [blame] | 524 | TRACE_EVENT(f2fs_map_blocks, |
| 525 | TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret), |
Namjae Jeon | 848753a | 2013-04-23 16:38:02 +0900 | [diff] [blame] | 526 | |
Jaegeuk Kim | 003a3e1 | 2015-04-06 19:55:34 -0700 | [diff] [blame] | 527 | TP_ARGS(inode, map, ret), |
Namjae Jeon | 848753a | 2013-04-23 16:38:02 +0900 | [diff] [blame] | 528 | |
| 529 | TP_STRUCT__entry( |
| 530 | __field(dev_t, dev) |
| 531 | __field(ino_t, ino) |
Jaegeuk Kim | 003a3e1 | 2015-04-06 19:55:34 -0700 | [diff] [blame] | 532 | __field(block_t, m_lblk) |
| 533 | __field(block_t, m_pblk) |
| 534 | __field(unsigned int, m_len) |
Namjae Jeon | 848753a | 2013-04-23 16:38:02 +0900 | [diff] [blame] | 535 | __field(int, ret) |
| 536 | ), |
| 537 | |
| 538 | TP_fast_assign( |
| 539 | __entry->dev = inode->i_sb->s_dev; |
| 540 | __entry->ino = inode->i_ino; |
Jaegeuk Kim | 003a3e1 | 2015-04-06 19:55:34 -0700 | [diff] [blame] | 541 | __entry->m_lblk = map->m_lblk; |
| 542 | __entry->m_pblk = map->m_pblk; |
| 543 | __entry->m_len = map->m_len; |
Namjae Jeon | 848753a | 2013-04-23 16:38:02 +0900 | [diff] [blame] | 544 | __entry->ret = ret; |
| 545 | ), |
| 546 | |
| 547 | TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, " |
Jaegeuk Kim | 003a3e1 | 2015-04-06 19:55:34 -0700 | [diff] [blame] | 548 | "start blkaddr = 0x%llx, len = 0x%llx, err = %d", |
Namjae Jeon | 848753a | 2013-04-23 16:38:02 +0900 | [diff] [blame] | 549 | show_dev_ino(__entry), |
Jaegeuk Kim | 003a3e1 | 2015-04-06 19:55:34 -0700 | [diff] [blame] | 550 | (unsigned long long)__entry->m_lblk, |
| 551 | (unsigned long long)__entry->m_pblk, |
| 552 | (unsigned long long)__entry->m_len, |
Namjae Jeon | 848753a | 2013-04-23 16:38:02 +0900 | [diff] [blame] | 553 | __entry->ret) |
| 554 | ); |
| 555 | |
Jaegeuk Kim | 5c26743 | 2015-10-05 11:32:34 -0700 | [diff] [blame] | 556 | TRACE_EVENT(f2fs_background_gc, |
| 557 | |
Chao Yu | b8c502b | 2017-08-07 23:12:46 +0800 | [diff] [blame] | 558 | TP_PROTO(struct super_block *sb, unsigned int wait_ms, |
Jaegeuk Kim | 5c26743 | 2015-10-05 11:32:34 -0700 | [diff] [blame] | 559 | unsigned int prefree, unsigned int free), |
| 560 | |
| 561 | TP_ARGS(sb, wait_ms, prefree, free), |
| 562 | |
| 563 | TP_STRUCT__entry( |
| 564 | __field(dev_t, dev) |
Chao Yu | b8c502b | 2017-08-07 23:12:46 +0800 | [diff] [blame] | 565 | __field(unsigned int, wait_ms) |
Jaegeuk Kim | 5c26743 | 2015-10-05 11:32:34 -0700 | [diff] [blame] | 566 | __field(unsigned int, prefree) |
| 567 | __field(unsigned int, free) |
| 568 | ), |
| 569 | |
| 570 | TP_fast_assign( |
| 571 | __entry->dev = sb->s_dev; |
| 572 | __entry->wait_ms = wait_ms; |
| 573 | __entry->prefree = prefree; |
| 574 | __entry->free = free; |
| 575 | ), |
| 576 | |
Chao Yu | b8c502b | 2017-08-07 23:12:46 +0800 | [diff] [blame] | 577 | TP_printk("dev = (%d,%d), wait_ms = %u, prefree = %u, free = %u", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 578 | show_dev(__entry->dev), |
Jaegeuk Kim | 5c26743 | 2015-10-05 11:32:34 -0700 | [diff] [blame] | 579 | __entry->wait_ms, |
| 580 | __entry->prefree, |
| 581 | __entry->free) |
| 582 | ); |
| 583 | |
Chao Yu | c56f16d | 2017-08-11 18:00:15 +0800 | [diff] [blame] | 584 | TRACE_EVENT(f2fs_gc_begin, |
| 585 | |
| 586 | TP_PROTO(struct super_block *sb, bool sync, bool background, |
| 587 | long long dirty_nodes, long long dirty_dents, |
| 588 | long long dirty_imeta, unsigned int free_sec, |
| 589 | unsigned int free_seg, int reserved_seg, |
| 590 | unsigned int prefree_seg), |
| 591 | |
| 592 | TP_ARGS(sb, sync, background, dirty_nodes, dirty_dents, dirty_imeta, |
| 593 | free_sec, free_seg, reserved_seg, prefree_seg), |
| 594 | |
| 595 | TP_STRUCT__entry( |
| 596 | __field(dev_t, dev) |
| 597 | __field(bool, sync) |
| 598 | __field(bool, background) |
| 599 | __field(long long, dirty_nodes) |
| 600 | __field(long long, dirty_dents) |
| 601 | __field(long long, dirty_imeta) |
| 602 | __field(unsigned int, free_sec) |
| 603 | __field(unsigned int, free_seg) |
| 604 | __field(int, reserved_seg) |
| 605 | __field(unsigned int, prefree_seg) |
| 606 | ), |
| 607 | |
| 608 | TP_fast_assign( |
| 609 | __entry->dev = sb->s_dev; |
| 610 | __entry->sync = sync; |
| 611 | __entry->background = background; |
| 612 | __entry->dirty_nodes = dirty_nodes; |
| 613 | __entry->dirty_dents = dirty_dents; |
| 614 | __entry->dirty_imeta = dirty_imeta; |
| 615 | __entry->free_sec = free_sec; |
| 616 | __entry->free_seg = free_seg; |
| 617 | __entry->reserved_seg = reserved_seg; |
| 618 | __entry->prefree_seg = prefree_seg; |
| 619 | ), |
| 620 | |
| 621 | TP_printk("dev = (%d,%d), sync = %d, background = %d, nodes = %lld, " |
| 622 | "dents = %lld, imeta = %lld, free_sec:%u, free_seg:%u, " |
| 623 | "rsv_seg:%d, prefree_seg:%u", |
| 624 | show_dev(__entry->dev), |
| 625 | __entry->sync, |
| 626 | __entry->background, |
| 627 | __entry->dirty_nodes, |
| 628 | __entry->dirty_dents, |
| 629 | __entry->dirty_imeta, |
| 630 | __entry->free_sec, |
| 631 | __entry->free_seg, |
| 632 | __entry->reserved_seg, |
| 633 | __entry->prefree_seg) |
| 634 | ); |
| 635 | |
| 636 | TRACE_EVENT(f2fs_gc_end, |
| 637 | |
| 638 | TP_PROTO(struct super_block *sb, int ret, int seg_freed, |
| 639 | int sec_freed, long long dirty_nodes, |
| 640 | long long dirty_dents, long long dirty_imeta, |
| 641 | unsigned int free_sec, unsigned int free_seg, |
| 642 | int reserved_seg, unsigned int prefree_seg), |
| 643 | |
| 644 | TP_ARGS(sb, ret, seg_freed, sec_freed, dirty_nodes, dirty_dents, |
| 645 | dirty_imeta, free_sec, free_seg, reserved_seg, prefree_seg), |
| 646 | |
| 647 | TP_STRUCT__entry( |
| 648 | __field(dev_t, dev) |
| 649 | __field(int, ret) |
| 650 | __field(int, seg_freed) |
| 651 | __field(int, sec_freed) |
| 652 | __field(long long, dirty_nodes) |
| 653 | __field(long long, dirty_dents) |
| 654 | __field(long long, dirty_imeta) |
| 655 | __field(unsigned int, free_sec) |
| 656 | __field(unsigned int, free_seg) |
| 657 | __field(int, reserved_seg) |
| 658 | __field(unsigned int, prefree_seg) |
| 659 | ), |
| 660 | |
| 661 | TP_fast_assign( |
| 662 | __entry->dev = sb->s_dev; |
| 663 | __entry->ret = ret; |
| 664 | __entry->seg_freed = seg_freed; |
| 665 | __entry->sec_freed = sec_freed; |
| 666 | __entry->dirty_nodes = dirty_nodes; |
| 667 | __entry->dirty_dents = dirty_dents; |
| 668 | __entry->dirty_imeta = dirty_imeta; |
| 669 | __entry->free_sec = free_sec; |
| 670 | __entry->free_seg = free_seg; |
| 671 | __entry->reserved_seg = reserved_seg; |
| 672 | __entry->prefree_seg = prefree_seg; |
| 673 | ), |
| 674 | |
| 675 | TP_printk("dev = (%d,%d), ret = %d, seg_freed = %d, sec_freed = %d, " |
| 676 | "nodes = %lld, dents = %lld, imeta = %lld, free_sec:%u, " |
| 677 | "free_seg:%u, rsv_seg:%d, prefree_seg:%u", |
| 678 | show_dev(__entry->dev), |
| 679 | __entry->ret, |
| 680 | __entry->seg_freed, |
| 681 | __entry->sec_freed, |
| 682 | __entry->dirty_nodes, |
| 683 | __entry->dirty_dents, |
| 684 | __entry->dirty_imeta, |
| 685 | __entry->free_sec, |
| 686 | __entry->free_seg, |
| 687 | __entry->reserved_seg, |
| 688 | __entry->prefree_seg) |
| 689 | ); |
| 690 | |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 691 | TRACE_EVENT(f2fs_get_victim, |
| 692 | |
| 693 | TP_PROTO(struct super_block *sb, int type, int gc_type, |
| 694 | struct victim_sel_policy *p, unsigned int pre_victim, |
| 695 | unsigned int prefree, unsigned int free), |
| 696 | |
| 697 | TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free), |
| 698 | |
| 699 | TP_STRUCT__entry( |
| 700 | __field(dev_t, dev) |
| 701 | __field(int, type) |
| 702 | __field(int, gc_type) |
| 703 | __field(int, alloc_mode) |
| 704 | __field(int, gc_mode) |
| 705 | __field(unsigned int, victim) |
Jaegeuk Kim | 5012de2 | 2017-02-16 10:35:41 -0800 | [diff] [blame] | 706 | __field(unsigned int, cost) |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 707 | __field(unsigned int, ofs_unit) |
| 708 | __field(unsigned int, pre_victim) |
| 709 | __field(unsigned int, prefree) |
| 710 | __field(unsigned int, free) |
| 711 | ), |
| 712 | |
| 713 | TP_fast_assign( |
| 714 | __entry->dev = sb->s_dev; |
| 715 | __entry->type = type; |
| 716 | __entry->gc_type = gc_type; |
| 717 | __entry->alloc_mode = p->alloc_mode; |
| 718 | __entry->gc_mode = p->gc_mode; |
| 719 | __entry->victim = p->min_segno; |
Jaegeuk Kim | 5012de2 | 2017-02-16 10:35:41 -0800 | [diff] [blame] | 720 | __entry->cost = p->min_cost; |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 721 | __entry->ofs_unit = p->ofs_unit; |
| 722 | __entry->pre_victim = pre_victim; |
| 723 | __entry->prefree = prefree; |
| 724 | __entry->free = free; |
| 725 | ), |
| 726 | |
Jaegeuk Kim | 5012de2 | 2017-02-16 10:35:41 -0800 | [diff] [blame] | 727 | TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), " |
| 728 | "victim = %u, cost = %u, ofs_unit = %u, " |
| 729 | "pre_victim_secno = %d, prefree = %u, free = %u", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 730 | show_dev(__entry->dev), |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 731 | show_data_type(__entry->type), |
| 732 | show_gc_type(__entry->gc_type), |
| 733 | show_alloc_mode(__entry->alloc_mode), |
| 734 | show_victim_policy(__entry->gc_mode), |
| 735 | __entry->victim, |
Jaegeuk Kim | 5012de2 | 2017-02-16 10:35:41 -0800 | [diff] [blame] | 736 | __entry->cost, |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 737 | __entry->ofs_unit, |
| 738 | (int)__entry->pre_victim, |
| 739 | __entry->prefree, |
| 740 | __entry->free) |
| 741 | ); |
| 742 | |
Chao Yu | 0c5e36d | 2017-10-17 17:33:41 +0800 | [diff] [blame] | 743 | TRACE_EVENT(f2fs_lookup_start, |
| 744 | |
| 745 | TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags), |
| 746 | |
| 747 | TP_ARGS(dir, dentry, flags), |
| 748 | |
| 749 | TP_STRUCT__entry( |
| 750 | __field(dev_t, dev) |
| 751 | __field(ino_t, ino) |
| 752 | __field(const char *, name) |
| 753 | __field(unsigned int, flags) |
| 754 | ), |
| 755 | |
| 756 | TP_fast_assign( |
| 757 | __entry->dev = dir->i_sb->s_dev; |
| 758 | __entry->ino = dir->i_ino; |
| 759 | __entry->name = dentry->d_name.name; |
| 760 | __entry->flags = flags; |
| 761 | ), |
| 762 | |
| 763 | TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u", |
| 764 | show_dev_ino(__entry), |
| 765 | __entry->name, |
| 766 | __entry->flags) |
| 767 | ); |
| 768 | |
| 769 | TRACE_EVENT(f2fs_lookup_end, |
| 770 | |
| 771 | TP_PROTO(struct inode *dir, struct dentry *dentry, nid_t ino, |
| 772 | int err), |
| 773 | |
| 774 | TP_ARGS(dir, dentry, ino, err), |
| 775 | |
| 776 | TP_STRUCT__entry( |
| 777 | __field(dev_t, dev) |
| 778 | __field(ino_t, ino) |
| 779 | __field(const char *, name) |
| 780 | __field(nid_t, cino) |
| 781 | __field(int, err) |
| 782 | ), |
| 783 | |
| 784 | TP_fast_assign( |
| 785 | __entry->dev = dir->i_sb->s_dev; |
| 786 | __entry->ino = dir->i_ino; |
| 787 | __entry->name = dentry->d_name.name; |
| 788 | __entry->cino = ino; |
| 789 | __entry->err = err; |
| 790 | ), |
| 791 | |
| 792 | TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d", |
| 793 | show_dev_ino(__entry), |
| 794 | __entry->name, |
| 795 | __entry->cino, |
| 796 | __entry->err) |
| 797 | ); |
| 798 | |
Chao Yu | e97a3c4 | 2017-10-13 18:01:33 +0800 | [diff] [blame] | 799 | TRACE_EVENT(f2fs_readdir, |
| 800 | |
| 801 | TP_PROTO(struct inode *dir, loff_t start_pos, loff_t end_pos, int err), |
| 802 | |
| 803 | TP_ARGS(dir, start_pos, end_pos, err), |
| 804 | |
| 805 | TP_STRUCT__entry( |
| 806 | __field(dev_t, dev) |
| 807 | __field(ino_t, ino) |
| 808 | __field(loff_t, start) |
| 809 | __field(loff_t, end) |
| 810 | __field(int, err) |
| 811 | ), |
| 812 | |
| 813 | TP_fast_assign( |
| 814 | __entry->dev = dir->i_sb->s_dev; |
| 815 | __entry->ino = dir->i_ino; |
| 816 | __entry->start = start_pos; |
| 817 | __entry->end = end_pos; |
| 818 | __entry->err = err; |
| 819 | ), |
| 820 | |
| 821 | TP_printk("dev = (%d,%d), ino = %lu, start_pos:%llu, end_pos:%llu, err:%d", |
| 822 | show_dev_ino(__entry), |
| 823 | __entry->start, |
| 824 | __entry->end, |
| 825 | __entry->err) |
| 826 | ); |
| 827 | |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 828 | TRACE_EVENT(f2fs_fallocate, |
| 829 | |
| 830 | TP_PROTO(struct inode *inode, int mode, |
| 831 | loff_t offset, loff_t len, int ret), |
| 832 | |
| 833 | TP_ARGS(inode, mode, offset, len, ret), |
| 834 | |
| 835 | TP_STRUCT__entry( |
| 836 | __field(dev_t, dev) |
| 837 | __field(ino_t, ino) |
| 838 | __field(int, mode) |
| 839 | __field(loff_t, offset) |
| 840 | __field(loff_t, len) |
| 841 | __field(loff_t, size) |
| 842 | __field(blkcnt_t, blocks) |
| 843 | __field(int, ret) |
| 844 | ), |
| 845 | |
| 846 | TP_fast_assign( |
| 847 | __entry->dev = inode->i_sb->s_dev; |
| 848 | __entry->ino = inode->i_ino; |
| 849 | __entry->mode = mode; |
| 850 | __entry->offset = offset; |
| 851 | __entry->len = len; |
| 852 | __entry->size = inode->i_size; |
| 853 | __entry->blocks = inode->i_blocks; |
| 854 | __entry->ret = ret; |
| 855 | ), |
| 856 | |
| 857 | TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, " |
| 858 | "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d", |
| 859 | show_dev_ino(__entry), |
| 860 | __entry->mode, |
| 861 | (unsigned long long)__entry->offset, |
| 862 | (unsigned long long)__entry->len, |
| 863 | (unsigned long long)__entry->size, |
| 864 | (unsigned long long)__entry->blocks, |
| 865 | __entry->ret) |
| 866 | ); |
| 867 | |
Chao Yu | 70407fa | 2014-07-31 21:11:22 +0800 | [diff] [blame] | 868 | TRACE_EVENT(f2fs_direct_IO_enter, |
| 869 | |
| 870 | TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw), |
| 871 | |
| 872 | TP_ARGS(inode, offset, len, rw), |
| 873 | |
| 874 | TP_STRUCT__entry( |
| 875 | __field(dev_t, dev) |
| 876 | __field(ino_t, ino) |
| 877 | __field(loff_t, pos) |
| 878 | __field(unsigned long, len) |
| 879 | __field(int, rw) |
| 880 | ), |
| 881 | |
| 882 | TP_fast_assign( |
| 883 | __entry->dev = inode->i_sb->s_dev; |
| 884 | __entry->ino = inode->i_ino; |
| 885 | __entry->pos = offset; |
| 886 | __entry->len = len; |
| 887 | __entry->rw = rw; |
| 888 | ), |
| 889 | |
| 890 | TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d", |
| 891 | show_dev_ino(__entry), |
| 892 | __entry->pos, |
| 893 | __entry->len, |
| 894 | __entry->rw) |
| 895 | ); |
| 896 | |
| 897 | TRACE_EVENT(f2fs_direct_IO_exit, |
| 898 | |
| 899 | TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, |
| 900 | int rw, int ret), |
| 901 | |
| 902 | TP_ARGS(inode, offset, len, rw, ret), |
| 903 | |
| 904 | TP_STRUCT__entry( |
| 905 | __field(dev_t, dev) |
| 906 | __field(ino_t, ino) |
| 907 | __field(loff_t, pos) |
| 908 | __field(unsigned long, len) |
| 909 | __field(int, rw) |
| 910 | __field(int, ret) |
| 911 | ), |
| 912 | |
| 913 | TP_fast_assign( |
| 914 | __entry->dev = inode->i_sb->s_dev; |
| 915 | __entry->ino = inode->i_ino; |
| 916 | __entry->pos = offset; |
| 917 | __entry->len = len; |
| 918 | __entry->rw = rw; |
| 919 | __entry->ret = ret; |
| 920 | ), |
| 921 | |
| 922 | TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu " |
| 923 | "rw = %d ret = %d", |
| 924 | show_dev_ino(__entry), |
| 925 | __entry->pos, |
| 926 | __entry->len, |
| 927 | __entry->rw, |
| 928 | __entry->ret) |
| 929 | ); |
| 930 | |
Chao Yu | 46008c6 | 2016-05-09 19:56:30 +0800 | [diff] [blame] | 931 | TRACE_EVENT(f2fs_reserve_new_blocks, |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 932 | |
Chao Yu | 46008c6 | 2016-05-09 19:56:30 +0800 | [diff] [blame] | 933 | TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node, |
| 934 | blkcnt_t count), |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 935 | |
Chao Yu | 46008c6 | 2016-05-09 19:56:30 +0800 | [diff] [blame] | 936 | TP_ARGS(inode, nid, ofs_in_node, count), |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 937 | |
| 938 | TP_STRUCT__entry( |
| 939 | __field(dev_t, dev) |
| 940 | __field(nid_t, nid) |
| 941 | __field(unsigned int, ofs_in_node) |
Chao Yu | 46008c6 | 2016-05-09 19:56:30 +0800 | [diff] [blame] | 942 | __field(blkcnt_t, count) |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 943 | ), |
| 944 | |
| 945 | TP_fast_assign( |
| 946 | __entry->dev = inode->i_sb->s_dev; |
| 947 | __entry->nid = nid; |
| 948 | __entry->ofs_in_node = ofs_in_node; |
Chao Yu | 46008c6 | 2016-05-09 19:56:30 +0800 | [diff] [blame] | 949 | __entry->count = count; |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 950 | ), |
| 951 | |
Chao Yu | 46008c6 | 2016-05-09 19:56:30 +0800 | [diff] [blame] | 952 | TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 953 | show_dev(__entry->dev), |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 954 | (unsigned int)__entry->nid, |
Chao Yu | 46008c6 | 2016-05-09 19:56:30 +0800 | [diff] [blame] | 955 | __entry->ofs_in_node, |
| 956 | (unsigned long long)__entry->count) |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 957 | ); |
| 958 | |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 959 | DECLARE_EVENT_CLASS(f2fs__submit_page_bio, |
| 960 | |
Chao Yu | 2ace38e | 2014-12-24 16:08:14 +0800 | [diff] [blame] | 961 | TP_PROTO(struct page *page, struct f2fs_io_info *fio), |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 962 | |
Chao Yu | 2ace38e | 2014-12-24 16:08:14 +0800 | [diff] [blame] | 963 | TP_ARGS(page, fio), |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 964 | |
| 965 | TP_STRUCT__entry( |
| 966 | __field(dev_t, dev) |
| 967 | __field(ino_t, ino) |
| 968 | __field(pgoff_t, index) |
Chao Yu | 7a9d754 | 2016-02-22 18:36:38 +0800 | [diff] [blame] | 969 | __field(block_t, old_blkaddr) |
| 970 | __field(block_t, new_blkaddr) |
Mike Christie | 04d328d | 2016-06-05 14:31:55 -0500 | [diff] [blame] | 971 | __field(int, op) |
| 972 | __field(int, op_flags) |
Jaegeuk Kim | a912b54 | 2017-05-10 11:18:25 -0700 | [diff] [blame] | 973 | __field(int, temp) |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 974 | __field(int, type) |
| 975 | ), |
| 976 | |
| 977 | TP_fast_assign( |
| 978 | __entry->dev = page->mapping->host->i_sb->s_dev; |
| 979 | __entry->ino = page->mapping->host->i_ino; |
| 980 | __entry->index = page->index; |
Chao Yu | 7a9d754 | 2016-02-22 18:36:38 +0800 | [diff] [blame] | 981 | __entry->old_blkaddr = fio->old_blkaddr; |
| 982 | __entry->new_blkaddr = fio->new_blkaddr; |
Mike Christie | 04d328d | 2016-06-05 14:31:55 -0500 | [diff] [blame] | 983 | __entry->op = fio->op; |
| 984 | __entry->op_flags = fio->op_flags; |
Jaegeuk Kim | a912b54 | 2017-05-10 11:18:25 -0700 | [diff] [blame] | 985 | __entry->temp = fio->temp; |
Chao Yu | 2ace38e | 2014-12-24 16:08:14 +0800 | [diff] [blame] | 986 | __entry->type = fio->type; |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 987 | ), |
| 988 | |
| 989 | TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " |
Jaegeuk Kim | a912b54 | 2017-05-10 11:18:25 -0700 | [diff] [blame] | 990 | "oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s", |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 991 | show_dev_ino(__entry), |
| 992 | (unsigned long)__entry->index, |
Chao Yu | 7a9d754 | 2016-02-22 18:36:38 +0800 | [diff] [blame] | 993 | (unsigned long long)__entry->old_blkaddr, |
| 994 | (unsigned long long)__entry->new_blkaddr, |
Jaegeuk Kim | d621e6b | 2016-12-21 14:26:39 -0800 | [diff] [blame] | 995 | show_bio_type(__entry->op, __entry->op_flags), |
Jaegeuk Kim | a912b54 | 2017-05-10 11:18:25 -0700 | [diff] [blame] | 996 | show_block_temp(__entry->temp), |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 997 | show_block_type(__entry->type)) |
| 998 | ); |
| 999 | |
| 1000 | DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio, |
| 1001 | |
Chao Yu | 2ace38e | 2014-12-24 16:08:14 +0800 | [diff] [blame] | 1002 | TP_PROTO(struct page *page, struct f2fs_io_info *fio), |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1003 | |
Chao Yu | 2ace38e | 2014-12-24 16:08:14 +0800 | [diff] [blame] | 1004 | TP_ARGS(page, fio), |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1005 | |
| 1006 | TP_CONDITION(page->mapping) |
| 1007 | ); |
| 1008 | |
Jaegeuk Kim | b9109b0 | 2017-05-10 11:28:38 -0700 | [diff] [blame] | 1009 | DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_write, |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1010 | |
Chao Yu | 2ace38e | 2014-12-24 16:08:14 +0800 | [diff] [blame] | 1011 | TP_PROTO(struct page *page, struct f2fs_io_info *fio), |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1012 | |
Chao Yu | 2ace38e | 2014-12-24 16:08:14 +0800 | [diff] [blame] | 1013 | TP_ARGS(page, fio), |
Chao Yu | 3e1c8f1 | 2014-12-23 16:35:21 +0800 | [diff] [blame] | 1014 | |
| 1015 | TP_CONDITION(page->mapping) |
| 1016 | ); |
| 1017 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1018 | DECLARE_EVENT_CLASS(f2fs__bio, |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 1019 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1020 | TP_PROTO(struct super_block *sb, int type, struct bio *bio), |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 1021 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1022 | TP_ARGS(sb, type, bio), |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 1023 | |
| 1024 | TP_STRUCT__entry( |
| 1025 | __field(dev_t, dev) |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1026 | __field(dev_t, target) |
Mike Christie | 04d328d | 2016-06-05 14:31:55 -0500 | [diff] [blame] | 1027 | __field(int, op) |
| 1028 | __field(int, op_flags) |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1029 | __field(int, type) |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 1030 | __field(sector_t, sector) |
| 1031 | __field(unsigned int, size) |
| 1032 | ), |
| 1033 | |
| 1034 | TP_fast_assign( |
| 1035 | __entry->dev = sb->s_dev; |
Christoph Hellwig | 74d4699 | 2017-08-23 19:10:32 +0200 | [diff] [blame] | 1036 | __entry->target = bio_dev(bio); |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1037 | __entry->op = bio_op(bio); |
| 1038 | __entry->op_flags = bio->bi_opf; |
| 1039 | __entry->type = type; |
Kent Overstreet | 4f024f3 | 2013-10-11 15:44:27 -0700 | [diff] [blame] | 1040 | __entry->sector = bio->bi_iter.bi_sector; |
| 1041 | __entry->size = bio->bi_iter.bi_size; |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 1042 | ), |
| 1043 | |
Chao Yu | baaabbb | 2017-05-04 09:35:43 +0800 | [diff] [blame] | 1044 | TP_printk("dev = (%d,%d)/(%d,%d), rw = %s(%s), %s, sector = %lld, size = %u", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1045 | show_dev(__entry->target), |
| 1046 | show_dev(__entry->dev), |
Jaegeuk Kim | d621e6b | 2016-12-21 14:26:39 -0800 | [diff] [blame] | 1047 | show_bio_type(__entry->op, __entry->op_flags), |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1048 | show_block_type(__entry->type), |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 1049 | (unsigned long long)__entry->sector, |
| 1050 | __entry->size) |
| 1051 | ); |
| 1052 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1053 | DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio, |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1054 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1055 | TP_PROTO(struct super_block *sb, int type, struct bio *bio), |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1056 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1057 | TP_ARGS(sb, type, bio), |
Jaegeuk Kim | 93dfe2a | 2013-11-30 12:51:14 +0900 | [diff] [blame] | 1058 | |
| 1059 | TP_CONDITION(bio) |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1060 | ); |
| 1061 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1062 | DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio, |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1063 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1064 | TP_PROTO(struct super_block *sb, int type, struct bio *bio), |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1065 | |
Jaegeuk Kim | 554b512 | 2016-12-21 12:13:03 -0800 | [diff] [blame] | 1066 | TP_ARGS(sb, type, bio), |
| 1067 | |
| 1068 | TP_CONDITION(bio) |
| 1069 | ); |
| 1070 | |
| 1071 | DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_read_bio, |
| 1072 | |
| 1073 | TP_PROTO(struct super_block *sb, int type, struct bio *bio), |
| 1074 | |
| 1075 | TP_ARGS(sb, type, bio), |
| 1076 | |
| 1077 | TP_CONDITION(bio) |
| 1078 | ); |
| 1079 | |
| 1080 | DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio, |
| 1081 | |
| 1082 | TP_PROTO(struct super_block *sb, int type, struct bio *bio), |
| 1083 | |
| 1084 | TP_ARGS(sb, type, bio), |
Jaegeuk Kim | 93dfe2a | 2013-11-30 12:51:14 +0900 | [diff] [blame] | 1085 | |
| 1086 | TP_CONDITION(bio) |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 1087 | ); |
| 1088 | |
Chao Yu | 62aed04 | 2014-05-06 16:46:04 +0800 | [diff] [blame] | 1089 | TRACE_EVENT(f2fs_write_begin, |
| 1090 | |
| 1091 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, |
| 1092 | unsigned int flags), |
| 1093 | |
| 1094 | TP_ARGS(inode, pos, len, flags), |
| 1095 | |
| 1096 | TP_STRUCT__entry( |
| 1097 | __field(dev_t, dev) |
| 1098 | __field(ino_t, ino) |
| 1099 | __field(loff_t, pos) |
| 1100 | __field(unsigned int, len) |
| 1101 | __field(unsigned int, flags) |
| 1102 | ), |
| 1103 | |
| 1104 | TP_fast_assign( |
| 1105 | __entry->dev = inode->i_sb->s_dev; |
| 1106 | __entry->ino = inode->i_ino; |
| 1107 | __entry->pos = pos; |
| 1108 | __entry->len = len; |
| 1109 | __entry->flags = flags; |
| 1110 | ), |
| 1111 | |
| 1112 | TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u", |
| 1113 | show_dev_ino(__entry), |
| 1114 | (unsigned long long)__entry->pos, |
| 1115 | __entry->len, |
| 1116 | __entry->flags) |
| 1117 | ); |
| 1118 | |
Chao Yu | dfb2bf3 | 2014-05-06 16:47:23 +0800 | [diff] [blame] | 1119 | TRACE_EVENT(f2fs_write_end, |
| 1120 | |
| 1121 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, |
| 1122 | unsigned int copied), |
| 1123 | |
| 1124 | TP_ARGS(inode, pos, len, copied), |
| 1125 | |
| 1126 | TP_STRUCT__entry( |
| 1127 | __field(dev_t, dev) |
| 1128 | __field(ino_t, ino) |
| 1129 | __field(loff_t, pos) |
| 1130 | __field(unsigned int, len) |
| 1131 | __field(unsigned int, copied) |
| 1132 | ), |
| 1133 | |
| 1134 | TP_fast_assign( |
| 1135 | __entry->dev = inode->i_sb->s_dev; |
| 1136 | __entry->ino = inode->i_ino; |
| 1137 | __entry->pos = pos; |
| 1138 | __entry->len = len; |
| 1139 | __entry->copied = copied; |
| 1140 | ), |
| 1141 | |
| 1142 | TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u", |
| 1143 | show_dev_ino(__entry), |
| 1144 | (unsigned long long)__entry->pos, |
| 1145 | __entry->len, |
| 1146 | __entry->copied) |
| 1147 | ); |
| 1148 | |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 1149 | DECLARE_EVENT_CLASS(f2fs__page, |
| 1150 | |
| 1151 | TP_PROTO(struct page *page, int type), |
| 1152 | |
| 1153 | TP_ARGS(page, type), |
| 1154 | |
| 1155 | TP_STRUCT__entry( |
| 1156 | __field(dev_t, dev) |
| 1157 | __field(ino_t, ino) |
| 1158 | __field(int, type) |
| 1159 | __field(int, dir) |
| 1160 | __field(pgoff_t, index) |
| 1161 | __field(int, dirty) |
Chao Yu | c20e89c | 2014-05-06 16:53:08 +0800 | [diff] [blame] | 1162 | __field(int, uptodate) |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 1163 | ), |
| 1164 | |
| 1165 | TP_fast_assign( |
| 1166 | __entry->dev = page->mapping->host->i_sb->s_dev; |
| 1167 | __entry->ino = page->mapping->host->i_ino; |
| 1168 | __entry->type = type; |
| 1169 | __entry->dir = S_ISDIR(page->mapping->host->i_mode); |
| 1170 | __entry->index = page->index; |
| 1171 | __entry->dirty = PageDirty(page); |
Chao Yu | c20e89c | 2014-05-06 16:53:08 +0800 | [diff] [blame] | 1172 | __entry->uptodate = PageUptodate(page); |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 1173 | ), |
| 1174 | |
Chao Yu | c20e89c | 2014-05-06 16:53:08 +0800 | [diff] [blame] | 1175 | TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, " |
| 1176 | "dirty = %d, uptodate = %d", |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 1177 | show_dev_ino(__entry), |
| 1178 | show_block_type(__entry->type), |
| 1179 | show_file_type(__entry->dir), |
| 1180 | (unsigned long)__entry->index, |
Chao Yu | c20e89c | 2014-05-06 16:53:08 +0800 | [diff] [blame] | 1181 | __entry->dirty, |
| 1182 | __entry->uptodate) |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 1183 | ); |
| 1184 | |
Chao Yu | ecda0de | 2014-05-06 16:48:26 +0800 | [diff] [blame] | 1185 | DEFINE_EVENT(f2fs__page, f2fs_writepage, |
| 1186 | |
| 1187 | TP_PROTO(struct page *page, int type), |
| 1188 | |
| 1189 | TP_ARGS(page, type) |
| 1190 | ); |
| 1191 | |
Jaegeuk Kim | 8ce67cb | 2015-03-17 17:58:08 -0700 | [diff] [blame] | 1192 | DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page, |
| 1193 | |
| 1194 | TP_PROTO(struct page *page, int type), |
| 1195 | |
| 1196 | TP_ARGS(page, type) |
| 1197 | ); |
| 1198 | |
Chao Yu | c20e89c | 2014-05-06 16:53:08 +0800 | [diff] [blame] | 1199 | DEFINE_EVENT(f2fs__page, f2fs_readpage, |
| 1200 | |
| 1201 | TP_PROTO(struct page *page, int type), |
| 1202 | |
| 1203 | TP_ARGS(page, type) |
| 1204 | ); |
| 1205 | |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 1206 | DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty, |
| 1207 | |
| 1208 | TP_PROTO(struct page *page, int type), |
| 1209 | |
| 1210 | TP_ARGS(page, type) |
| 1211 | ); |
| 1212 | |
Jaegeuk Kim | e943a10 | 2013-10-25 14:26:31 +0900 | [diff] [blame] | 1213 | DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite, |
| 1214 | |
| 1215 | TP_PROTO(struct page *page, int type), |
| 1216 | |
| 1217 | TP_ARGS(page, type) |
| 1218 | ); |
| 1219 | |
Jaegeuk Kim | 8ce67cb | 2015-03-17 17:58:08 -0700 | [diff] [blame] | 1220 | DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page, |
| 1221 | |
| 1222 | TP_PROTO(struct page *page, int type), |
| 1223 | |
| 1224 | TP_ARGS(page, type) |
| 1225 | ); |
| 1226 | |
| 1227 | DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page, |
| 1228 | |
| 1229 | TP_PROTO(struct page *page, int type), |
| 1230 | |
| 1231 | TP_ARGS(page, type) |
| 1232 | ); |
| 1233 | |
Chao Yu | e574843 | 2014-05-06 16:51:24 +0800 | [diff] [blame] | 1234 | TRACE_EVENT(f2fs_writepages, |
| 1235 | |
| 1236 | TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type), |
| 1237 | |
| 1238 | TP_ARGS(inode, wbc, type), |
| 1239 | |
| 1240 | TP_STRUCT__entry( |
| 1241 | __field(dev_t, dev) |
| 1242 | __field(ino_t, ino) |
| 1243 | __field(int, type) |
| 1244 | __field(int, dir) |
| 1245 | __field(long, nr_to_write) |
| 1246 | __field(long, pages_skipped) |
| 1247 | __field(loff_t, range_start) |
| 1248 | __field(loff_t, range_end) |
| 1249 | __field(pgoff_t, writeback_index) |
| 1250 | __field(int, sync_mode) |
| 1251 | __field(char, for_kupdate) |
| 1252 | __field(char, for_background) |
| 1253 | __field(char, tagged_writepages) |
| 1254 | __field(char, for_reclaim) |
| 1255 | __field(char, range_cyclic) |
| 1256 | __field(char, for_sync) |
| 1257 | ), |
| 1258 | |
| 1259 | TP_fast_assign( |
| 1260 | __entry->dev = inode->i_sb->s_dev; |
| 1261 | __entry->ino = inode->i_ino; |
| 1262 | __entry->type = type; |
| 1263 | __entry->dir = S_ISDIR(inode->i_mode); |
| 1264 | __entry->nr_to_write = wbc->nr_to_write; |
| 1265 | __entry->pages_skipped = wbc->pages_skipped; |
| 1266 | __entry->range_start = wbc->range_start; |
| 1267 | __entry->range_end = wbc->range_end; |
| 1268 | __entry->writeback_index = inode->i_mapping->writeback_index; |
| 1269 | __entry->sync_mode = wbc->sync_mode; |
| 1270 | __entry->for_kupdate = wbc->for_kupdate; |
| 1271 | __entry->for_background = wbc->for_background; |
| 1272 | __entry->tagged_writepages = wbc->tagged_writepages; |
| 1273 | __entry->for_reclaim = wbc->for_reclaim; |
| 1274 | __entry->range_cyclic = wbc->range_cyclic; |
| 1275 | __entry->for_sync = wbc->for_sync; |
| 1276 | ), |
| 1277 | |
| 1278 | TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, " |
| 1279 | "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, " |
| 1280 | "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u", |
| 1281 | show_dev_ino(__entry), |
| 1282 | show_block_type(__entry->type), |
| 1283 | show_file_type(__entry->dir), |
| 1284 | __entry->nr_to_write, |
| 1285 | __entry->pages_skipped, |
| 1286 | __entry->range_start, |
| 1287 | __entry->range_end, |
| 1288 | (unsigned long)__entry->writeback_index, |
| 1289 | __entry->sync_mode, |
| 1290 | __entry->for_kupdate, |
| 1291 | __entry->for_background, |
| 1292 | __entry->tagged_writepages, |
| 1293 | __entry->for_reclaim, |
| 1294 | __entry->range_cyclic, |
| 1295 | __entry->for_sync) |
| 1296 | ); |
| 1297 | |
Chao Yu | b8c2940 | 2015-10-12 17:02:26 +0800 | [diff] [blame] | 1298 | TRACE_EVENT(f2fs_readpages, |
| 1299 | |
| 1300 | TP_PROTO(struct inode *inode, struct page *page, unsigned int nrpage), |
| 1301 | |
| 1302 | TP_ARGS(inode, page, nrpage), |
| 1303 | |
| 1304 | TP_STRUCT__entry( |
| 1305 | __field(dev_t, dev) |
| 1306 | __field(ino_t, ino) |
| 1307 | __field(pgoff_t, start) |
| 1308 | __field(unsigned int, nrpage) |
| 1309 | ), |
| 1310 | |
| 1311 | TP_fast_assign( |
| 1312 | __entry->dev = inode->i_sb->s_dev; |
| 1313 | __entry->ino = inode->i_ino; |
| 1314 | __entry->start = page->index; |
| 1315 | __entry->nrpage = nrpage; |
| 1316 | ), |
| 1317 | |
| 1318 | TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u", |
| 1319 | show_dev_ino(__entry), |
| 1320 | (unsigned long)__entry->start, |
| 1321 | __entry->nrpage) |
| 1322 | ); |
| 1323 | |
Namjae Jeon | 2af4bd6 | 2013-04-23 18:26:54 +0900 | [diff] [blame] | 1324 | TRACE_EVENT(f2fs_write_checkpoint, |
| 1325 | |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 1326 | TP_PROTO(struct super_block *sb, int reason, char *msg), |
Namjae Jeon | 2af4bd6 | 2013-04-23 18:26:54 +0900 | [diff] [blame] | 1327 | |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 1328 | TP_ARGS(sb, reason, msg), |
Namjae Jeon | 2af4bd6 | 2013-04-23 18:26:54 +0900 | [diff] [blame] | 1329 | |
| 1330 | TP_STRUCT__entry( |
| 1331 | __field(dev_t, dev) |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 1332 | __field(int, reason) |
Namjae Jeon | 2af4bd6 | 2013-04-23 18:26:54 +0900 | [diff] [blame] | 1333 | __field(char *, msg) |
| 1334 | ), |
| 1335 | |
| 1336 | TP_fast_assign( |
| 1337 | __entry->dev = sb->s_dev; |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 1338 | __entry->reason = reason; |
Namjae Jeon | 2af4bd6 | 2013-04-23 18:26:54 +0900 | [diff] [blame] | 1339 | __entry->msg = msg; |
| 1340 | ), |
| 1341 | |
| 1342 | TP_printk("dev = (%d,%d), checkpoint for %s, state = %s", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1343 | show_dev(__entry->dev), |
Jaegeuk Kim | 75ab4cb | 2014-09-20 21:57:51 -0700 | [diff] [blame] | 1344 | show_cpreason(__entry->reason), |
Namjae Jeon | 2af4bd6 | 2013-04-23 18:26:54 +0900 | [diff] [blame] | 1345 | __entry->msg) |
| 1346 | ); |
| 1347 | |
Chao Yu | 0243a5f | 2017-04-15 14:09:38 +0800 | [diff] [blame] | 1348 | DECLARE_EVENT_CLASS(f2fs_discard, |
Jaegeuk Kim | 1661d07 | 2013-11-12 17:01:00 +0900 | [diff] [blame] | 1349 | |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1350 | TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen), |
Jaegeuk Kim | 1661d07 | 2013-11-12 17:01:00 +0900 | [diff] [blame] | 1351 | |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1352 | TP_ARGS(dev, blkstart, blklen), |
Jaegeuk Kim | 1661d07 | 2013-11-12 17:01:00 +0900 | [diff] [blame] | 1353 | |
| 1354 | TP_STRUCT__entry( |
| 1355 | __field(dev_t, dev) |
| 1356 | __field(block_t, blkstart) |
| 1357 | __field(block_t, blklen) |
| 1358 | ), |
| 1359 | |
| 1360 | TP_fast_assign( |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1361 | __entry->dev = dev->bd_dev; |
Jaegeuk Kim | 1661d07 | 2013-11-12 17:01:00 +0900 | [diff] [blame] | 1362 | __entry->blkstart = blkstart; |
| 1363 | __entry->blklen = blklen; |
| 1364 | ), |
| 1365 | |
| 1366 | TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1367 | show_dev(__entry->dev), |
Jaegeuk Kim | 1661d07 | 2013-11-12 17:01:00 +0900 | [diff] [blame] | 1368 | (unsigned long long)__entry->blkstart, |
| 1369 | (unsigned long long)__entry->blklen) |
| 1370 | ); |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1371 | |
Chao Yu | 0243a5f | 2017-04-15 14:09:38 +0800 | [diff] [blame] | 1372 | DEFINE_EVENT(f2fs_discard, f2fs_queue_discard, |
| 1373 | |
| 1374 | TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen), |
| 1375 | |
| 1376 | TP_ARGS(dev, blkstart, blklen) |
| 1377 | ); |
| 1378 | |
| 1379 | DEFINE_EVENT(f2fs_discard, f2fs_issue_discard, |
| 1380 | |
| 1381 | TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen), |
| 1382 | |
| 1383 | TP_ARGS(dev, blkstart, blklen) |
| 1384 | ); |
| 1385 | |
Chao Yu | 2ec6f2e | 2017-10-04 09:08:36 +0800 | [diff] [blame] | 1386 | DEFINE_EVENT(f2fs_discard, f2fs_remove_discard, |
| 1387 | |
| 1388 | TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen), |
| 1389 | |
| 1390 | TP_ARGS(dev, blkstart, blklen) |
| 1391 | ); |
| 1392 | |
Damien Le Moal | 126606c | 2016-10-28 17:45:07 +0900 | [diff] [blame] | 1393 | TRACE_EVENT(f2fs_issue_reset_zone, |
| 1394 | |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1395 | TP_PROTO(struct block_device *dev, block_t blkstart), |
Damien Le Moal | 126606c | 2016-10-28 17:45:07 +0900 | [diff] [blame] | 1396 | |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1397 | TP_ARGS(dev, blkstart), |
Damien Le Moal | 126606c | 2016-10-28 17:45:07 +0900 | [diff] [blame] | 1398 | |
| 1399 | TP_STRUCT__entry( |
| 1400 | __field(dev_t, dev) |
| 1401 | __field(block_t, blkstart) |
| 1402 | ), |
| 1403 | |
| 1404 | TP_fast_assign( |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1405 | __entry->dev = dev->bd_dev; |
Damien Le Moal | 126606c | 2016-10-28 17:45:07 +0900 | [diff] [blame] | 1406 | __entry->blkstart = blkstart; |
| 1407 | ), |
| 1408 | |
| 1409 | TP_printk("dev = (%d,%d), reset zone at block = 0x%llx", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1410 | show_dev(__entry->dev), |
Damien Le Moal | 126606c | 2016-10-28 17:45:07 +0900 | [diff] [blame] | 1411 | (unsigned long long)__entry->blkstart) |
| 1412 | ); |
| 1413 | |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1414 | TRACE_EVENT(f2fs_issue_flush, |
| 1415 | |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1416 | TP_PROTO(struct block_device *dev, unsigned int nobarrier, |
Kinglong Mee | 20fda56b | 2017-03-04 22:13:10 +0800 | [diff] [blame] | 1417 | unsigned int flush_merge, int ret), |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1418 | |
Kinglong Mee | 20fda56b | 2017-03-04 22:13:10 +0800 | [diff] [blame] | 1419 | TP_ARGS(dev, nobarrier, flush_merge, ret), |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1420 | |
| 1421 | TP_STRUCT__entry( |
| 1422 | __field(dev_t, dev) |
Jaegeuk Kim | 29e7043 | 2015-02-10 16:23:12 -0800 | [diff] [blame] | 1423 | __field(unsigned int, nobarrier) |
| 1424 | __field(unsigned int, flush_merge) |
Kinglong Mee | 20fda56b | 2017-03-04 22:13:10 +0800 | [diff] [blame] | 1425 | __field(int, ret) |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1426 | ), |
| 1427 | |
| 1428 | TP_fast_assign( |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1429 | __entry->dev = dev->bd_dev; |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1430 | __entry->nobarrier = nobarrier; |
| 1431 | __entry->flush_merge = flush_merge; |
Kinglong Mee | 20fda56b | 2017-03-04 22:13:10 +0800 | [diff] [blame] | 1432 | __entry->ret = ret; |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1433 | ), |
| 1434 | |
Kinglong Mee | 20fda56b | 2017-03-04 22:13:10 +0800 | [diff] [blame] | 1435 | TP_printk("dev = (%d,%d), %s %s, ret = %d", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1436 | show_dev(__entry->dev), |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1437 | __entry->nobarrier ? "skip (nobarrier)" : "issue", |
Kinglong Mee | 20fda56b | 2017-03-04 22:13:10 +0800 | [diff] [blame] | 1438 | __entry->flush_merge ? " with flush_merge" : "", |
| 1439 | __entry->ret) |
Jaegeuk Kim | 24a9ee0 | 2014-07-25 17:46:10 -0700 | [diff] [blame] | 1440 | ); |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1441 | |
| 1442 | TRACE_EVENT(f2fs_lookup_extent_tree_start, |
| 1443 | |
| 1444 | TP_PROTO(struct inode *inode, unsigned int pgofs), |
| 1445 | |
| 1446 | TP_ARGS(inode, pgofs), |
| 1447 | |
| 1448 | TP_STRUCT__entry( |
| 1449 | __field(dev_t, dev) |
| 1450 | __field(ino_t, ino) |
| 1451 | __field(unsigned int, pgofs) |
| 1452 | ), |
| 1453 | |
| 1454 | TP_fast_assign( |
| 1455 | __entry->dev = inode->i_sb->s_dev; |
| 1456 | __entry->ino = inode->i_ino; |
| 1457 | __entry->pgofs = pgofs; |
| 1458 | ), |
| 1459 | |
| 1460 | TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u", |
| 1461 | show_dev_ino(__entry), |
| 1462 | __entry->pgofs) |
| 1463 | ); |
| 1464 | |
| 1465 | TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end, |
| 1466 | |
| 1467 | TP_PROTO(struct inode *inode, unsigned int pgofs, |
Jaegeuk Kim | 84bc926 | 2015-06-29 16:01:14 -0700 | [diff] [blame] | 1468 | struct extent_info *ei), |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1469 | |
Jaegeuk Kim | 84bc926 | 2015-06-29 16:01:14 -0700 | [diff] [blame] | 1470 | TP_ARGS(inode, pgofs, ei), |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1471 | |
Jaegeuk Kim | 84bc926 | 2015-06-29 16:01:14 -0700 | [diff] [blame] | 1472 | TP_CONDITION(ei), |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1473 | |
| 1474 | TP_STRUCT__entry( |
| 1475 | __field(dev_t, dev) |
| 1476 | __field(ino_t, ino) |
| 1477 | __field(unsigned int, pgofs) |
| 1478 | __field(unsigned int, fofs) |
| 1479 | __field(u32, blk) |
| 1480 | __field(unsigned int, len) |
| 1481 | ), |
| 1482 | |
| 1483 | TP_fast_assign( |
| 1484 | __entry->dev = inode->i_sb->s_dev; |
| 1485 | __entry->ino = inode->i_ino; |
| 1486 | __entry->pgofs = pgofs; |
Jaegeuk Kim | 84bc926 | 2015-06-29 16:01:14 -0700 | [diff] [blame] | 1487 | __entry->fofs = ei->fofs; |
| 1488 | __entry->blk = ei->blk; |
| 1489 | __entry->len = ei->len; |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1490 | ), |
| 1491 | |
| 1492 | TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, " |
| 1493 | "ext_info(fofs: %u, blk: %u, len: %u)", |
| 1494 | show_dev_ino(__entry), |
| 1495 | __entry->pgofs, |
| 1496 | __entry->fofs, |
| 1497 | __entry->blk, |
| 1498 | __entry->len) |
| 1499 | ); |
| 1500 | |
Chao Yu | 744288c | 2015-09-06 17:50:13 +0800 | [diff] [blame] | 1501 | TRACE_EVENT(f2fs_update_extent_tree_range, |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1502 | |
Chao Yu | 744288c | 2015-09-06 17:50:13 +0800 | [diff] [blame] | 1503 | TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr, |
| 1504 | unsigned int len), |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1505 | |
Chao Yu | 744288c | 2015-09-06 17:50:13 +0800 | [diff] [blame] | 1506 | TP_ARGS(inode, pgofs, blkaddr, len), |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1507 | |
| 1508 | TP_STRUCT__entry( |
| 1509 | __field(dev_t, dev) |
| 1510 | __field(ino_t, ino) |
| 1511 | __field(unsigned int, pgofs) |
| 1512 | __field(u32, blk) |
Chao Yu | 744288c | 2015-09-06 17:50:13 +0800 | [diff] [blame] | 1513 | __field(unsigned int, len) |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1514 | ), |
| 1515 | |
| 1516 | TP_fast_assign( |
| 1517 | __entry->dev = inode->i_sb->s_dev; |
| 1518 | __entry->ino = inode->i_ino; |
| 1519 | __entry->pgofs = pgofs; |
| 1520 | __entry->blk = blkaddr; |
Chao Yu | 744288c | 2015-09-06 17:50:13 +0800 | [diff] [blame] | 1521 | __entry->len = len; |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1522 | ), |
| 1523 | |
Chao Yu | 744288c | 2015-09-06 17:50:13 +0800 | [diff] [blame] | 1524 | TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, " |
| 1525 | "blkaddr = %u, len = %u", |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1526 | show_dev_ino(__entry), |
| 1527 | __entry->pgofs, |
Chao Yu | 744288c | 2015-09-06 17:50:13 +0800 | [diff] [blame] | 1528 | __entry->blk, |
| 1529 | __entry->len) |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1530 | ); |
| 1531 | |
| 1532 | TRACE_EVENT(f2fs_shrink_extent_tree, |
| 1533 | |
| 1534 | TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt, |
| 1535 | unsigned int tree_cnt), |
| 1536 | |
| 1537 | TP_ARGS(sbi, node_cnt, tree_cnt), |
| 1538 | |
| 1539 | TP_STRUCT__entry( |
| 1540 | __field(dev_t, dev) |
| 1541 | __field(unsigned int, node_cnt) |
| 1542 | __field(unsigned int, tree_cnt) |
| 1543 | ), |
| 1544 | |
| 1545 | TP_fast_assign( |
| 1546 | __entry->dev = sbi->sb->s_dev; |
| 1547 | __entry->node_cnt = node_cnt; |
| 1548 | __entry->tree_cnt = tree_cnt; |
| 1549 | ), |
| 1550 | |
| 1551 | TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1552 | show_dev(__entry->dev), |
Chao Yu | 1ec4610 | 2015-02-05 17:59:59 +0800 | [diff] [blame] | 1553 | __entry->node_cnt, |
| 1554 | __entry->tree_cnt) |
| 1555 | ); |
| 1556 | |
| 1557 | TRACE_EVENT(f2fs_destroy_extent_tree, |
| 1558 | |
| 1559 | TP_PROTO(struct inode *inode, unsigned int node_cnt), |
| 1560 | |
| 1561 | TP_ARGS(inode, node_cnt), |
| 1562 | |
| 1563 | TP_STRUCT__entry( |
| 1564 | __field(dev_t, dev) |
| 1565 | __field(ino_t, ino) |
| 1566 | __field(unsigned int, node_cnt) |
| 1567 | ), |
| 1568 | |
| 1569 | TP_fast_assign( |
| 1570 | __entry->dev = inode->i_sb->s_dev; |
| 1571 | __entry->ino = inode->i_ino; |
| 1572 | __entry->node_cnt = node_cnt; |
| 1573 | ), |
| 1574 | |
| 1575 | TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u", |
| 1576 | show_dev_ino(__entry), |
| 1577 | __entry->node_cnt) |
| 1578 | ); |
| 1579 | |
Chao Yu | 4cf1853 | 2015-12-17 17:17:16 +0800 | [diff] [blame] | 1580 | DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes, |
| 1581 | |
Jaegeuk Kim | 523be8a | 2016-05-13 12:36:58 -0700 | [diff] [blame] | 1582 | TP_PROTO(struct super_block *sb, int type, s64 count), |
Chao Yu | 4cf1853 | 2015-12-17 17:17:16 +0800 | [diff] [blame] | 1583 | |
| 1584 | TP_ARGS(sb, type, count), |
| 1585 | |
| 1586 | TP_STRUCT__entry( |
| 1587 | __field(dev_t, dev) |
| 1588 | __field(int, type) |
Jaegeuk Kim | 523be8a | 2016-05-13 12:36:58 -0700 | [diff] [blame] | 1589 | __field(s64, count) |
Chao Yu | 4cf1853 | 2015-12-17 17:17:16 +0800 | [diff] [blame] | 1590 | ), |
| 1591 | |
| 1592 | TP_fast_assign( |
| 1593 | __entry->dev = sb->s_dev; |
| 1594 | __entry->type = type; |
| 1595 | __entry->count = count; |
| 1596 | ), |
| 1597 | |
Jaegeuk Kim | 523be8a | 2016-05-13 12:36:58 -0700 | [diff] [blame] | 1598 | TP_printk("dev = (%d,%d), %s, dirty count = %lld", |
Jaegeuk Kim | d50aaee | 2017-02-15 11:14:06 -0800 | [diff] [blame] | 1599 | show_dev(__entry->dev), |
Chao Yu | 4cf1853 | 2015-12-17 17:17:16 +0800 | [diff] [blame] | 1600 | show_file_type(__entry->type), |
| 1601 | __entry->count) |
| 1602 | ); |
| 1603 | |
| 1604 | DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter, |
| 1605 | |
Jaegeuk Kim | 523be8a | 2016-05-13 12:36:58 -0700 | [diff] [blame] | 1606 | TP_PROTO(struct super_block *sb, int type, s64 count), |
Chao Yu | 4cf1853 | 2015-12-17 17:17:16 +0800 | [diff] [blame] | 1607 | |
| 1608 | TP_ARGS(sb, type, count) |
| 1609 | ); |
| 1610 | |
| 1611 | DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit, |
| 1612 | |
Jaegeuk Kim | 523be8a | 2016-05-13 12:36:58 -0700 | [diff] [blame] | 1613 | TP_PROTO(struct super_block *sb, int type, s64 count), |
Chao Yu | 4cf1853 | 2015-12-17 17:17:16 +0800 | [diff] [blame] | 1614 | |
| 1615 | TP_ARGS(sb, type, count) |
| 1616 | ); |
| 1617 | |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 1618 | #endif /* _TRACE_F2FS_H */ |
| 1619 | |
| 1620 | /* This part must be outside protection */ |
| 1621 | #include <trace/define_trace.h> |