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