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