Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964847AbWE0QBV (ORCPT ); Sat, 27 May 2006 12:01:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751665AbWE0Pvw (ORCPT ); Sat, 27 May 2006 11:51:52 -0400 Received: from smtp.ustc.edu.cn ([202.38.64.16]:34525 "HELO ustc.edu.cn") by vger.kernel.org with SMTP id S1751613AbWE0Pvo (ORCPT ); Sat, 27 May 2006 11:51:44 -0400 Message-ID: <348745101.16246@ustc.edu.cn> X-EYOUMAIL-SMTPAUTH: wfg@mail.ustc.edu.cn Message-Id: <20060527155142.129761018@localhost.localdomain> References: <20060527154849.927021763@localhost.localdomain> Date: Sat, 27 May 2006 23:49:20 +0800 From: Wu Fengguang To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Wu Fengguang Subject: [PATCH 31/32] readahead: debug traces showing accessed file names Content-Disposition: inline; filename=readahead-debug-traces-file-list.patch Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1263 Lines: 38 Print file names on their first read-ahead, for tracing file access patterns. Signed-off-by: Wu Fengguang --- mm/readahead.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+) --- linux-2.6.17-rc4-mm3.orig/mm/readahead.c +++ linux-2.6.17-rc4-mm3/mm/readahead.c @@ -1039,6 +1039,20 @@ static int ra_dispatch(struct file_ra_st ra_account(ra, RA_EVENT_IO_CACHE_HIT, ra_size - actual); ra_account(ra, RA_EVENT_READAHEAD, actual); + if (!ra->ra_index && filp->f_dentry->d_inode) { + char *fn; + static char path[1024]; + unsigned long size; + + size = (i_size_read(filp->f_dentry->d_inode)+1023)/1024; + fn = d_path(filp->f_dentry, filp->f_vfsmnt, path, 1000); + if (!IS_ERR(fn)) + ddprintk("ino %lu is %s size %luK by %s(%d)\n", + filp->f_dentry->d_inode->i_ino, + fn, size, + current->comm, current->pid); + } + dprintk("readahead-%s(ino=%lu, index=%lu, ra=%lu+%lu-%lu) = %d\n", ra_class_name[ra_class_new(ra)], mapping->host->i_ino, ra->la_index, -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/