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