diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-01-03 20:03:21 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-01-03 20:03:21 -0500 |
commit | ba80b1019aa722b24506db1ee755e0bb2f513022 (patch) | |
tree | 0c9a7dfd3af0f5991f3eaaeb65d735b11e9cf777 /fs/ext4/inode.c | |
parent | c31910672376dfb8d020e32afa7249763bcd924a (diff) |
ext4: Add markers for better debuggability
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 56142accf5cd..4cac8da4e0c1 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -1351,6 +1351,10 @@ static int ext4_write_begin(struct file *file, struct address_space *mapping, | |||
1351 | pgoff_t index; | 1351 | pgoff_t index; |
1352 | unsigned from, to; | 1352 | unsigned from, to; |
1353 | 1353 | ||
1354 | trace_mark(ext4_write_begin, | ||
1355 | "dev %s ino %lu pos %llu len %u flags %u", | ||
1356 | inode->i_sb->s_id, inode->i_ino, | ||
1357 | (unsigned long long) pos, len, flags); | ||
1354 | index = pos >> PAGE_CACHE_SHIFT; | 1358 | index = pos >> PAGE_CACHE_SHIFT; |
1355 | from = pos & (PAGE_CACHE_SIZE - 1); | 1359 | from = pos & (PAGE_CACHE_SIZE - 1); |
1356 | to = from + len; | 1360 | to = from + len; |
@@ -1422,6 +1426,10 @@ static int ext4_ordered_write_end(struct file *file, | |||
1422 | struct inode *inode = mapping->host; | 1426 | struct inode *inode = mapping->host; |
1423 | int ret = 0, ret2; | 1427 | int ret = 0, ret2; |
1424 | 1428 | ||
1429 | trace_mark(ext4_ordered_write_end, | ||
1430 | "dev %s ino %lu pos %llu len %u copied %u", | ||
1431 | inode->i_sb->s_id, inode->i_ino, | ||
1432 | (unsigned long long) pos, len, copied); | ||
1425 | ret = ext4_jbd2_file_inode(handle, inode); | 1433 | ret = ext4_jbd2_file_inode(handle, inode); |
1426 | 1434 | ||
1427 | if (ret == 0) { | 1435 | if (ret == 0) { |
@@ -1460,6 +1468,10 @@ static int ext4_writeback_write_end(struct file *file, | |||
1460 | int ret = 0, ret2; | 1468 | int ret = 0, ret2; |
1461 | loff_t new_i_size; | 1469 | loff_t new_i_size; |
1462 | 1470 | ||
1471 | trace_mark(ext4_writeback_write_end, | ||
1472 | "dev %s ino %lu pos %llu len %u copied %u", | ||
1473 | inode->i_sb->s_id, inode->i_ino, | ||
1474 | (unsigned long long) pos, len, copied); | ||
1463 | new_i_size = pos + copied; | 1475 | new_i_size = pos + copied; |
1464 | if (new_i_size > EXT4_I(inode)->i_disksize) { | 1476 | if (new_i_size > EXT4_I(inode)->i_disksize) { |
1465 | ext4_update_i_disksize(inode, new_i_size); | 1477 | ext4_update_i_disksize(inode, new_i_size); |
@@ -1495,6 +1507,10 @@ static int ext4_journalled_write_end(struct file *file, | |||
1495 | unsigned from, to; | 1507 | unsigned from, to; |
1496 | loff_t new_i_size; | 1508 | loff_t new_i_size; |
1497 | 1509 | ||
1510 | trace_mark(ext4_journalled_write_end, | ||
1511 | "dev %s ino %lu pos %llu len %u copied %u", | ||
1512 | inode->i_sb->s_id, inode->i_ino, | ||
1513 | (unsigned long long) pos, len, copied); | ||
1498 | from = pos & (PAGE_CACHE_SIZE - 1); | 1514 | from = pos & (PAGE_CACHE_SIZE - 1); |
1499 | to = from + len; | 1515 | to = from + len; |
1500 | 1516 | ||
@@ -2311,6 +2327,9 @@ static int ext4_da_writepage(struct page *page, | |||
2311 | struct buffer_head *page_bufs; | 2327 | struct buffer_head *page_bufs; |
2312 | struct inode *inode = page->mapping->host; | 2328 | struct inode *inode = page->mapping->host; |
2313 | 2329 | ||
2330 | trace_mark(ext4_da_writepage, | ||
2331 | "dev %s ino %lu page_index %lu", | ||
2332 | inode->i_sb->s_id, inode->i_ino, page->index); | ||
2314 | size = i_size_read(inode); | 2333 | size = i_size_read(inode); |
2315 | if (page->index == size >> PAGE_CACHE_SHIFT) | 2334 | if (page->index == size >> PAGE_CACHE_SHIFT) |
2316 | len = size & ~PAGE_CACHE_MASK; | 2335 | len = size & ~PAGE_CACHE_MASK; |
@@ -2421,6 +2440,20 @@ static int ext4_da_writepages(struct address_space *mapping, | |||
2421 | int needed_blocks, ret = 0, nr_to_writebump = 0; | 2440 | int needed_blocks, ret = 0, nr_to_writebump = 0; |
2422 | struct ext4_sb_info *sbi = EXT4_SB(mapping->host->i_sb); | 2441 | struct ext4_sb_info *sbi = EXT4_SB(mapping->host->i_sb); |
2423 | 2442 | ||
2443 | trace_mark(ext4_da_writepages, | ||
2444 | "dev %s ino %lu nr_t_write %ld " | ||
2445 | "pages_skipped %ld range_start %llu " | ||
2446 | "range_end %llu nonblocking %d " | ||
2447 | "for_kupdate %d for_reclaim %d " | ||
2448 | "for_writepages %d range_cyclic %d", | ||
2449 | inode->i_sb->s_id, inode->i_ino, | ||
2450 | wbc->nr_to_write, wbc->pages_skipped, | ||
2451 | (unsigned long long) wbc->range_start, | ||
2452 | (unsigned long long) wbc->range_end, | ||
2453 | wbc->nonblocking, wbc->for_kupdate, | ||
2454 | wbc->for_reclaim, wbc->for_writepages, | ||
2455 | wbc->range_cyclic); | ||
2456 | |||
2424 | /* | 2457 | /* |
2425 | * No pages to write? This is mainly a kludge to avoid starting | 2458 | * No pages to write? This is mainly a kludge to avoid starting |
2426 | * a transaction for special inodes like journal inode on last iput() | 2459 | * a transaction for special inodes like journal inode on last iput() |
@@ -2539,6 +2572,14 @@ out_writepages: | |||
2539 | if (!no_nrwrite_index_update) | 2572 | if (!no_nrwrite_index_update) |
2540 | wbc->no_nrwrite_index_update = 0; | 2573 | wbc->no_nrwrite_index_update = 0; |
2541 | wbc->nr_to_write -= nr_to_writebump; | 2574 | wbc->nr_to_write -= nr_to_writebump; |
2575 | trace_mark(ext4_da_writepage_result, | ||
2576 | "dev %s ino %lu ret %d pages_written %d " | ||
2577 | "pages_skipped %ld congestion %d " | ||
2578 | "more_io %d no_nrwrite_index_update %d", | ||
2579 | inode->i_sb->s_id, inode->i_ino, ret, | ||
2580 | pages_written, wbc->pages_skipped, | ||
2581 | wbc->encountered_congestion, wbc->more_io, | ||
2582 | wbc->no_nrwrite_index_update); | ||
2542 | return ret; | 2583 | return ret; |
2543 | } | 2584 | } |
2544 | 2585 | ||
@@ -2590,6 +2631,11 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping, | |||
2590 | len, flags, pagep, fsdata); | 2631 | len, flags, pagep, fsdata); |
2591 | } | 2632 | } |
2592 | *fsdata = (void *)0; | 2633 | *fsdata = (void *)0; |
2634 | |||
2635 | trace_mark(ext4_da_write_begin, | ||
2636 | "dev %s ino %lu pos %llu len %u flags %u", | ||
2637 | inode->i_sb->s_id, inode->i_ino, | ||
2638 | (unsigned long long) pos, len, flags); | ||
2593 | retry: | 2639 | retry: |
2594 | /* | 2640 | /* |
2595 | * With delayed allocation, we don't log the i_disksize update | 2641 | * With delayed allocation, we don't log the i_disksize update |
@@ -2679,6 +2725,10 @@ static int ext4_da_write_end(struct file *file, | |||
2679 | } | 2725 | } |
2680 | } | 2726 | } |
2681 | 2727 | ||
2728 | trace_mark(ext4_da_write_end, | ||
2729 | "dev %s ino %lu pos %llu len %u copied %u", | ||
2730 | inode->i_sb->s_id, inode->i_ino, | ||
2731 | (unsigned long long) pos, len, copied); | ||
2682 | start = pos & (PAGE_CACHE_SIZE - 1); | 2732 | start = pos & (PAGE_CACHE_SIZE - 1); |
2683 | end = start + copied - 1; | 2733 | end = start + copied - 1; |
2684 | 2734 | ||
@@ -2892,6 +2942,9 @@ static int ext4_normal_writepage(struct page *page, | |||
2892 | loff_t size = i_size_read(inode); | 2942 | loff_t size = i_size_read(inode); |
2893 | loff_t len; | 2943 | loff_t len; |
2894 | 2944 | ||
2945 | trace_mark(ext4_normal_writepage, | ||
2946 | "dev %s ino %lu page_index %lu", | ||
2947 | inode->i_sb->s_id, inode->i_ino, page->index); | ||
2895 | J_ASSERT(PageLocked(page)); | 2948 | J_ASSERT(PageLocked(page)); |
2896 | if (page->index == size >> PAGE_CACHE_SHIFT) | 2949 | if (page->index == size >> PAGE_CACHE_SHIFT) |
2897 | len = size & ~PAGE_CACHE_MASK; | 2950 | len = size & ~PAGE_CACHE_MASK; |
@@ -2977,6 +3030,9 @@ static int ext4_journalled_writepage(struct page *page, | |||
2977 | loff_t size = i_size_read(inode); | 3030 | loff_t size = i_size_read(inode); |
2978 | loff_t len; | 3031 | loff_t len; |
2979 | 3032 | ||
3033 | trace_mark(ext4_journalled_writepage, | ||
3034 | "dev %s ino %lu page_index %lu", | ||
3035 | inode->i_sb->s_id, inode->i_ino, page->index); | ||
2980 | J_ASSERT(PageLocked(page)); | 3036 | J_ASSERT(PageLocked(page)); |
2981 | if (page->index == size >> PAGE_CACHE_SHIFT) | 3037 | if (page->index == size >> PAGE_CACHE_SHIFT) |
2982 | len = size & ~PAGE_CACHE_MASK; | 3038 | len = size & ~PAGE_CACHE_MASK; |