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