summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorMohan Srinivasan <srmohan@google.com>2017-02-03 15:48:03 -0800
committerMohan Srinivasan <srmohan@google.com>2017-02-10 19:09:14 +0000
commitd854b688907b34fcab97fc3b58000084255ee53a (patch)
tree8a0b17c2c9f6b493b60b20d87431359cfc5abe48 /fs/f2fs
parent11fac3aed57f1ef25755fbdb167c31cc322e2b09 (diff)
ANDROID: Refactor fs readpage/write tracepoints.
Refactor the fs readpage/write tracepoints to move the inode->path lookup outside the tracepoint code, and pass a pointer to the path into the tracepoint code instead. This is necessary because the tracepoint code runs non-preemptible. Thanks to Trilok Soni for catching this in 4.4. Change-Id: I7486c5947918d155a30c61d6b9cd5027cf8fbe15 Signed-off-by: Mohan Srinivasan <srmohan@google.com>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/data.c34
-rw-r--r--fs/f2fs/inline.c13
2 files changed, 37 insertions, 10 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index e692958d6e78..8936044dee4c 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1402,8 +1402,16 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
struct dnode_of_data dn;
int err = 0;
- trace_android_fs_datawrite_start(inode, pos, len,
- current->pid, current->comm);
+ if (trace_android_fs_datawrite_start_enabled()) {
+ char *path, pathbuf[MAX_TRACE_PATHBUF_LEN];
+
+ path = android_fstrace_get_pathname(pathbuf,
+ MAX_TRACE_PATHBUF_LEN,
+ inode);
+ trace_android_fs_datawrite_start(inode, pos, len,
+ current->pid, path,
+ current->comm);
+ }
trace_f2fs_write_begin(inode, pos, len, flags);
f2fs_balance_fs(sbi);
@@ -1587,15 +1595,27 @@ static ssize_t f2fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
trace_f2fs_direct_IO_enter(inode, offset, count, iov_iter_rw(iter));
if (trace_android_fs_dataread_start_enabled() &&
- (iov_iter_rw(iter) == READ))
+ (iov_iter_rw(iter) == READ)) {
+ char *path, pathbuf[MAX_TRACE_PATHBUF_LEN];
+
+ path = android_fstrace_get_pathname(pathbuf,
+ MAX_TRACE_PATHBUF_LEN,
+ inode);
trace_android_fs_dataread_start(inode, offset,
- count, current->pid,
+ count, current->pid, path,
current->comm);
+ }
if (trace_android_fs_datawrite_start_enabled() &&
- (iov_iter_rw(iter) == WRITE))
- trace_android_fs_datawrite_start(inode, offset, count,
- current->pid, current->comm);
+ (iov_iter_rw(iter) == WRITE)) {
+ char *path, pathbuf[MAX_TRACE_PATHBUF_LEN];
+ path = android_fstrace_get_pathname(pathbuf,
+ MAX_TRACE_PATHBUF_LEN,
+ inode);
+ trace_android_fs_datawrite_start(inode, offset, count,
+ current->pid, path,
+ current->comm);
+ }
if (iov_iter_rw(iter) == WRITE) {
__allocate_data_blocks(inode, offset, count);
if (unlikely(f2fs_cp_error(F2FS_I_SB(inode)))) {
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index d2c5d69ba0b1..dbb2cc4df603 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -85,9 +85,16 @@ int f2fs_read_inline_data(struct inode *inode, struct page *page)
{
struct page *ipage;
- trace_android_fs_dataread_start(inode, page_offset(page),
- PAGE_SIZE, current->pid,
- current->comm);
+ if (trace_android_fs_dataread_start_enabled()) {
+ char *path, pathbuf[MAX_TRACE_PATHBUF_LEN];
+
+ path = android_fstrace_get_pathname(pathbuf,
+ MAX_TRACE_PATHBUF_LEN,
+ inode);
+ trace_android_fs_dataread_start(inode, page_offset(page),
+ PAGE_SIZE, current->pid,
+ path, current->comm);
+ }
ipage = get_node_page(F2FS_I_SB(inode), inode->i_ino);
if (IS_ERR(ipage)) {