From: Dave Chinner Date: Wed, 7 Jul 2010 03:24:08 +0000 (+1000) Subject: writeback: Add tracing to write_cache_pages X-Git-Tag: v2.6.36-rc1~288^2~95 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9e094383b60066996fbc3b53891324e5d2ec858d;p=karo-tx-linux.git writeback: Add tracing to write_cache_pages 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 Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index 0be26acae064..bde92e07fa4f 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h @@ -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 */ diff --git a/mm/page-writeback.c b/mm/page-writeback.c index d556cd829af6..3d2111a22236 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -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) {