writeback: Add tracing to write_cache_pages
authorDave Chinner <dchinner@redhat.com>
Wed, 7 Jul 2010 03:24:08 +0000 (13:24 +1000)
committerJens Axboe <jaxboe@fusionio.com>
Sat, 7 Aug 2010 16:24:26 +0000 (18:24 +0200)
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>
include/trace/events/writeback.h
mm/page-writeback.c

index 0be26acae064c7088288f6b9c63e5a5a8f340e53..bde92e07fa4f6e0dcb14d9f93cb315c41336e092 100644 (file)
@@ -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 */
 
index d556cd829af66ab6431334bafb2d5b1e8a583334..3d2111a2223633d817ccbd6714fcd994509f1ca8 100644 (file)
@@ -933,6 +933,7 @@ continue_unlock:
                        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) {