1 #undef TRACE_SYSTEM 2 #define TRACE_SYSTEM ext4 3 4 #if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ) 5 #define _TRACE_EXT4_H 6 7 #include <linux/writeback.h> 8 #include <linux/tracepoint.h> 9 10 struct ext4_allocation_context; 11 struct ext4_allocation_request; 12 struct ext4_extent; 13 struct ext4_prealloc_space; 14 struct ext4_inode_info; 15 struct mpage_da_data; 16 struct ext4_map_blocks; 17 struct extent_status; 18 19 #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) 20 21 #define show_mballoc_flags(flags) __print_flags(flags, "|", \ 22 { EXT4_MB_HINT_MERGE, "HINT_MERGE" }, \ 23 { EXT4_MB_HINT_RESERVED, "HINT_RESV" }, \ 24 { EXT4_MB_HINT_METADATA, "HINT_MDATA" }, \ 25 { EXT4_MB_HINT_FIRST, "HINT_FIRST" }, \ 26 { EXT4_MB_HINT_BEST, "HINT_BEST" }, \ 27 { EXT4_MB_HINT_DATA, "HINT_DATA" }, \ 28 { EXT4_MB_HINT_NOPREALLOC, "HINT_NOPREALLOC" }, \ 29 { EXT4_MB_HINT_GROUP_ALLOC, "HINT_GRP_ALLOC" }, \ 30 { EXT4_MB_HINT_GOAL_ONLY, "HINT_GOAL_ONLY" }, \ 31 { EXT4_MB_HINT_TRY_GOAL, "HINT_TRY_GOAL" }, \ 32 { EXT4_MB_DELALLOC_RESERVED, "DELALLOC_RESV" }, \ 33 { EXT4_MB_STREAM_ALLOC, "STREAM_ALLOC" }, \ 34 { EXT4_MB_USE_ROOT_BLOCKS, "USE_ROOT_BLKS" }, \ 35 { EXT4_MB_USE_RESERVED, "USE_RESV" }) 36 37 #define show_map_flags(flags) __print_flags(flags, "|", \ 38 { EXT4_GET_BLOCKS_CREATE, "CREATE" }, \ 39 { EXT4_GET_BLOCKS_UNINIT_EXT, "UNINIT" }, \ 40 { EXT4_GET_BLOCKS_DELALLOC_RESERVE, "DELALLOC" }, \ 41 { EXT4_GET_BLOCKS_PRE_IO, "PRE_IO" }, \ 42 { EXT4_GET_BLOCKS_CONVERT, "CONVERT" }, \ 43 { EXT4_GET_BLOCKS_METADATA_NOFAIL, "METADATA_NOFAIL" }, \ 44 { EXT4_GET_BLOCKS_NO_NORMALIZE, "NO_NORMALIZE" }, \ 45 { EXT4_GET_BLOCKS_KEEP_SIZE, "KEEP_SIZE" }, \ 46 { EXT4_GET_BLOCKS_NO_LOCK, "NO_LOCK" }, \ 47 { EXT4_GET_BLOCKS_NO_PUT_HOLE, "NO_PUT_HOLE" }) 48 49 #define show_mflags(flags) __print_flags(flags, "", \ 50 { EXT4_MAP_NEW, "N" }, \ 51 { EXT4_MAP_MAPPED, "M" }, \ 52 { EXT4_MAP_UNWRITTEN, "U" }, \ 53 { EXT4_MAP_BOUNDARY, "B" }, \ 54 { EXT4_MAP_UNINIT, "u" }, \ 55 { EXT4_MAP_FROM_CLUSTER, "C" }) 56 57 #define show_free_flags(flags) __print_flags(flags, "|", \ 58 { EXT4_FREE_BLOCKS_METADATA, "METADATA" }, \ 59 { EXT4_FREE_BLOCKS_FORGET, "FORGET" }, \ 60 { EXT4_FREE_BLOCKS_VALIDATED, "VALIDATED" }, \ 61 { EXT4_FREE_BLOCKS_NO_QUOT_UPDATE, "NO_QUOTA" }, \ 62 { EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER,"1ST_CLUSTER" },\ 63 { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" }) 64 65 #define show_extent_status(status) __print_flags(status, "", \ 66 { EXTENT_STATUS_WRITTEN, "W" }, \ 67 { EXTENT_STATUS_UNWRITTEN, "U" }, \ 68 { EXTENT_STATUS_DELAYED, "D" }, \ 69 { EXTENT_STATUS_HOLE, "H" }) 70 71 #define show_falloc_mode(mode) __print_flags(mode, "|", \ 72 { FALLOC_FL_KEEP_SIZE, "KEEP_SIZE"}, \ 73 { FALLOC_FL_PUNCH_HOLE, "PUNCH_HOLE"}, \ 74 { FALLOC_FL_NO_HIDE_STALE, "NO_HIDE_STALE"}, \ 75 { FALLOC_FL_COLLAPSE_RANGE, "COLLAPSE_RANGE"}, \ 76 { FALLOC_FL_ZERO_RANGE, "ZERO_RANGE"}) 77 78 79 TRACE_EVENT(ext4_free_inode, 80 TP_PROTO(struct inode *inode), 81 82 TP_ARGS(inode), 83 84 TP_STRUCT__entry( 85 __field( dev_t, dev ) 86 __field( ino_t, ino ) 87 __field( uid_t, uid ) 88 __field( gid_t, gid ) 89 __field( __u64, blocks ) 90 __field( __u16, mode ) 91 ), 92 93 TP_fast_assign( 94 __entry->dev = inode->i_sb->s_dev; 95 __entry->ino = inode->i_ino; 96 __entry->uid = i_uid_read(inode); 97 __entry->gid = i_gid_read(inode); 98 __entry->blocks = inode->i_blocks; 99 __entry->mode = inode->i_mode; 100 ), 101 102 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu", 103 MAJOR(__entry->dev), MINOR(__entry->dev), 104 (unsigned long) __entry->ino, __entry->mode, 105 __entry->uid, __entry->gid, __entry->blocks) 106 ); 107 108 TRACE_EVENT(ext4_request_inode, 109 TP_PROTO(struct inode *dir, int mode), 110 111 TP_ARGS(dir, mode), 112 113 TP_STRUCT__entry( 114 __field( dev_t, dev ) 115 __field( ino_t, dir ) 116 __field( __u16, mode ) 117 ), 118 119 TP_fast_assign( 120 __entry->dev = dir->i_sb->s_dev; 121 __entry->dir = dir->i_ino; 122 __entry->mode = mode; 123 ), 124 125 TP_printk("dev %d,%d dir %lu mode 0%o", 126 MAJOR(__entry->dev), MINOR(__entry->dev), 127 (unsigned long) __entry->dir, __entry->mode) 128 ); 129 130 TRACE_EVENT(ext4_allocate_inode, 131 TP_PROTO(struct inode *inode, struct inode *dir, int mode), 132 133 TP_ARGS(inode, dir, mode), 134 135 TP_STRUCT__entry( 136 __field( dev_t, dev ) 137 __field( ino_t, ino ) 138 __field( ino_t, dir ) 139 __field( __u16, mode ) 140 ), 141 142 TP_fast_assign( 143 __entry->dev = inode->i_sb->s_dev; 144 __entry->ino = inode->i_ino; 145 __entry->dir = dir->i_ino; 146 __entry->mode = mode; 147 ), 148 149 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o", 150 MAJOR(__entry->dev), MINOR(__entry->dev), 151 (unsigned long) __entry->ino, 152 (unsigned long) __entry->dir, __entry->mode) 153 ); 154 155 TRACE_EVENT(ext4_evict_inode, 156 TP_PROTO(struct inode *inode), 157 158 TP_ARGS(inode), 159 160 TP_STRUCT__entry( 161 __field( dev_t, dev ) 162 __field( ino_t, ino ) 163 __field( int, nlink ) 164 ), 165 166 TP_fast_assign( 167 __entry->dev = inode->i_sb->s_dev; 168 __entry->ino = inode->i_ino; 169 __entry->nlink = inode->i_nlink; 170 ), 171 172 TP_printk("dev %d,%d ino %lu nlink %d", 173 MAJOR(__entry->dev), MINOR(__entry->dev), 174 (unsigned long) __entry->ino, __entry->nlink) 175 ); 176 177 TRACE_EVENT(ext4_drop_inode, 178 TP_PROTO(struct inode *inode, int drop), 179 180 TP_ARGS(inode, drop), 181 182 TP_STRUCT__entry( 183 __field( dev_t, dev ) 184 __field( ino_t, ino ) 185 __field( int, drop ) 186 ), 187 188 TP_fast_assign( 189 __entry->dev = inode->i_sb->s_dev; 190 __entry->ino = inode->i_ino; 191 __entry->drop = drop; 192 ), 193 194 TP_printk("dev %d,%d ino %lu drop %d", 195 MAJOR(__entry->dev), MINOR(__entry->dev), 196 (unsigned long) __entry->ino, __entry->drop) 197 ); 198 199 TRACE_EVENT(ext4_mark_inode_dirty, 200 TP_PROTO(struct inode *inode, unsigned long IP), 201 202 TP_ARGS(inode, IP), 203 204 TP_STRUCT__entry( 205 __field( dev_t, dev ) 206 __field( ino_t, ino ) 207 __field(unsigned long, ip ) 208 ), 209 210 TP_fast_assign( 211 __entry->dev = inode->i_sb->s_dev; 212 __entry->ino = inode->i_ino; 213 __entry->ip = IP; 214 ), 215 216 TP_printk("dev %d,%d ino %lu caller %pF", 217 MAJOR(__entry->dev), MINOR(__entry->dev), 218 (unsigned long) __entry->ino, (void *)__entry->ip) 219 ); 220 221 TRACE_EVENT(ext4_begin_ordered_truncate, 222 TP_PROTO(struct inode *inode, loff_t new_size), 223 224 TP_ARGS(inode, new_size), 225 226 TP_STRUCT__entry( 227 __field( dev_t, dev ) 228 __field( ino_t, ino ) 229 __field( loff_t, new_size ) 230 ), 231 232 TP_fast_assign( 233 __entry->dev = inode->i_sb->s_dev; 234 __entry->ino = inode->i_ino; 235 __entry->new_size = new_size; 236 ), 237 238 TP_printk("dev %d,%d ino %lu new_size %lld", 239 MAJOR(__entry->dev), MINOR(__entry->dev), 240 (unsigned long) __entry->ino, 241 __entry->new_size) 242 ); 243 244 DECLARE_EVENT_CLASS(ext4__write_begin, 245 246 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, 247 unsigned int flags), 248 249 TP_ARGS(inode, pos, len, flags), 250 251 TP_STRUCT__entry( 252 __field( dev_t, dev ) 253 __field( ino_t, ino ) 254 __field( loff_t, pos ) 255 __field( unsigned int, len ) 256 __field( unsigned int, flags ) 257 ), 258 259 TP_fast_assign( 260 __entry->dev = inode->i_sb->s_dev; 261 __entry->ino = inode->i_ino; 262 __entry->pos = pos; 263 __entry->len = len; 264 __entry->flags = flags; 265 ), 266 267 TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u", 268 MAJOR(__entry->dev), MINOR(__entry->dev), 269 (unsigned long) __entry->ino, 270 __entry->pos, __entry->len, __entry->flags) 271 ); 272 273 DEFINE_EVENT(ext4__write_begin, ext4_write_begin, 274 275 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, 276 unsigned int flags), 277 278 TP_ARGS(inode, pos, len, flags) 279 ); 280 281 DEFINE_EVENT(ext4__write_begin, ext4_da_write_begin, 282 283 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, 284 unsigned int flags), 285 286 TP_ARGS(inode, pos, len, flags) 287 ); 288 289 DECLARE_EVENT_CLASS(ext4__write_end, 290 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, 291 unsigned int copied), 292 293 TP_ARGS(inode, pos, len, copied), 294 295 TP_STRUCT__entry( 296 __field( dev_t, dev ) 297 __field( ino_t, ino ) 298 __field( loff_t, pos ) 299 __field( unsigned int, len ) 300 __field( unsigned int, copied ) 301 ), 302 303 TP_fast_assign( 304 __entry->dev = inode->i_sb->s_dev; 305 __entry->ino = inode->i_ino; 306 __entry->pos = pos; 307 __entry->len = len; 308 __entry->copied = copied; 309 ), 310 311 TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u", 312 MAJOR(__entry->dev), MINOR(__entry->dev), 313 (unsigned long) __entry->ino, 314 __entry->pos, __entry->len, __entry->copied) 315 ); 316 317 DEFINE_EVENT(ext4__write_end, ext4_write_end, 318 319 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, 320 unsigned int copied), 321 322 TP_ARGS(inode, pos, len, copied) 323 ); 324 325 DEFINE_EVENT(ext4__write_end, ext4_journalled_write_end, 326 327 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, 328 unsigned int copied), 329 330 TP_ARGS(inode, pos, len, copied) 331 ); 332 333 DEFINE_EVENT(ext4__write_end, ext4_da_write_end, 334 335 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, 336 unsigned int copied), 337 338 TP_ARGS(inode, pos, len, copied) 339 ); 340 341 TRACE_EVENT(ext4_writepages, 342 TP_PROTO(struct inode *inode, struct writeback_control *wbc), 343 344 TP_ARGS(inode, wbc), 345 346 TP_STRUCT__entry( 347 __field( dev_t, dev ) 348 __field( ino_t, ino ) 349 __field( long, nr_to_write ) 350 __field( long, pages_skipped ) 351 __field( loff_t, range_start ) 352 __field( loff_t, range_end ) 353 __field( pgoff_t, writeback_index ) 354 __field( int, sync_mode ) 355 __field( char, for_kupdate ) 356 __field( char, range_cyclic ) 357 ), 358 359 TP_fast_assign( 360 __entry->dev = inode->i_sb->s_dev; 361 __entry->ino = inode->i_ino; 362 __entry->nr_to_write = wbc->nr_to_write; 363 __entry->pages_skipped = wbc->pages_skipped; 364 __entry->range_start = wbc->range_start; 365 __entry->range_end = wbc->range_end; 366 __entry->writeback_index = inode->i_mapping->writeback_index; 367 __entry->sync_mode = wbc->sync_mode; 368 __entry->for_kupdate = wbc->for_kupdate; 369 __entry->range_cyclic = wbc->range_cyclic; 370 ), 371 372 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld " 373 "range_start %lld range_end %lld sync_mode %d " 374 "for_kupdate %d range_cyclic %d writeback_index %lu", 375 MAJOR(__entry->dev), MINOR(__entry->dev), 376 (unsigned long) __entry->ino, __entry->nr_to_write, 377 __entry->pages_skipped, __entry->range_start, 378 __entry->range_end, __entry->sync_mode, 379 __entry->for_kupdate, __entry->range_cyclic, 380 (unsigned long) __entry->writeback_index) 381 ); 382 383 TRACE_EVENT(ext4_da_write_pages, 384 TP_PROTO(struct inode *inode, pgoff_t first_page, 385 struct writeback_control *wbc), 386 387 TP_ARGS(inode, first_page, wbc), 388 389 TP_STRUCT__entry( 390 __field( dev_t, dev ) 391 __field( ino_t, ino ) 392 __field( pgoff_t, first_page ) 393 __field( long, nr_to_write ) 394 __field( int, sync_mode ) 395 ), 396 397 TP_fast_assign( 398 __entry->dev = inode->i_sb->s_dev; 399 __entry->ino = inode->i_ino; 400 __entry->first_page = first_page; 401 __entry->nr_to_write = wbc->nr_to_write; 402 __entry->sync_mode = wbc->sync_mode; 403 ), 404 405 TP_printk("dev %d,%d ino %lu first_page %lu nr_to_write %ld " 406 "sync_mode %d", 407 MAJOR(__entry->dev), MINOR(__entry->dev), 408 (unsigned long) __entry->ino, __entry->first_page, 409 __entry->nr_to_write, __entry->sync_mode) 410 ); 411 412 TRACE_EVENT(ext4_da_write_pages_extent, 413 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map), 414 415 TP_ARGS(inode, map), 416 417 TP_STRUCT__entry( 418 __field( dev_t, dev ) 419 __field( ino_t, ino ) 420 __field( __u64, lblk ) 421 __field( __u32, len ) 422 __field( __u32, flags ) 423 ), 424 425 TP_fast_assign( 426 __entry->dev = inode->i_sb->s_dev; 427 __entry->ino = inode->i_ino; 428 __entry->lblk = map->m_lblk; 429 __entry->len = map->m_len; 430 __entry->flags = map->m_flags; 431 ), 432 433 TP_printk("dev %d,%d ino %lu lblk %llu len %u flags %s", 434 MAJOR(__entry->dev), MINOR(__entry->dev), 435 (unsigned long) __entry->ino, __entry->lblk, __entry->len, 436 show_mflags(__entry->flags)) 437 ); 438 439 TRACE_EVENT(ext4_writepages_result, 440 TP_PROTO(struct inode *inode, struct writeback_control *wbc, 441 int ret, int pages_written), 442 443 TP_ARGS(inode, wbc, ret, pages_written), 444 445 TP_STRUCT__entry( 446 __field( dev_t, dev ) 447 __field( ino_t, ino ) 448 __field( int, ret ) 449 __field( int, pages_written ) 450 __field( long, pages_skipped ) 451 __field( pgoff_t, writeback_index ) 452 __field( int, sync_mode ) 453 ), 454 455 TP_fast_assign( 456 __entry->dev = inode->i_sb->s_dev; 457 __entry->ino = inode->i_ino; 458 __entry->ret = ret; 459 __entry->pages_written = pages_written; 460 __entry->pages_skipped = wbc->pages_skipped; 461 __entry->writeback_index = inode->i_mapping->writeback_index; 462 __entry->sync_mode = wbc->sync_mode; 463 ), 464 465 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld " 466 "sync_mode %d writeback_index %lu", 467 MAJOR(__entry->dev), MINOR(__entry->dev), 468 (unsigned long) __entry->ino, __entry->ret, 469 __entry->pages_written, __entry->pages_skipped, 470 __entry->sync_mode, 471 (unsigned long) __entry->writeback_index) 472 ); 473 474 DECLARE_EVENT_CLASS(ext4__page_op, 475 TP_PROTO(struct page *page), 476 477 TP_ARGS(page), 478 479 TP_STRUCT__entry( 480 __field( dev_t, dev ) 481 __field( ino_t, ino ) 482 __field( pgoff_t, index ) 483 484 ), 485 486 TP_fast_assign( 487 __entry->dev = page->mapping->host->i_sb->s_dev; 488 __entry->ino = page->mapping->host->i_ino; 489 __entry->index = page->index; 490 ), 491 492 TP_printk("dev %d,%d ino %lu page_index %lu", 493 MAJOR(__entry->dev), MINOR(__entry->dev), 494 (unsigned long) __entry->ino, 495 (unsigned long) __entry->index) 496 ); 497 498 DEFINE_EVENT(ext4__page_op, ext4_writepage, 499 500 TP_PROTO(struct page *page), 501 502 TP_ARGS(page) 503 ); 504 505 DEFINE_EVENT(ext4__page_op, ext4_readpage, 506 507 TP_PROTO(struct page *page), 508 509 TP_ARGS(page) 510 ); 511 512 DEFINE_EVENT(ext4__page_op, ext4_releasepage, 513 514 TP_PROTO(struct page *page), 515 516 TP_ARGS(page) 517 ); 518 519 DECLARE_EVENT_CLASS(ext4_invalidatepage_op, 520 TP_PROTO(struct page *page, unsigned int offset, unsigned int length), 521 522 TP_ARGS(page, offset, length), 523 524 TP_STRUCT__entry( 525 __field( dev_t, dev ) 526 __field( ino_t, ino ) 527 __field( pgoff_t, index ) 528 __field( unsigned int, offset ) 529 __field( unsigned int, length ) 530 ), 531 532 TP_fast_assign( 533 __entry->dev = page->mapping->host->i_sb->s_dev; 534 __entry->ino = page->mapping->host->i_ino; 535 __entry->index = page->index; 536 __entry->offset = offset; 537 __entry->length = length; 538 ), 539 540 TP_printk("dev %d,%d ino %lu page_index %lu offset %u length %u", 541 MAJOR(__entry->dev), MINOR(__entry->dev), 542 (unsigned long) __entry->ino, 543 (unsigned long) __entry->index, 544 __entry->offset, __entry->length) 545 ); 546 547 DEFINE_EVENT(ext4_invalidatepage_op, ext4_invalidatepage, 548 TP_PROTO(struct page *page, unsigned int offset, unsigned int length), 549 550 TP_ARGS(page, offset, length) 551 ); 552 553 DEFINE_EVENT(ext4_invalidatepage_op, ext4_journalled_invalidatepage, 554 TP_PROTO(struct page *page, unsigned int offset, unsigned int length), 555 556 TP_ARGS(page, offset, length) 557 ); 558 559 TRACE_EVENT(ext4_discard_blocks, 560 TP_PROTO(struct super_block *sb, unsigned long long blk, 561 unsigned long long count), 562 563 TP_ARGS(sb, blk, count), 564 565 TP_STRUCT__entry( 566 __field( dev_t, dev ) 567 __field( __u64, blk ) 568 __field( __u64, count ) 569 570 ), 571 572 TP_fast_assign( 573 __entry->dev = sb->s_dev; 574 __entry->blk = blk; 575 __entry->count = count; 576 ), 577 578 TP_printk("dev %d,%d blk %llu count %llu", 579 MAJOR(__entry->dev), MINOR(__entry->dev), 580 __entry->blk, __entry->count) 581 ); 582 583 DECLARE_EVENT_CLASS(ext4__mb_new_pa, 584 TP_PROTO(struct ext4_allocation_context *ac, 585 struct ext4_prealloc_space *pa), 586 587 TP_ARGS(ac, pa), 588 589 TP_STRUCT__entry( 590 __field( dev_t, dev ) 591 __field( ino_t, ino ) 592 __field( __u64, pa_pstart ) 593 __field( __u64, pa_lstart ) 594 __field( __u32, pa_len ) 595 596 ), 597 598 TP_fast_assign( 599 __entry->dev = ac->ac_sb->s_dev; 600 __entry->ino = ac->ac_inode->i_ino; 601 __entry->pa_pstart = pa->pa_pstart; 602 __entry->pa_lstart = pa->pa_lstart; 603 __entry->pa_len = pa->pa_len; 604 ), 605 606 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu", 607 MAJOR(__entry->dev), MINOR(__entry->dev), 608 (unsigned long) __entry->ino, 609 __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart) 610 ); 611 612 DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa, 613 614 TP_PROTO(struct ext4_allocation_context *ac, 615 struct ext4_prealloc_space *pa), 616 617 TP_ARGS(ac, pa) 618 ); 619 620 DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa, 621 622 TP_PROTO(struct ext4_allocation_context *ac, 623 struct ext4_prealloc_space *pa), 624 625 TP_ARGS(ac, pa) 626 ); 627 628 TRACE_EVENT(ext4_mb_release_inode_pa, 629 TP_PROTO(struct ext4_prealloc_space *pa, 630 unsigned long long block, unsigned int count), 631 632 TP_ARGS(pa, block, count), 633 634 TP_STRUCT__entry( 635 __field( dev_t, dev ) 636 __field( ino_t, ino ) 637 __field( __u64, block ) 638 __field( __u32, count ) 639 640 ), 641 642 TP_fast_assign( 643 __entry->dev = pa->pa_inode->i_sb->s_dev; 644 __entry->ino = pa->pa_inode->i_ino; 645 __entry->block = block; 646 __entry->count = count; 647 ), 648 649 TP_printk("dev %d,%d ino %lu block %llu count %u", 650 MAJOR(__entry->dev), MINOR(__entry->dev), 651 (unsigned long) __entry->ino, 652 __entry->block, __entry->count) 653 ); 654 655 TRACE_EVENT(ext4_mb_release_group_pa, 656 TP_PROTO(struct super_block *sb, struct ext4_prealloc_space *pa), 657 658 TP_ARGS(sb, pa), 659 660 TP_STRUCT__entry( 661 __field( dev_t, dev ) 662 __field( __u64, pa_pstart ) 663 __field( __u32, pa_len ) 664 665 ), 666 667 TP_fast_assign( 668 __entry->dev = sb->s_dev; 669 __entry->pa_pstart = pa->pa_pstart; 670 __entry->pa_len = pa->pa_len; 671 ), 672 673 TP_printk("dev %d,%d pstart %llu len %u", 674 MAJOR(__entry->dev), MINOR(__entry->dev), 675 __entry->pa_pstart, __entry->pa_len) 676 ); 677 678 TRACE_EVENT(ext4_discard_preallocations, 679 TP_PROTO(struct inode *inode), 680 681 TP_ARGS(inode), 682 683 TP_STRUCT__entry( 684 __field( dev_t, dev ) 685 __field( ino_t, ino ) 686 687 ), 688 689 TP_fast_assign( 690 __entry->dev = inode->i_sb->s_dev; 691 __entry->ino = inode->i_ino; 692 ), 693 694 TP_printk("dev %d,%d ino %lu", 695 MAJOR(__entry->dev), MINOR(__entry->dev), 696 (unsigned long) __entry->ino) 697 ); 698 699 TRACE_EVENT(ext4_mb_discard_preallocations, 700 TP_PROTO(struct super_block *sb, int needed), 701 702 TP_ARGS(sb, needed), 703 704 TP_STRUCT__entry( 705 __field( dev_t, dev ) 706 __field( int, needed ) 707 708 ), 709 710 TP_fast_assign( 711 __entry->dev = sb->s_dev; 712 __entry->needed = needed; 713 ), 714 715 TP_printk("dev %d,%d needed %d", 716 MAJOR(__entry->dev), MINOR(__entry->dev), 717 __entry->needed) 718 ); 719 720 TRACE_EVENT(ext4_request_blocks, 721 TP_PROTO(struct ext4_allocation_request *ar), 722 723 TP_ARGS(ar), 724 725 TP_STRUCT__entry( 726 __field( dev_t, dev ) 727 __field( ino_t, ino ) 728 __field( unsigned int, len ) 729 __field( __u32, logical ) 730 __field( __u32, lleft ) 731 __field( __u32, lright ) 732 __field( __u64, goal ) 733 __field( __u64, pleft ) 734 __field( __u64, pright ) 735 __field( unsigned int, flags ) 736 ), 737 738 TP_fast_assign( 739 __entry->dev = ar->inode->i_sb->s_dev; 740 __entry->ino = ar->inode->i_ino; 741 __entry->len = ar->len; 742 __entry->logical = ar->logical; 743 __entry->goal = ar->goal; 744 __entry->lleft = ar->lleft; 745 __entry->lright = ar->lright; 746 __entry->pleft = ar->pleft; 747 __entry->pright = ar->pright; 748 __entry->flags = ar->flags; 749 ), 750 751 TP_printk("dev %d,%d ino %lu flags %s len %u lblk %u goal %llu " 752 "lleft %u lright %u pleft %llu pright %llu ", 753 MAJOR(__entry->dev), MINOR(__entry->dev), 754 (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags), 755 __entry->len, __entry->logical, __entry->goal, 756 __entry->lleft, __entry->lright, __entry->pleft, 757 __entry->pright) 758 ); 759 760 TRACE_EVENT(ext4_allocate_blocks, 761 TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block), 762 763 TP_ARGS(ar, block), 764 765 TP_STRUCT__entry( 766 __field( dev_t, dev ) 767 __field( ino_t, ino ) 768 __field( __u64, block ) 769 __field( unsigned int, len ) 770 __field( __u32, logical ) 771 __field( __u32, lleft ) 772 __field( __u32, lright ) 773 __field( __u64, goal ) 774 __field( __u64, pleft ) 775 __field( __u64, pright ) 776 __field( unsigned int, flags ) 777 ), 778 779 TP_fast_assign( 780 __entry->dev = ar->inode->i_sb->s_dev; 781 __entry->ino = ar->inode->i_ino; 782 __entry->block = block; 783 __entry->len = ar->len; 784 __entry->logical = ar->logical; 785 __entry->goal = ar->goal; 786 __entry->lleft = ar->lleft; 787 __entry->lright = ar->lright; 788 __entry->pleft = ar->pleft; 789 __entry->pright = ar->pright; 790 __entry->flags = ar->flags; 791 ), 792 793 TP_printk("dev %d,%d ino %lu flags %s len %u block %llu lblk %u " 794 "goal %llu lleft %u lright %u pleft %llu pright %llu", 795 MAJOR(__entry->dev), MINOR(__entry->dev), 796 (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags), 797 __entry->len, __entry->block, __entry->logical, 798 __entry->goal, __entry->lleft, __entry->lright, 799 __entry->pleft, __entry->pright) 800 ); 801 802 TRACE_EVENT(ext4_free_blocks, 803 TP_PROTO(struct inode *inode, __u64 block, unsigned long count, 804 int flags), 805 806 TP_ARGS(inode, block, count, flags), 807 808 TP_STRUCT__entry( 809 __field( dev_t, dev ) 810 __field( ino_t, ino ) 811 __field( __u64, block ) 812 __field( unsigned long, count ) 813 __field( int, flags ) 814 __field( __u16, mode ) 815 ), 816 817 TP_fast_assign( 818 __entry->dev = inode->i_sb->s_dev; 819 __entry->ino = inode->i_ino; 820 __entry->block = block; 821 __entry->count = count; 822 __entry->flags = flags; 823 __entry->mode = inode->i_mode; 824 ), 825 826 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %s", 827 MAJOR(__entry->dev), MINOR(__entry->dev), 828 (unsigned long) __entry->ino, 829 __entry->mode, __entry->block, __entry->count, 830 show_free_flags(__entry->flags)) 831 ); 832 833 TRACE_EVENT(ext4_sync_file_enter, 834 TP_PROTO(struct file *file, int datasync), 835 836 TP_ARGS(file, datasync), 837 838 TP_STRUCT__entry( 839 __field( dev_t, dev ) 840 __field( ino_t, ino ) 841 __field( ino_t, parent ) 842 __field( int, datasync ) 843 ), 844 845 TP_fast_assign( 846 struct dentry *dentry = file->f_path.dentry; 847 848 __entry->dev = dentry->d_inode->i_sb->s_dev; 849 __entry->ino = dentry->d_inode->i_ino; 850 __entry->datasync = datasync; 851 __entry->parent = dentry->d_parent->d_inode->i_ino; 852 ), 853 854 TP_printk("dev %d,%d ino %lu parent %lu datasync %d ", 855 MAJOR(__entry->dev), MINOR(__entry->dev), 856 (unsigned long) __entry->ino, 857 (unsigned long) __entry->parent, __entry->datasync) 858 ); 859 860 TRACE_EVENT(ext4_sync_file_exit, 861 TP_PROTO(struct inode *inode, int ret), 862 863 TP_ARGS(inode, ret), 864 865 TP_STRUCT__entry( 866 __field( dev_t, dev ) 867 __field( ino_t, ino ) 868 __field( int, ret ) 869 ), 870 871 TP_fast_assign( 872 __entry->dev = inode->i_sb->s_dev; 873 __entry->ino = inode->i_ino; 874 __entry->ret = ret; 875 ), 876 877 TP_printk("dev %d,%d ino %lu ret %d", 878 MAJOR(__entry->dev), MINOR(__entry->dev), 879 (unsigned long) __entry->ino, 880 __entry->ret) 881 ); 882 883 TRACE_EVENT(ext4_sync_fs, 884 TP_PROTO(struct super_block *sb, int wait), 885 886 TP_ARGS(sb, wait), 887 888 TP_STRUCT__entry( 889 __field( dev_t, dev ) 890 __field( int, wait ) 891 892 ), 893 894 TP_fast_assign( 895 __entry->dev = sb->s_dev; 896 __entry->wait = wait; 897 ), 898 899 TP_printk("dev %d,%d wait %d", 900 MAJOR(__entry->dev), MINOR(__entry->dev), 901 __entry->wait) 902 ); 903 904 TRACE_EVENT(ext4_alloc_da_blocks, 905 TP_PROTO(struct inode *inode), 906 907 TP_ARGS(inode), 908 909 TP_STRUCT__entry( 910 __field( dev_t, dev ) 911 __field( ino_t, ino ) 912 __field( unsigned int, data_blocks ) 913 __field( unsigned int, meta_blocks ) 914 ), 915 916 TP_fast_assign( 917 __entry->dev = inode->i_sb->s_dev; 918 __entry->ino = inode->i_ino; 919 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks; 920 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; 921 ), 922 923 TP_printk("dev %d,%d ino %lu data_blocks %u meta_blocks %u", 924 MAJOR(__entry->dev), MINOR(__entry->dev), 925 (unsigned long) __entry->ino, 926 __entry->data_blocks, __entry->meta_blocks) 927 ); 928 929 TRACE_EVENT(ext4_mballoc_alloc, 930 TP_PROTO(struct ext4_allocation_context *ac), 931 932 TP_ARGS(ac), 933 934 TP_STRUCT__entry( 935 __field( dev_t, dev ) 936 __field( ino_t, ino ) 937 __field( __u32, orig_logical ) 938 __field( int, orig_start ) 939 __field( __u32, orig_group ) 940 __field( int, orig_len ) 941 __field( __u32, goal_logical ) 942 __field( int, goal_start ) 943 __field( __u32, goal_group ) 944 __field( int, goal_len ) 945 __field( __u32, result_logical ) 946 __field( int, result_start ) 947 __field( __u32, result_group ) 948 __field( int, result_len ) 949 __field( __u16, found ) 950 __field( __u16, groups ) 951 __field( __u16, buddy ) 952 __field( __u16, flags ) 953 __field( __u16, tail ) 954 __field( __u8, cr ) 955 ), 956 957 TP_fast_assign( 958 __entry->dev = ac->ac_inode->i_sb->s_dev; 959 __entry->ino = ac->ac_inode->i_ino; 960 __entry->orig_logical = ac->ac_o_ex.fe_logical; 961 __entry->orig_start = ac->ac_o_ex.fe_start; 962 __entry->orig_group = ac->ac_o_ex.fe_group; 963 __entry->orig_len = ac->ac_o_ex.fe_len; 964 __entry->goal_logical = ac->ac_g_ex.fe_logical; 965 __entry->goal_start = ac->ac_g_ex.fe_start; 966 __entry->goal_group = ac->ac_g_ex.fe_group; 967 __entry->goal_len = ac->ac_g_ex.fe_len; 968 __entry->result_logical = ac->ac_f_ex.fe_logical; 969 __entry->result_start = ac->ac_f_ex.fe_start; 970 __entry->result_group = ac->ac_f_ex.fe_group; 971 __entry->result_len = ac->ac_f_ex.fe_len; 972 __entry->found = ac->ac_found; 973 __entry->flags = ac->ac_flags; 974 __entry->groups = ac->ac_groups_scanned; 975 __entry->buddy = ac->ac_buddy; 976 __entry->tail = ac->ac_tail; 977 __entry->cr = ac->ac_criteria; 978 ), 979 980 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u " 981 "result %u/%d/%u@%u blks %u grps %u cr %u flags %s " 982 "tail %u broken %u", 983 MAJOR(__entry->dev), MINOR(__entry->dev), 984 (unsigned long) __entry->ino, 985 __entry->orig_group, __entry->orig_start, 986 __entry->orig_len, __entry->orig_logical, 987 __entry->goal_group, __entry->goal_start, 988 __entry->goal_len, __entry->goal_logical, 989 __entry->result_group, __entry->result_start, 990 __entry->result_len, __entry->result_logical, 991 __entry->found, __entry->groups, __entry->cr, 992 show_mballoc_flags(__entry->flags), __entry->tail, 993 __entry->buddy ? 1 << __entry->buddy : 0) 994 ); 995 996 TRACE_EVENT(ext4_mballoc_prealloc, 997 TP_PROTO(struct ext4_allocation_context *ac), 998 999 TP_ARGS(ac), 1000 1001 TP_STRUCT__entry( 1002 __field( dev_t, dev ) 1003 __field( ino_t, ino ) 1004 __field( __u32, orig_logical ) 1005 __field( int, orig_start ) 1006 __field( __u32, orig_group ) 1007 __field( int, orig_len ) 1008 __field( __u32, result_logical ) 1009 __field( int, result_start ) 1010 __field( __u32, result_group ) 1011 __field( int, result_len ) 1012 ), 1013 1014 TP_fast_assign( 1015 __entry->dev = ac->ac_inode->i_sb->s_dev; 1016 __entry->ino = ac->ac_inode->i_ino; 1017 __entry->orig_logical = ac->ac_o_ex.fe_logical; 1018 __entry->orig_start = ac->ac_o_ex.fe_start; 1019 __entry->orig_group = ac->ac_o_ex.fe_group; 1020 __entry->orig_len = ac->ac_o_ex.fe_len; 1021 __entry->result_logical = ac->ac_b_ex.fe_logical; 1022 __entry->result_start = ac->ac_b_ex.fe_start; 1023 __entry->result_group = ac->ac_b_ex.fe_group; 1024 __entry->result_len = ac->ac_b_ex.fe_len; 1025 ), 1026 1027 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u", 1028 MAJOR(__entry->dev), MINOR(__entry->dev), 1029 (unsigned long) __entry->ino, 1030 __entry->orig_group, __entry->orig_start, 1031 __entry->orig_len, __entry->orig_logical, 1032 __entry->result_group, __entry->result_start, 1033 __entry->result_len, __entry->result_logical) 1034 ); 1035 1036 DECLARE_EVENT_CLASS(ext4__mballoc, 1037 TP_PROTO(struct super_block *sb, 1038 struct inode *inode, 1039 ext4_group_t group, 1040 ext4_grpblk_t start, 1041 ext4_grpblk_t len), 1042 1043 TP_ARGS(sb, inode, group, start, len), 1044 1045 TP_STRUCT__entry( 1046 __field( dev_t, dev ) 1047 __field( ino_t, ino ) 1048 __field( int, result_start ) 1049 __field( __u32, result_group ) 1050 __field( int, result_len ) 1051 ), 1052 1053 TP_fast_assign( 1054 __entry->dev = sb->s_dev; 1055 __entry->ino = inode ? inode->i_ino : 0; 1056 __entry->result_start = start; 1057 __entry->result_group = group; 1058 __entry->result_len = len; 1059 ), 1060 1061 TP_printk("dev %d,%d inode %lu extent %u/%d/%d ", 1062 MAJOR(__entry->dev), MINOR(__entry->dev), 1063 (unsigned long) __entry->ino, 1064 __entry->result_group, __entry->result_start, 1065 __entry->result_len) 1066 ); 1067 1068 DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard, 1069 1070 TP_PROTO(struct super_block *sb, 1071 struct inode *inode, 1072 ext4_group_t group, 1073 ext4_grpblk_t start, 1074 ext4_grpblk_t len), 1075 1076 TP_ARGS(sb, inode, group, start, len) 1077 ); 1078 1079 DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free, 1080 1081 TP_PROTO(struct super_block *sb, 1082 struct inode *inode, 1083 ext4_group_t group, 1084 ext4_grpblk_t start, 1085 ext4_grpblk_t len), 1086 1087 TP_ARGS(sb, inode, group, start, len) 1088 ); 1089 1090 TRACE_EVENT(ext4_forget, 1091 TP_PROTO(struct inode *inode, int is_metadata, __u64 block), 1092 1093 TP_ARGS(inode, is_metadata, block), 1094 1095 TP_STRUCT__entry( 1096 __field( dev_t, dev ) 1097 __field( ino_t, ino ) 1098 __field( __u64, block ) 1099 __field( int, is_metadata ) 1100 __field( __u16, mode ) 1101 ), 1102 1103 TP_fast_assign( 1104 __entry->dev = inode->i_sb->s_dev; 1105 __entry->ino = inode->i_ino; 1106 __entry->block = block; 1107 __entry->is_metadata = is_metadata; 1108 __entry->mode = inode->i_mode; 1109 ), 1110 1111 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu", 1112 MAJOR(__entry->dev), MINOR(__entry->dev), 1113 (unsigned long) __entry->ino, 1114 __entry->mode, __entry->is_metadata, __entry->block) 1115 ); 1116 1117 TRACE_EVENT(ext4_da_update_reserve_space, 1118 TP_PROTO(struct inode *inode, int used_blocks, int quota_claim), 1119 1120 TP_ARGS(inode, used_blocks, quota_claim), 1121 1122 TP_STRUCT__entry( 1123 __field( dev_t, dev ) 1124 __field( ino_t, ino ) 1125 __field( __u64, i_blocks ) 1126 __field( int, used_blocks ) 1127 __field( int, reserved_data_blocks ) 1128 __field( int, reserved_meta_blocks ) 1129 __field( int, allocated_meta_blocks ) 1130 __field( int, quota_claim ) 1131 __field( __u16, mode ) 1132 ), 1133 1134 TP_fast_assign( 1135 __entry->dev = inode->i_sb->s_dev; 1136 __entry->ino = inode->i_ino; 1137 __entry->i_blocks = inode->i_blocks; 1138 __entry->used_blocks = used_blocks; 1139 __entry->reserved_data_blocks = 1140 EXT4_I(inode)->i_reserved_data_blocks; 1141 __entry->reserved_meta_blocks = 1142 EXT4_I(inode)->i_reserved_meta_blocks; 1143 __entry->allocated_meta_blocks = 1144 EXT4_I(inode)->i_allocated_meta_blocks; 1145 __entry->quota_claim = quota_claim; 1146 __entry->mode = inode->i_mode; 1147 ), 1148 1149 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d " 1150 "reserved_data_blocks %d reserved_meta_blocks %d " 1151 "allocated_meta_blocks %d quota_claim %d", 1152 MAJOR(__entry->dev), MINOR(__entry->dev), 1153 (unsigned long) __entry->ino, 1154 __entry->mode, __entry->i_blocks, 1155 __entry->used_blocks, __entry->reserved_data_blocks, 1156 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks, 1157 __entry->quota_claim) 1158 ); 1159 1160 TRACE_EVENT(ext4_da_reserve_space, 1161 TP_PROTO(struct inode *inode, int md_needed), 1162 1163 TP_ARGS(inode, md_needed), 1164 1165 TP_STRUCT__entry( 1166 __field( dev_t, dev ) 1167 __field( ino_t, ino ) 1168 __field( __u64, i_blocks ) 1169 __field( int, md_needed ) 1170 __field( int, reserved_data_blocks ) 1171 __field( int, reserved_meta_blocks ) 1172 __field( __u16, mode ) 1173 ), 1174 1175 TP_fast_assign( 1176 __entry->dev = inode->i_sb->s_dev; 1177 __entry->ino = inode->i_ino; 1178 __entry->i_blocks = inode->i_blocks; 1179 __entry->md_needed = md_needed; 1180 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks; 1181 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; 1182 __entry->mode = inode->i_mode; 1183 ), 1184 1185 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu md_needed %d " 1186 "reserved_data_blocks %d reserved_meta_blocks %d", 1187 MAJOR(__entry->dev), MINOR(__entry->dev), 1188 (unsigned long) __entry->ino, 1189 __entry->mode, __entry->i_blocks, 1190 __entry->md_needed, __entry->reserved_data_blocks, 1191 __entry->reserved_meta_blocks) 1192 ); 1193 1194 TRACE_EVENT(ext4_da_release_space, 1195 TP_PROTO(struct inode *inode, int freed_blocks), 1196 1197 TP_ARGS(inode, freed_blocks), 1198 1199 TP_STRUCT__entry( 1200 __field( dev_t, dev ) 1201 __field( ino_t, ino ) 1202 __field( __u64, i_blocks ) 1203 __field( int, freed_blocks ) 1204 __field( int, reserved_data_blocks ) 1205 __field( int, reserved_meta_blocks ) 1206 __field( int, allocated_meta_blocks ) 1207 __field( __u16, mode ) 1208 ), 1209 1210 TP_fast_assign( 1211 __entry->dev = inode->i_sb->s_dev; 1212 __entry->ino = inode->i_ino; 1213 __entry->i_blocks = inode->i_blocks; 1214 __entry->freed_blocks = freed_blocks; 1215 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks; 1216 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; 1217 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks; 1218 __entry->mode = inode->i_mode; 1219 ), 1220 1221 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d " 1222 "reserved_data_blocks %d reserved_meta_blocks %d " 1223 "allocated_meta_blocks %d", 1224 MAJOR(__entry->dev), MINOR(__entry->dev), 1225 (unsigned long) __entry->ino, 1226 __entry->mode, __entry->i_blocks, 1227 __entry->freed_blocks, __entry->reserved_data_blocks, 1228 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 1229 ); 1230 1231 DECLARE_EVENT_CLASS(ext4__bitmap_load, 1232 TP_PROTO(struct super_block *sb, unsigned long group), 1233 1234 TP_ARGS(sb, group), 1235 1236 TP_STRUCT__entry( 1237 __field( dev_t, dev ) 1238 __field( __u32, group ) 1239 1240 ), 1241 1242 TP_fast_assign( 1243 __entry->dev = sb->s_dev; 1244 __entry->group = group; 1245 ), 1246 1247 TP_printk("dev %d,%d group %u", 1248 MAJOR(__entry->dev), MINOR(__entry->dev), 1249 __entry->group) 1250 ); 1251 1252 DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load, 1253 1254 TP_PROTO(struct super_block *sb, unsigned long group), 1255 1256 TP_ARGS(sb, group) 1257 ); 1258 1259 DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load, 1260 1261 TP_PROTO(struct super_block *sb, unsigned long group), 1262 1263 TP_ARGS(sb, group) 1264 ); 1265 1266 DEFINE_EVENT(ext4__bitmap_load, ext4_read_block_bitmap_load, 1267 1268 TP_PROTO(struct super_block *sb, unsigned long group), 1269 1270 TP_ARGS(sb, group) 1271 ); 1272 1273 DEFINE_EVENT(ext4__bitmap_load, ext4_load_inode_bitmap, 1274 1275 TP_PROTO(struct super_block *sb, unsigned long group), 1276 1277 TP_ARGS(sb, group) 1278 ); 1279 1280 TRACE_EVENT(ext4_direct_IO_enter, 1281 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw), 1282 1283 TP_ARGS(inode, offset, len, rw), 1284 1285 TP_STRUCT__entry( 1286 __field( dev_t, dev ) 1287 __field( ino_t, ino ) 1288 __field( loff_t, pos ) 1289 __field( unsigned long, len ) 1290 __field( int, rw ) 1291 ), 1292 1293 TP_fast_assign( 1294 __entry->dev = inode->i_sb->s_dev; 1295 __entry->ino = inode->i_ino; 1296 __entry->pos = offset; 1297 __entry->len = len; 1298 __entry->rw = rw; 1299 ), 1300 1301 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d", 1302 MAJOR(__entry->dev), MINOR(__entry->dev), 1303 (unsigned long) __entry->ino, 1304 __entry->pos, __entry->len, __entry->rw) 1305 ); 1306 1307 TRACE_EVENT(ext4_direct_IO_exit, 1308 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, 1309 int rw, int ret), 1310 1311 TP_ARGS(inode, offset, len, rw, ret), 1312 1313 TP_STRUCT__entry( 1314 __field( dev_t, dev ) 1315 __field( ino_t, ino ) 1316 __field( loff_t, pos ) 1317 __field( unsigned long, len ) 1318 __field( int, rw ) 1319 __field( int, ret ) 1320 ), 1321 1322 TP_fast_assign( 1323 __entry->dev = inode->i_sb->s_dev; 1324 __entry->ino = inode->i_ino; 1325 __entry->pos = offset; 1326 __entry->len = len; 1327 __entry->rw = rw; 1328 __entry->ret = ret; 1329 ), 1330 1331 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d", 1332 MAJOR(__entry->dev), MINOR(__entry->dev), 1333 (unsigned long) __entry->ino, 1334 __entry->pos, __entry->len, 1335 __entry->rw, __entry->ret) 1336 ); 1337 1338 DECLARE_EVENT_CLASS(ext4__fallocate_mode, 1339 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), 1340 1341 TP_ARGS(inode, offset, len, mode), 1342 1343 TP_STRUCT__entry( 1344 __field( dev_t, dev ) 1345 __field( ino_t, ino ) 1346 __field( loff_t, offset ) 1347 __field( loff_t, len ) 1348 __field( int, mode ) 1349 ), 1350 1351 TP_fast_assign( 1352 __entry->dev = inode->i_sb->s_dev; 1353 __entry->ino = inode->i_ino; 1354 __entry->offset = offset; 1355 __entry->len = len; 1356 __entry->mode = mode; 1357 ), 1358 1359 TP_printk("dev %d,%d ino %lu offset %lld len %lld mode %s", 1360 MAJOR(__entry->dev), MINOR(__entry->dev), 1361 (unsigned long) __entry->ino, 1362 __entry->offset, __entry->len, 1363 show_falloc_mode(__entry->mode)) 1364 ); 1365 1366 DEFINE_EVENT(ext4__fallocate_mode, ext4_fallocate_enter, 1367 1368 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), 1369 1370 TP_ARGS(inode, offset, len, mode) 1371 ); 1372 1373 DEFINE_EVENT(ext4__fallocate_mode, ext4_punch_hole, 1374 1375 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), 1376 1377 TP_ARGS(inode, offset, len, mode) 1378 ); 1379 1380 DEFINE_EVENT(ext4__fallocate_mode, ext4_zero_range, 1381 1382 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), 1383 1384 TP_ARGS(inode, offset, len, mode) 1385 ); 1386 1387 TRACE_EVENT(ext4_fallocate_exit, 1388 TP_PROTO(struct inode *inode, loff_t offset, 1389 unsigned int max_blocks, int ret), 1390 1391 TP_ARGS(inode, offset, max_blocks, ret), 1392 1393 TP_STRUCT__entry( 1394 __field( dev_t, dev ) 1395 __field( ino_t, ino ) 1396 __field( loff_t, pos ) 1397 __field( unsigned int, blocks ) 1398 __field( int, ret ) 1399 ), 1400 1401 TP_fast_assign( 1402 __entry->dev = inode->i_sb->s_dev; 1403 __entry->ino = inode->i_ino; 1404 __entry->pos = offset; 1405 __entry->blocks = max_blocks; 1406 __entry->ret = ret; 1407 ), 1408 1409 TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d", 1410 MAJOR(__entry->dev), MINOR(__entry->dev), 1411 (unsigned long) __entry->ino, 1412 __entry->pos, __entry->blocks, 1413 __entry->ret) 1414 ); 1415 1416 TRACE_EVENT(ext4_unlink_enter, 1417 TP_PROTO(struct inode *parent, struct dentry *dentry), 1418 1419 TP_ARGS(parent, dentry), 1420 1421 TP_STRUCT__entry( 1422 __field( dev_t, dev ) 1423 __field( ino_t, ino ) 1424 __field( ino_t, parent ) 1425 __field( loff_t, size ) 1426 ), 1427 1428 TP_fast_assign( 1429 __entry->dev = dentry->d_inode->i_sb->s_dev; 1430 __entry->ino = dentry->d_inode->i_ino; 1431 __entry->parent = parent->i_ino; 1432 __entry->size = dentry->d_inode->i_size; 1433 ), 1434 1435 TP_printk("dev %d,%d ino %lu size %lld parent %lu", 1436 MAJOR(__entry->dev), MINOR(__entry->dev), 1437 (unsigned long) __entry->ino, __entry->size, 1438 (unsigned long) __entry->parent) 1439 ); 1440 1441 TRACE_EVENT(ext4_unlink_exit, 1442 TP_PROTO(struct dentry *dentry, int ret), 1443 1444 TP_ARGS(dentry, ret), 1445 1446 TP_STRUCT__entry( 1447 __field( dev_t, dev ) 1448 __field( ino_t, ino ) 1449 __field( int, ret ) 1450 ), 1451 1452 TP_fast_assign( 1453 __entry->dev = dentry->d_inode->i_sb->s_dev; 1454 __entry->ino = dentry->d_inode->i_ino; 1455 __entry->ret = ret; 1456 ), 1457 1458 TP_printk("dev %d,%d ino %lu ret %d", 1459 MAJOR(__entry->dev), MINOR(__entry->dev), 1460 (unsigned long) __entry->ino, 1461 __entry->ret) 1462 ); 1463 1464 DECLARE_EVENT_CLASS(ext4__truncate, 1465 TP_PROTO(struct inode *inode), 1466 1467 TP_ARGS(inode), 1468 1469 TP_STRUCT__entry( 1470 __field( dev_t, dev ) 1471 __field( ino_t, ino ) 1472 __field( __u64, blocks ) 1473 ), 1474 1475 TP_fast_assign( 1476 __entry->dev = inode->i_sb->s_dev; 1477 __entry->ino = inode->i_ino; 1478 __entry->blocks = inode->i_blocks; 1479 ), 1480 1481 TP_printk("dev %d,%d ino %lu blocks %llu", 1482 MAJOR(__entry->dev), MINOR(__entry->dev), 1483 (unsigned long) __entry->ino, __entry->blocks) 1484 ); 1485 1486 DEFINE_EVENT(ext4__truncate, ext4_truncate_enter, 1487 1488 TP_PROTO(struct inode *inode), 1489 1490 TP_ARGS(inode) 1491 ); 1492 1493 DEFINE_EVENT(ext4__truncate, ext4_truncate_exit, 1494 1495 TP_PROTO(struct inode *inode), 1496 1497 TP_ARGS(inode) 1498 ); 1499 1500 /* 'ux' is the uninitialized extent. */ 1501 TRACE_EVENT(ext4_ext_convert_to_initialized_enter, 1502 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, 1503 struct ext4_extent *ux), 1504 1505 TP_ARGS(inode, map, ux), 1506 1507 TP_STRUCT__entry( 1508 __field( dev_t, dev ) 1509 __field( ino_t, ino ) 1510 __field( ext4_lblk_t, m_lblk ) 1511 __field( unsigned, m_len ) 1512 __field( ext4_lblk_t, u_lblk ) 1513 __field( unsigned, u_len ) 1514 __field( ext4_fsblk_t, u_pblk ) 1515 ), 1516 1517 TP_fast_assign( 1518 __entry->dev = inode->i_sb->s_dev; 1519 __entry->ino = inode->i_ino; 1520 __entry->m_lblk = map->m_lblk; 1521 __entry->m_len = map->m_len; 1522 __entry->u_lblk = le32_to_cpu(ux->ee_block); 1523 __entry->u_len = ext4_ext_get_actual_len(ux); 1524 __entry->u_pblk = ext4_ext_pblock(ux); 1525 ), 1526 1527 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u u_lblk %u u_len %u " 1528 "u_pblk %llu", 1529 MAJOR(__entry->dev), MINOR(__entry->dev), 1530 (unsigned long) __entry->ino, 1531 __entry->m_lblk, __entry->m_len, 1532 __entry->u_lblk, __entry->u_len, __entry->u_pblk) 1533 ); 1534 1535 /* 1536 * 'ux' is the uninitialized extent. 1537 * 'ix' is the initialized extent to which blocks are transferred. 1538 */ 1539 TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath, 1540 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, 1541 struct ext4_extent *ux, struct ext4_extent *ix), 1542 1543 TP_ARGS(inode, map, ux, ix), 1544 1545 TP_STRUCT__entry( 1546 __field( dev_t, dev ) 1547 __field( ino_t, ino ) 1548 __field( ext4_lblk_t, m_lblk ) 1549 __field( unsigned, m_len ) 1550 __field( ext4_lblk_t, u_lblk ) 1551 __field( unsigned, u_len ) 1552 __field( ext4_fsblk_t, u_pblk ) 1553 __field( ext4_lblk_t, i_lblk ) 1554 __field( unsigned, i_len ) 1555 __field( ext4_fsblk_t, i_pblk ) 1556 ), 1557 1558 TP_fast_assign( 1559 __entry->dev = inode->i_sb->s_dev; 1560 __entry->ino = inode->i_ino; 1561 __entry->m_lblk = map->m_lblk; 1562 __entry->m_len = map->m_len; 1563 __entry->u_lblk = le32_to_cpu(ux->ee_block); 1564 __entry->u_len = ext4_ext_get_actual_len(ux); 1565 __entry->u_pblk = ext4_ext_pblock(ux); 1566 __entry->i_lblk = le32_to_cpu(ix->ee_block); 1567 __entry->i_len = ext4_ext_get_actual_len(ix); 1568 __entry->i_pblk = ext4_ext_pblock(ix); 1569 ), 1570 1571 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u " 1572 "u_lblk %u u_len %u u_pblk %llu " 1573 "i_lblk %u i_len %u i_pblk %llu ", 1574 MAJOR(__entry->dev), MINOR(__entry->dev), 1575 (unsigned long) __entry->ino, 1576 __entry->m_lblk, __entry->m_len, 1577 __entry->u_lblk, __entry->u_len, __entry->u_pblk, 1578 __entry->i_lblk, __entry->i_len, __entry->i_pblk) 1579 ); 1580 1581 DECLARE_EVENT_CLASS(ext4__map_blocks_enter, 1582 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, 1583 unsigned int len, unsigned int flags), 1584 1585 TP_ARGS(inode, lblk, len, flags), 1586 1587 TP_STRUCT__entry( 1588 __field( dev_t, dev ) 1589 __field( ino_t, ino ) 1590 __field( ext4_lblk_t, lblk ) 1591 __field( unsigned int, len ) 1592 __field( unsigned int, flags ) 1593 ), 1594 1595 TP_fast_assign( 1596 __entry->dev = inode->i_sb->s_dev; 1597 __entry->ino = inode->i_ino; 1598 __entry->lblk = lblk; 1599 __entry->len = len; 1600 __entry->flags = flags; 1601 ), 1602 1603 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %s", 1604 MAJOR(__entry->dev), MINOR(__entry->dev), 1605 (unsigned long) __entry->ino, 1606 __entry->lblk, __entry->len, show_map_flags(__entry->flags)) 1607 ); 1608 1609 DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter, 1610 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, 1611 unsigned len, unsigned flags), 1612 1613 TP_ARGS(inode, lblk, len, flags) 1614 ); 1615 1616 DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter, 1617 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, 1618 unsigned len, unsigned flags), 1619 1620 TP_ARGS(inode, lblk, len, flags) 1621 ); 1622 1623 DECLARE_EVENT_CLASS(ext4__map_blocks_exit, 1624 TP_PROTO(struct inode *inode, unsigned flags, struct ext4_map_blocks *map, 1625 int ret), 1626 1627 TP_ARGS(inode, flags, map, ret), 1628 1629 TP_STRUCT__entry( 1630 __field( dev_t, dev ) 1631 __field( ino_t, ino ) 1632 __field( unsigned int, flags ) 1633 __field( ext4_fsblk_t, pblk ) 1634 __field( ext4_lblk_t, lblk ) 1635 __field( unsigned int, len ) 1636 __field( unsigned int, mflags ) 1637 __field( int, ret ) 1638 ), 1639 1640 TP_fast_assign( 1641 __entry->dev = inode->i_sb->s_dev; 1642 __entry->ino = inode->i_ino; 1643 __entry->flags = flags; 1644 __entry->pblk = map->m_pblk; 1645 __entry->lblk = map->m_lblk; 1646 __entry->len = map->m_len; 1647 __entry->mflags = map->m_flags; 1648 __entry->ret = ret; 1649 ), 1650 1651 TP_printk("dev %d,%d ino %lu flags %s lblk %u pblk %llu len %u " 1652 "mflags %s ret %d", 1653 MAJOR(__entry->dev), MINOR(__entry->dev), 1654 (unsigned long) __entry->ino, 1655 show_map_flags(__entry->flags), __entry->lblk, __entry->pblk, 1656 __entry->len, show_mflags(__entry->mflags), __entry->ret) 1657 ); 1658 1659 DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit, 1660 TP_PROTO(struct inode *inode, unsigned flags, 1661 struct ext4_map_blocks *map, int ret), 1662 1663 TP_ARGS(inode, flags, map, ret) 1664 ); 1665 1666 DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit, 1667 TP_PROTO(struct inode *inode, unsigned flags, 1668 struct ext4_map_blocks *map, int ret), 1669 1670 TP_ARGS(inode, flags, map, ret) 1671 ); 1672 1673 TRACE_EVENT(ext4_ext_load_extent, 1674 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk), 1675 1676 TP_ARGS(inode, lblk, pblk), 1677 1678 TP_STRUCT__entry( 1679 __field( dev_t, dev ) 1680 __field( ino_t, ino ) 1681 __field( ext4_fsblk_t, pblk ) 1682 __field( ext4_lblk_t, lblk ) 1683 ), 1684 1685 TP_fast_assign( 1686 __entry->dev = inode->i_sb->s_dev; 1687 __entry->ino = inode->i_ino; 1688 __entry->pblk = pblk; 1689 __entry->lblk = lblk; 1690 ), 1691 1692 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu", 1693 MAJOR(__entry->dev), MINOR(__entry->dev), 1694 (unsigned long) __entry->ino, 1695 __entry->lblk, __entry->pblk) 1696 ); 1697 1698 TRACE_EVENT(ext4_load_inode, 1699 TP_PROTO(struct inode *inode), 1700 1701 TP_ARGS(inode), 1702 1703 TP_STRUCT__entry( 1704 __field( dev_t, dev ) 1705 __field( ino_t, ino ) 1706 ), 1707 1708 TP_fast_assign( 1709 __entry->dev = inode->i_sb->s_dev; 1710 __entry->ino = inode->i_ino; 1711 ), 1712 1713 TP_printk("dev %d,%d ino %ld", 1714 MAJOR(__entry->dev), MINOR(__entry->dev), 1715 (unsigned long) __entry->ino) 1716 ); 1717 1718 TRACE_EVENT(ext4_journal_start, 1719 TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks, 1720 unsigned long IP), 1721 1722 TP_ARGS(sb, blocks, rsv_blocks, IP), 1723 1724 TP_STRUCT__entry( 1725 __field( dev_t, dev ) 1726 __field(unsigned long, ip ) 1727 __field( int, blocks ) 1728 __field( int, rsv_blocks ) 1729 ), 1730 1731 TP_fast_assign( 1732 __entry->dev = sb->s_dev; 1733 __entry->ip = IP; 1734 __entry->blocks = blocks; 1735 __entry->rsv_blocks = rsv_blocks; 1736 ), 1737 1738 TP_printk("dev %d,%d blocks, %d rsv_blocks, %d caller %pF", 1739 MAJOR(__entry->dev), MINOR(__entry->dev), 1740 __entry->blocks, __entry->rsv_blocks, (void *)__entry->ip) 1741 ); 1742 1743 TRACE_EVENT(ext4_journal_start_reserved, 1744 TP_PROTO(struct super_block *sb, int blocks, unsigned long IP), 1745 1746 TP_ARGS(sb, blocks, IP), 1747 1748 TP_STRUCT__entry( 1749 __field( dev_t, dev ) 1750 __field(unsigned long, ip ) 1751 __field( int, blocks ) 1752 ), 1753 1754 TP_fast_assign( 1755 __entry->dev = sb->s_dev; 1756 __entry->ip = IP; 1757 __entry->blocks = blocks; 1758 ), 1759 1760 TP_printk("dev %d,%d blocks, %d caller %pF", 1761 MAJOR(__entry->dev), MINOR(__entry->dev), 1762 __entry->blocks, (void *)__entry->ip) 1763 ); 1764 1765 DECLARE_EVENT_CLASS(ext4__trim, 1766 TP_PROTO(struct super_block *sb, 1767 ext4_group_t group, 1768 ext4_grpblk_t start, 1769 ext4_grpblk_t len), 1770 1771 TP_ARGS(sb, group, start, len), 1772 1773 TP_STRUCT__entry( 1774 __field( int, dev_major ) 1775 __field( int, dev_minor ) 1776 __field( __u32, group ) 1777 __field( int, start ) 1778 __field( int, len ) 1779 ), 1780 1781 TP_fast_assign( 1782 __entry->dev_major = MAJOR(sb->s_dev); 1783 __entry->dev_minor = MINOR(sb->s_dev); 1784 __entry->group = group; 1785 __entry->start = start; 1786 __entry->len = len; 1787 ), 1788 1789 TP_printk("dev %d,%d group %u, start %d, len %d", 1790 __entry->dev_major, __entry->dev_minor, 1791 __entry->group, __entry->start, __entry->len) 1792 ); 1793 1794 DEFINE_EVENT(ext4__trim, ext4_trim_extent, 1795 1796 TP_PROTO(struct super_block *sb, 1797 ext4_group_t group, 1798 ext4_grpblk_t start, 1799 ext4_grpblk_t len), 1800 1801 TP_ARGS(sb, group, start, len) 1802 ); 1803 1804 DEFINE_EVENT(ext4__trim, ext4_trim_all_free, 1805 1806 TP_PROTO(struct super_block *sb, 1807 ext4_group_t group, 1808 ext4_grpblk_t start, 1809 ext4_grpblk_t len), 1810 1811 TP_ARGS(sb, group, start, len) 1812 ); 1813 1814 TRACE_EVENT(ext4_ext_handle_uninitialized_extents, 1815 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int flags, 1816 unsigned int allocated, ext4_fsblk_t newblock), 1817 1818 TP_ARGS(inode, map, flags, allocated, newblock), 1819 1820 TP_STRUCT__entry( 1821 __field( dev_t, dev ) 1822 __field( ino_t, ino ) 1823 __field( int, flags ) 1824 __field( ext4_lblk_t, lblk ) 1825 __field( ext4_fsblk_t, pblk ) 1826 __field( unsigned int, len ) 1827 __field( unsigned int, allocated ) 1828 __field( ext4_fsblk_t, newblk ) 1829 ), 1830 1831 TP_fast_assign( 1832 __entry->dev = inode->i_sb->s_dev; 1833 __entry->ino = inode->i_ino; 1834 __entry->flags = flags; 1835 __entry->lblk = map->m_lblk; 1836 __entry->pblk = map->m_pblk; 1837 __entry->len = map->m_len; 1838 __entry->allocated = allocated; 1839 __entry->newblk = newblock; 1840 ), 1841 1842 TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %s " 1843 "allocated %d newblock %llu", 1844 MAJOR(__entry->dev), MINOR(__entry->dev), 1845 (unsigned long) __entry->ino, 1846 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk, 1847 __entry->len, show_map_flags(__entry->flags), 1848 (unsigned int) __entry->allocated, 1849 (unsigned long long) __entry->newblk) 1850 ); 1851 1852 TRACE_EVENT(ext4_get_implied_cluster_alloc_exit, 1853 TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret), 1854 1855 TP_ARGS(sb, map, ret), 1856 1857 TP_STRUCT__entry( 1858 __field( dev_t, dev ) 1859 __field( unsigned int, flags ) 1860 __field( ext4_lblk_t, lblk ) 1861 __field( ext4_fsblk_t, pblk ) 1862 __field( unsigned int, len ) 1863 __field( int, ret ) 1864 ), 1865 1866 TP_fast_assign( 1867 __entry->dev = sb->s_dev; 1868 __entry->flags = map->m_flags; 1869 __entry->lblk = map->m_lblk; 1870 __entry->pblk = map->m_pblk; 1871 __entry->len = map->m_len; 1872 __entry->ret = ret; 1873 ), 1874 1875 TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %s ret %d", 1876 MAJOR(__entry->dev), MINOR(__entry->dev), 1877 __entry->lblk, (unsigned long long) __entry->pblk, 1878 __entry->len, show_mflags(__entry->flags), __entry->ret) 1879 ); 1880 1881 TRACE_EVENT(ext4_ext_put_in_cache, 1882 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len, 1883 ext4_fsblk_t start), 1884 1885 TP_ARGS(inode, lblk, len, start), 1886 1887 TP_STRUCT__entry( 1888 __field( dev_t, dev ) 1889 __field( ino_t, ino ) 1890 __field( ext4_lblk_t, lblk ) 1891 __field( unsigned int, len ) 1892 __field( ext4_fsblk_t, start ) 1893 ), 1894 1895 TP_fast_assign( 1896 __entry->dev = inode->i_sb->s_dev; 1897 __entry->ino = inode->i_ino; 1898 __entry->lblk = lblk; 1899 __entry->len = len; 1900 __entry->start = start; 1901 ), 1902 1903 TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu", 1904 MAJOR(__entry->dev), MINOR(__entry->dev), 1905 (unsigned long) __entry->ino, 1906 (unsigned) __entry->lblk, 1907 __entry->len, 1908 (unsigned long long) __entry->start) 1909 ); 1910 1911 TRACE_EVENT(ext4_ext_in_cache, 1912 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret), 1913 1914 TP_ARGS(inode, lblk, ret), 1915 1916 TP_STRUCT__entry( 1917 __field( dev_t, dev ) 1918 __field( ino_t, ino ) 1919 __field( ext4_lblk_t, lblk ) 1920 __field( int, ret ) 1921 ), 1922 1923 TP_fast_assign( 1924 __entry->dev = inode->i_sb->s_dev; 1925 __entry->ino = inode->i_ino; 1926 __entry->lblk = lblk; 1927 __entry->ret = ret; 1928 ), 1929 1930 TP_printk("dev %d,%d ino %lu lblk %u ret %d", 1931 MAJOR(__entry->dev), MINOR(__entry->dev), 1932 (unsigned long) __entry->ino, 1933 (unsigned) __entry->lblk, 1934 __entry->ret) 1935 1936 ); 1937 1938 TRACE_EVENT(ext4_find_delalloc_range, 1939 TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to, 1940 int reverse, int found, ext4_lblk_t found_blk), 1941 1942 TP_ARGS(inode, from, to, reverse, found, found_blk), 1943 1944 TP_STRUCT__entry( 1945 __field( dev_t, dev ) 1946 __field( ino_t, ino ) 1947 __field( ext4_lblk_t, from ) 1948 __field( ext4_lblk_t, to ) 1949 __field( int, reverse ) 1950 __field( int, found ) 1951 __field( ext4_lblk_t, found_blk ) 1952 ), 1953 1954 TP_fast_assign( 1955 __entry->dev = inode->i_sb->s_dev; 1956 __entry->ino = inode->i_ino; 1957 __entry->from = from; 1958 __entry->to = to; 1959 __entry->reverse = reverse; 1960 __entry->found = found; 1961 __entry->found_blk = found_blk; 1962 ), 1963 1964 TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d " 1965 "(blk = %u)", 1966 MAJOR(__entry->dev), MINOR(__entry->dev), 1967 (unsigned long) __entry->ino, 1968 (unsigned) __entry->from, (unsigned) __entry->to, 1969 __entry->reverse, __entry->found, 1970 (unsigned) __entry->found_blk) 1971 ); 1972 1973 TRACE_EVENT(ext4_get_reserved_cluster_alloc, 1974 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len), 1975 1976 TP_ARGS(inode, lblk, len), 1977 1978 TP_STRUCT__entry( 1979 __field( dev_t, dev ) 1980 __field( ino_t, ino ) 1981 __field( ext4_lblk_t, lblk ) 1982 __field( unsigned int, len ) 1983 ), 1984 1985 TP_fast_assign( 1986 __entry->dev = inode->i_sb->s_dev; 1987 __entry->ino = inode->i_ino; 1988 __entry->lblk = lblk; 1989 __entry->len = len; 1990 ), 1991 1992 TP_printk("dev %d,%d ino %lu lblk %u len %u", 1993 MAJOR(__entry->dev), MINOR(__entry->dev), 1994 (unsigned long) __entry->ino, 1995 (unsigned) __entry->lblk, 1996 __entry->len) 1997 ); 1998 1999 TRACE_EVENT(ext4_ext_show_extent, 2000 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk, 2001 unsigned short len), 2002 2003 TP_ARGS(inode, lblk, pblk, len), 2004 2005 TP_STRUCT__entry( 2006 __field( dev_t, dev ) 2007 __field( ino_t, ino ) 2008 __field( ext4_fsblk_t, pblk ) 2009 __field( ext4_lblk_t, lblk ) 2010 __field( unsigned short, len ) 2011 ), 2012 2013 TP_fast_assign( 2014 __entry->dev = inode->i_sb->s_dev; 2015 __entry->ino = inode->i_ino; 2016 __entry->pblk = pblk; 2017 __entry->lblk = lblk; 2018 __entry->len = len; 2019 ), 2020 2021 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u", 2022 MAJOR(__entry->dev), MINOR(__entry->dev), 2023 (unsigned long) __entry->ino, 2024 (unsigned) __entry->lblk, 2025 (unsigned long long) __entry->pblk, 2026 (unsigned short) __entry->len) 2027 ); 2028 2029 TRACE_EVENT(ext4_remove_blocks, 2030 TP_PROTO(struct inode *inode, struct ext4_extent *ex, 2031 ext4_lblk_t from, ext4_fsblk_t to, 2032 long long partial_cluster), 2033 2034 TP_ARGS(inode, ex, from, to, partial_cluster), 2035 2036 TP_STRUCT__entry( 2037 __field( dev_t, dev ) 2038 __field( ino_t, ino ) 2039 __field( ext4_lblk_t, from ) 2040 __field( ext4_lblk_t, to ) 2041 __field( long long, partial ) 2042 __field( ext4_fsblk_t, ee_pblk ) 2043 __field( ext4_lblk_t, ee_lblk ) 2044 __field( unsigned short, ee_len ) 2045 ), 2046 2047 TP_fast_assign( 2048 __entry->dev = inode->i_sb->s_dev; 2049 __entry->ino = inode->i_ino; 2050 __entry->from = from; 2051 __entry->to = to; 2052 __entry->partial = partial_cluster; 2053 __entry->ee_pblk = ext4_ext_pblock(ex); 2054 __entry->ee_lblk = le32_to_cpu(ex->ee_block); 2055 __entry->ee_len = ext4_ext_get_actual_len(ex); 2056 ), 2057 2058 TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]" 2059 "from %u to %u partial_cluster %lld", 2060 MAJOR(__entry->dev), MINOR(__entry->dev), 2061 (unsigned long) __entry->ino, 2062 (unsigned) __entry->ee_lblk, 2063 (unsigned long long) __entry->ee_pblk, 2064 (unsigned short) __entry->ee_len, 2065 (unsigned) __entry->from, 2066 (unsigned) __entry->to, 2067 (long long) __entry->partial) 2068 ); 2069 2070 TRACE_EVENT(ext4_ext_rm_leaf, 2071 TP_PROTO(struct inode *inode, ext4_lblk_t start, 2072 struct ext4_extent *ex, 2073 long long partial_cluster), 2074 2075 TP_ARGS(inode, start, ex, partial_cluster), 2076 2077 TP_STRUCT__entry( 2078 __field( dev_t, dev ) 2079 __field( ino_t, ino ) 2080 __field( long long, partial ) 2081 __field( ext4_lblk_t, start ) 2082 __field( ext4_lblk_t, ee_lblk ) 2083 __field( ext4_fsblk_t, ee_pblk ) 2084 __field( short, ee_len ) 2085 ), 2086 2087 TP_fast_assign( 2088 __entry->dev = inode->i_sb->s_dev; 2089 __entry->ino = inode->i_ino; 2090 __entry->partial = partial_cluster; 2091 __entry->start = start; 2092 __entry->ee_lblk = le32_to_cpu(ex->ee_block); 2093 __entry->ee_pblk = ext4_ext_pblock(ex); 2094 __entry->ee_len = ext4_ext_get_actual_len(ex); 2095 ), 2096 2097 TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]" 2098 "partial_cluster %lld", 2099 MAJOR(__entry->dev), MINOR(__entry->dev), 2100 (unsigned long) __entry->ino, 2101 (unsigned) __entry->start, 2102 (unsigned) __entry->ee_lblk, 2103 (unsigned long long) __entry->ee_pblk, 2104 (unsigned short) __entry->ee_len, 2105 (long long) __entry->partial) 2106 ); 2107 2108 TRACE_EVENT(ext4_ext_rm_idx, 2109 TP_PROTO(struct inode *inode, ext4_fsblk_t pblk), 2110 2111 TP_ARGS(inode, pblk), 2112 2113 TP_STRUCT__entry( 2114 __field( dev_t, dev ) 2115 __field( ino_t, ino ) 2116 __field( ext4_fsblk_t, pblk ) 2117 ), 2118 2119 TP_fast_assign( 2120 __entry->dev = inode->i_sb->s_dev; 2121 __entry->ino = inode->i_ino; 2122 __entry->pblk = pblk; 2123 ), 2124 2125 TP_printk("dev %d,%d ino %lu index_pblk %llu", 2126 MAJOR(__entry->dev), MINOR(__entry->dev), 2127 (unsigned long) __entry->ino, 2128 (unsigned long long) __entry->pblk) 2129 ); 2130 2131 TRACE_EVENT(ext4_ext_remove_space, 2132 TP_PROTO(struct inode *inode, ext4_lblk_t start, 2133 ext4_lblk_t end, int depth), 2134 2135 TP_ARGS(inode, start, end, depth), 2136 2137 TP_STRUCT__entry( 2138 __field( dev_t, dev ) 2139 __field( ino_t, ino ) 2140 __field( ext4_lblk_t, start ) 2141 __field( ext4_lblk_t, end ) 2142 __field( int, depth ) 2143 ), 2144 2145 TP_fast_assign( 2146 __entry->dev = inode->i_sb->s_dev; 2147 __entry->ino = inode->i_ino; 2148 __entry->start = start; 2149 __entry->end = end; 2150 __entry->depth = depth; 2151 ), 2152 2153 TP_printk("dev %d,%d ino %lu since %u end %u depth %d", 2154 MAJOR(__entry->dev), MINOR(__entry->dev), 2155 (unsigned long) __entry->ino, 2156 (unsigned) __entry->start, 2157 (unsigned) __entry->end, 2158 __entry->depth) 2159 ); 2160 2161 TRACE_EVENT(ext4_ext_remove_space_done, 2162 TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end, 2163 int depth, long long partial, __le16 eh_entries), 2164 2165 TP_ARGS(inode, start, end, depth, partial, eh_entries), 2166 2167 TP_STRUCT__entry( 2168 __field( dev_t, dev ) 2169 __field( ino_t, ino ) 2170 __field( ext4_lblk_t, start ) 2171 __field( ext4_lblk_t, end ) 2172 __field( int, depth ) 2173 __field( long long, partial ) 2174 __field( unsigned short, eh_entries ) 2175 ), 2176 2177 TP_fast_assign( 2178 __entry->dev = inode->i_sb->s_dev; 2179 __entry->ino = inode->i_ino; 2180 __entry->start = start; 2181 __entry->end = end; 2182 __entry->depth = depth; 2183 __entry->partial = partial; 2184 __entry->eh_entries = le16_to_cpu(eh_entries); 2185 ), 2186 2187 TP_printk("dev %d,%d ino %lu since %u end %u depth %d partial %lld " 2188 "remaining_entries %u", 2189 MAJOR(__entry->dev), MINOR(__entry->dev), 2190 (unsigned long) __entry->ino, 2191 (unsigned) __entry->start, 2192 (unsigned) __entry->end, 2193 __entry->depth, 2194 (long long) __entry->partial, 2195 (unsigned short) __entry->eh_entries) 2196 ); 2197 2198 DECLARE_EVENT_CLASS(ext4__es_extent, 2199 TP_PROTO(struct inode *inode, struct extent_status *es), 2200 2201 TP_ARGS(inode, es), 2202 2203 TP_STRUCT__entry( 2204 __field( dev_t, dev ) 2205 __field( ino_t, ino ) 2206 __field( ext4_lblk_t, lblk ) 2207 __field( ext4_lblk_t, len ) 2208 __field( ext4_fsblk_t, pblk ) 2209 __field( char, status ) 2210 ), 2211 2212 TP_fast_assign( 2213 __entry->dev = inode->i_sb->s_dev; 2214 __entry->ino = inode->i_ino; 2215 __entry->lblk = es->es_lblk; 2216 __entry->len = es->es_len; 2217 __entry->pblk = ext4_es_pblock(es); 2218 __entry->status = ext4_es_status(es); 2219 ), 2220 2221 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s", 2222 MAJOR(__entry->dev), MINOR(__entry->dev), 2223 (unsigned long) __entry->ino, 2224 __entry->lblk, __entry->len, 2225 __entry->pblk, show_extent_status(__entry->status)) 2226 ); 2227 2228 DEFINE_EVENT(ext4__es_extent, ext4_es_insert_extent, 2229 TP_PROTO(struct inode *inode, struct extent_status *es), 2230 2231 TP_ARGS(inode, es) 2232 ); 2233 2234 DEFINE_EVENT(ext4__es_extent, ext4_es_cache_extent, 2235 TP_PROTO(struct inode *inode, struct extent_status *es), 2236 2237 TP_ARGS(inode, es) 2238 ); 2239 2240 TRACE_EVENT(ext4_es_remove_extent, 2241 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len), 2242 2243 TP_ARGS(inode, lblk, len), 2244 2245 TP_STRUCT__entry( 2246 __field( dev_t, dev ) 2247 __field( ino_t, ino ) 2248 __field( loff_t, lblk ) 2249 __field( loff_t, len ) 2250 ), 2251 2252 TP_fast_assign( 2253 __entry->dev = inode->i_sb->s_dev; 2254 __entry->ino = inode->i_ino; 2255 __entry->lblk = lblk; 2256 __entry->len = len; 2257 ), 2258 2259 TP_printk("dev %d,%d ino %lu es [%lld/%lld)", 2260 MAJOR(__entry->dev), MINOR(__entry->dev), 2261 (unsigned long) __entry->ino, 2262 __entry->lblk, __entry->len) 2263 ); 2264 2265 TRACE_EVENT(ext4_es_find_delayed_extent_range_enter, 2266 TP_PROTO(struct inode *inode, ext4_lblk_t lblk), 2267 2268 TP_ARGS(inode, lblk), 2269 2270 TP_STRUCT__entry( 2271 __field( dev_t, dev ) 2272 __field( ino_t, ino ) 2273 __field( ext4_lblk_t, lblk ) 2274 ), 2275 2276 TP_fast_assign( 2277 __entry->dev = inode->i_sb->s_dev; 2278 __entry->ino = inode->i_ino; 2279 __entry->lblk = lblk; 2280 ), 2281 2282 TP_printk("dev %d,%d ino %lu lblk %u", 2283 MAJOR(__entry->dev), MINOR(__entry->dev), 2284 (unsigned long) __entry->ino, __entry->lblk) 2285 ); 2286 2287 TRACE_EVENT(ext4_es_find_delayed_extent_range_exit, 2288 TP_PROTO(struct inode *inode, struct extent_status *es), 2289 2290 TP_ARGS(inode, es), 2291 2292 TP_STRUCT__entry( 2293 __field( dev_t, dev ) 2294 __field( ino_t, ino ) 2295 __field( ext4_lblk_t, lblk ) 2296 __field( ext4_lblk_t, len ) 2297 __field( ext4_fsblk_t, pblk ) 2298 __field( char, status ) 2299 ), 2300 2301 TP_fast_assign( 2302 __entry->dev = inode->i_sb->s_dev; 2303 __entry->ino = inode->i_ino; 2304 __entry->lblk = es->es_lblk; 2305 __entry->len = es->es_len; 2306 __entry->pblk = ext4_es_pblock(es); 2307 __entry->status = ext4_es_status(es); 2308 ), 2309 2310 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s", 2311 MAJOR(__entry->dev), MINOR(__entry->dev), 2312 (unsigned long) __entry->ino, 2313 __entry->lblk, __entry->len, 2314 __entry->pblk, show_extent_status(__entry->status)) 2315 ); 2316 2317 TRACE_EVENT(ext4_es_lookup_extent_enter, 2318 TP_PROTO(struct inode *inode, ext4_lblk_t lblk), 2319 2320 TP_ARGS(inode, lblk), 2321 2322 TP_STRUCT__entry( 2323 __field( dev_t, dev ) 2324 __field( ino_t, ino ) 2325 __field( ext4_lblk_t, lblk ) 2326 ), 2327 2328 TP_fast_assign( 2329 __entry->dev = inode->i_sb->s_dev; 2330 __entry->ino = inode->i_ino; 2331 __entry->lblk = lblk; 2332 ), 2333 2334 TP_printk("dev %d,%d ino %lu lblk %u", 2335 MAJOR(__entry->dev), MINOR(__entry->dev), 2336 (unsigned long) __entry->ino, __entry->lblk) 2337 ); 2338 2339 TRACE_EVENT(ext4_es_lookup_extent_exit, 2340 TP_PROTO(struct inode *inode, struct extent_status *es, 2341 int found), 2342 2343 TP_ARGS(inode, es, found), 2344 2345 TP_STRUCT__entry( 2346 __field( dev_t, dev ) 2347 __field( ino_t, ino ) 2348 __field( ext4_lblk_t, lblk ) 2349 __field( ext4_lblk_t, len ) 2350 __field( ext4_fsblk_t, pblk ) 2351 __field( char, status ) 2352 __field( int, found ) 2353 ), 2354 2355 TP_fast_assign( 2356 __entry->dev = inode->i_sb->s_dev; 2357 __entry->ino = inode->i_ino; 2358 __entry->lblk = es->es_lblk; 2359 __entry->len = es->es_len; 2360 __entry->pblk = ext4_es_pblock(es); 2361 __entry->status = ext4_es_status(es); 2362 __entry->found = found; 2363 ), 2364 2365 TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %s", 2366 MAJOR(__entry->dev), MINOR(__entry->dev), 2367 (unsigned long) __entry->ino, __entry->found, 2368 __entry->lblk, __entry->len, 2369 __entry->found ? __entry->pblk : 0, 2370 show_extent_status(__entry->found ? __entry->status : 0)) 2371 ); 2372 2373 TRACE_EVENT(ext4_es_shrink_enter, 2374 TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt), 2375 2376 TP_ARGS(sb, nr_to_scan, cache_cnt), 2377 2378 TP_STRUCT__entry( 2379 __field( dev_t, dev ) 2380 __field( int, nr_to_scan ) 2381 __field( int, cache_cnt ) 2382 ), 2383 2384 TP_fast_assign( 2385 __entry->dev = sb->s_dev; 2386 __entry->nr_to_scan = nr_to_scan; 2387 __entry->cache_cnt = cache_cnt; 2388 ), 2389 2390 TP_printk("dev %d,%d nr_to_scan %d cache_cnt %d", 2391 MAJOR(__entry->dev), MINOR(__entry->dev), 2392 __entry->nr_to_scan, __entry->cache_cnt) 2393 ); 2394 2395 TRACE_EVENT(ext4_es_shrink_exit, 2396 TP_PROTO(struct super_block *sb, int shrunk_nr, int cache_cnt), 2397 2398 TP_ARGS(sb, shrunk_nr, cache_cnt), 2399 2400 TP_STRUCT__entry( 2401 __field( dev_t, dev ) 2402 __field( int, shrunk_nr ) 2403 __field( int, cache_cnt ) 2404 ), 2405 2406 TP_fast_assign( 2407 __entry->dev = sb->s_dev; 2408 __entry->shrunk_nr = shrunk_nr; 2409 __entry->cache_cnt = cache_cnt; 2410 ), 2411 2412 TP_printk("dev %d,%d shrunk_nr %d cache_cnt %d", 2413 MAJOR(__entry->dev), MINOR(__entry->dev), 2414 __entry->shrunk_nr, __entry->cache_cnt) 2415 ); 2416 2417 TRACE_EVENT(ext4_collapse_range, 2418 TP_PROTO(struct inode *inode, loff_t offset, loff_t len), 2419 2420 TP_ARGS(inode, offset, len), 2421 2422 TP_STRUCT__entry( 2423 __field(dev_t, dev) 2424 __field(ino_t, ino) 2425 __field(loff_t, offset) 2426 __field(loff_t, len) 2427 ), 2428 2429 TP_fast_assign( 2430 __entry->dev = inode->i_sb->s_dev; 2431 __entry->ino = inode->i_ino; 2432 __entry->offset = offset; 2433 __entry->len = len; 2434 ), 2435 2436 TP_printk("dev %d,%d ino %lu offset %lld len %lld", 2437 MAJOR(__entry->dev), MINOR(__entry->dev), 2438 (unsigned long) __entry->ino, 2439 __entry->offset, __entry->len) 2440 ); 2441 2442 #endif /* _TRACE_EXT4_H */ 2443 2444 /* This part must be outside protection */ 2445 #include <trace/define_trace.h> 2446