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