Skip to content

Commit

Permalink
writeback: Add tracing to write_cache_pages
Browse files Browse the repository at this point in the history
Add a trace event to the ->writepage loop in write_cache_pages to give
visibility into how the ->writepage call is changing variables within the
writeback control structure. Of most interest is how wbc->nr_to_write changes
from call to call, especially with filesystems that write multiple pages
in ->writepage.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
  • Loading branch information
Dave Chinner authored and Jens Axboe committed Aug 7, 2010
1 parent 028c2dd commit 9e09438
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/trace/events/writeback.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ DEFINE_WBC_EVENT(wbc_writeback_wait);
DEFINE_WBC_EVENT(wbc_balance_dirty_start);
DEFINE_WBC_EVENT(wbc_balance_dirty_written);
DEFINE_WBC_EVENT(wbc_balance_dirty_wait);
DEFINE_WBC_EVENT(wbc_writepage);

#endif /* _TRACE_WRITEBACK_H */

Expand Down
1 change: 1 addition & 0 deletions mm/page-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@ int write_cache_pages(struct address_space *mapping,
if (!clear_page_dirty_for_io(page))
goto continue_unlock;

trace_wbc_writepage(wbc, mapping->backing_dev_info);
ret = (*writepage)(page, wbc, data);
if (unlikely(ret)) {
if (ret == AOP_WRITEPAGE_ACTIVATE) {
Expand Down

0 comments on commit 9e09438

Please sign in to comment.