fs: ext4-f2fs: Remove CAF tracings
Signed-off-by: alk3pInjection <webmaster@raspii.tech> (cherry picked from commit 7b9cf5ece723a1445ebbd472a1e8063e48a83a02) Change-Id: I6539321164d96fff98a0180b636456e9cb6e07e4 Signed-off-by: Carlos Ayrton Lopez Arroyo <15030201@itcelaya.edu.mx>
This commit is contained in:
parent
c2944a884c
commit
548103b8b3
@ -12,7 +12,6 @@
|
|||||||
#include "ext4.h"
|
#include "ext4.h"
|
||||||
#include "xattr.h"
|
#include "xattr.h"
|
||||||
#include "truncate.h"
|
#include "truncate.h"
|
||||||
#include <trace/events/android_fs.h>
|
|
||||||
|
|
||||||
#define EXT4_XATTR_SYSTEM_DATA "data"
|
#define EXT4_XATTR_SYSTEM_DATA "data"
|
||||||
#define EXT4_MIN_INLINE_DATA_SIZE ((sizeof(__le32) * EXT4_N_BLOCKS))
|
#define EXT4_MIN_INLINE_DATA_SIZE ((sizeof(__le32) * EXT4_N_BLOCKS))
|
||||||
@ -509,17 +508,6 @@ int ext4_readpage_inline(struct inode *inode, struct page *page)
|
|||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Current inline data can only exist in the 1st page,
|
* Current inline data can only exist in the 1st page,
|
||||||
* So for all the other pages, just set them uptodate.
|
* So for all the other pages, just set them uptodate.
|
||||||
@ -531,8 +519,6 @@ int ext4_readpage_inline(struct inode *inode, struct page *page)
|
|||||||
SetPageUptodate(page);
|
SetPageUptodate(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
trace_android_fs_dataread_end(inode, page_offset(page), PAGE_SIZE);
|
|
||||||
|
|
||||||
up_read(&EXT4_I(inode)->xattr_sem);
|
up_read(&EXT4_I(inode)->xattr_sem);
|
||||||
|
|
||||||
unlock_page(page);
|
unlock_page(page);
|
||||||
|
@ -47,7 +47,6 @@
|
|||||||
#include "truncate.h"
|
#include "truncate.h"
|
||||||
|
|
||||||
#include <trace/events/ext4.h>
|
#include <trace/events/ext4.h>
|
||||||
#include <trace/events/android_fs.h>
|
|
||||||
|
|
||||||
#define MPAGE_DA_EXTENT_TAIL 0x01
|
#define MPAGE_DA_EXTENT_TAIL 0x01
|
||||||
|
|
||||||
@ -1279,16 +1278,6 @@ static int ext4_write_begin(struct file *file, struct address_space *mapping,
|
|||||||
if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb))))
|
if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb))))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
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_ext4_write_begin(inode, pos, len, flags);
|
trace_ext4_write_begin(inode, pos, len, flags);
|
||||||
/*
|
/*
|
||||||
* Reserve one block more for addition to orphan list in case
|
* Reserve one block more for addition to orphan list in case
|
||||||
@ -1438,7 +1427,6 @@ static int ext4_write_end(struct file *file,
|
|||||||
int inline_data = ext4_has_inline_data(inode);
|
int inline_data = ext4_has_inline_data(inode);
|
||||||
bool verity = ext4_verity_in_progress(inode);
|
bool verity = ext4_verity_in_progress(inode);
|
||||||
|
|
||||||
trace_android_fs_datawrite_end(inode, pos, len);
|
|
||||||
trace_ext4_write_end(inode, pos, len, copied);
|
trace_ext4_write_end(inode, pos, len, copied);
|
||||||
if (inline_data) {
|
if (inline_data) {
|
||||||
ret = ext4_write_inline_data_end(inode, pos, len,
|
ret = ext4_write_inline_data_end(inode, pos, len,
|
||||||
@ -1549,7 +1537,6 @@ static int ext4_journalled_write_end(struct file *file,
|
|||||||
int inline_data = ext4_has_inline_data(inode);
|
int inline_data = ext4_has_inline_data(inode);
|
||||||
bool verity = ext4_verity_in_progress(inode);
|
bool verity = ext4_verity_in_progress(inode);
|
||||||
|
|
||||||
trace_android_fs_datawrite_end(inode, pos, len);
|
|
||||||
trace_ext4_journalled_write_end(inode, pos, len, copied);
|
trace_ext4_journalled_write_end(inode, pos, len, copied);
|
||||||
from = pos & (PAGE_SIZE - 1);
|
from = pos & (PAGE_SIZE - 1);
|
||||||
to = from + len;
|
to = from + len;
|
||||||
@ -3117,16 +3104,6 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping,
|
|||||||
len, flags, pagep, fsdata);
|
len, flags, pagep, fsdata);
|
||||||
}
|
}
|
||||||
*fsdata = (void *)0;
|
*fsdata = (void *)0;
|
||||||
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_ext4_da_write_begin(inode, pos, len, flags);
|
trace_ext4_da_write_begin(inode, pos, len, flags);
|
||||||
|
|
||||||
if (ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA)) {
|
if (ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA)) {
|
||||||
@ -3245,7 +3222,6 @@ static int ext4_da_write_end(struct file *file,
|
|||||||
return ext4_write_end(file, mapping, pos,
|
return ext4_write_end(file, mapping, pos,
|
||||||
len, copied, page, fsdata);
|
len, copied, page, fsdata);
|
||||||
|
|
||||||
trace_android_fs_datawrite_end(inode, pos, len);
|
|
||||||
trace_ext4_da_write_end(inode, pos, len, copied);
|
trace_ext4_da_write_end(inode, pos, len, copied);
|
||||||
start = pos & (PAGE_SIZE - 1);
|
start = pos & (PAGE_SIZE - 1);
|
||||||
end = start + copied - 1;
|
end = start + copied - 1;
|
||||||
@ -3981,7 +3957,6 @@ static ssize_t ext4_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
|
|||||||
size_t count = iov_iter_count(iter);
|
size_t count = iov_iter_count(iter);
|
||||||
loff_t offset = iocb->ki_pos;
|
loff_t offset = iocb->ki_pos;
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
int rw = iov_iter_rw(iter);
|
|
||||||
|
|
||||||
if (!fscrypt_dio_supported(iocb, iter))
|
if (!fscrypt_dio_supported(iocb, iter))
|
||||||
return 0;
|
return 0;
|
||||||
@ -3999,28 +3974,6 @@ static ssize_t ext4_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
|
|||||||
if (ext4_has_inline_data(inode))
|
if (ext4_has_inline_data(inode))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (trace_android_fs_dataread_start_enabled() &&
|
|
||||||
(rw == 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, path,
|
|
||||||
current->comm);
|
|
||||||
}
|
|
||||||
if (trace_android_fs_datawrite_start_enabled() &&
|
|
||||||
(rw == 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);
|
|
||||||
}
|
|
||||||
trace_ext4_direct_IO_enter(inode, offset, count, iov_iter_rw(iter));
|
trace_ext4_direct_IO_enter(inode, offset, count, iov_iter_rw(iter));
|
||||||
if (iov_iter_rw(iter) == READ)
|
if (iov_iter_rw(iter) == READ)
|
||||||
ret = ext4_direct_IO_read(iocb, iter);
|
ret = ext4_direct_IO_read(iocb, iter);
|
||||||
@ -4028,13 +3981,6 @@ static ssize_t ext4_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
|
|||||||
ret = ext4_direct_IO_write(iocb, iter);
|
ret = ext4_direct_IO_write(iocb, iter);
|
||||||
trace_ext4_direct_IO_exit(inode, offset, count, iov_iter_rw(iter), ret);
|
trace_ext4_direct_IO_exit(inode, offset, count, iov_iter_rw(iter), ret);
|
||||||
|
|
||||||
if (trace_android_fs_dataread_start_enabled() &&
|
|
||||||
(rw == READ))
|
|
||||||
trace_android_fs_dataread_end(inode, offset, count);
|
|
||||||
if (trace_android_fs_datawrite_start_enabled() &&
|
|
||||||
(rw == WRITE))
|
|
||||||
trace_android_fs_datawrite_end(inode, offset, count);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,6 @@
|
|||||||
#include <linux/cleancache.h>
|
#include <linux/cleancache.h>
|
||||||
|
|
||||||
#include "ext4.h"
|
#include "ext4.h"
|
||||||
#include <trace/events/android_fs.h>
|
|
||||||
|
|
||||||
#define NUM_PREALLOC_POST_READ_CTXS 128
|
#define NUM_PREALLOC_POST_READ_CTXS 128
|
||||||
|
|
||||||
@ -147,17 +146,6 @@ static bool bio_post_read_required(struct bio *bio)
|
|||||||
return bio->bi_private && !bio->bi_status;
|
return bio->bi_private && !bio->bi_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
ext4_trace_read_completion(struct bio *bio)
|
|
||||||
{
|
|
||||||
struct page *first_page = bio->bi_io_vec[0].bv_page;
|
|
||||||
|
|
||||||
if (first_page != NULL)
|
|
||||||
trace_android_fs_dataread_end(first_page->mapping->host,
|
|
||||||
page_offset(first_page),
|
|
||||||
bio->bi_iter.bi_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* I/O completion handler for multipage BIOs.
|
* I/O completion handler for multipage BIOs.
|
||||||
*
|
*
|
||||||
@ -172,9 +160,6 @@ ext4_trace_read_completion(struct bio *bio)
|
|||||||
*/
|
*/
|
||||||
static void mpage_end_io(struct bio *bio)
|
static void mpage_end_io(struct bio *bio)
|
||||||
{
|
{
|
||||||
if (trace_android_fs_dataread_start_enabled())
|
|
||||||
ext4_trace_read_completion(bio);
|
|
||||||
|
|
||||||
if (bio_post_read_required(bio)) {
|
if (bio_post_read_required(bio)) {
|
||||||
struct bio_post_read_ctx *ctx = bio->bi_private;
|
struct bio_post_read_ctx *ctx = bio->bi_private;
|
||||||
|
|
||||||
@ -224,30 +209,6 @@ static inline loff_t ext4_readpage_limit(struct inode *inode)
|
|||||||
return i_size_read(inode);
|
return i_size_read(inode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
ext4_submit_bio_read(struct bio *bio)
|
|
||||||
{
|
|
||||||
if (trace_android_fs_dataread_start_enabled()) {
|
|
||||||
struct page *first_page = bio->bi_io_vec[0].bv_page;
|
|
||||||
|
|
||||||
if (first_page != NULL) {
|
|
||||||
char *path, pathbuf[MAX_TRACE_PATHBUF_LEN];
|
|
||||||
|
|
||||||
path = android_fstrace_get_pathname(pathbuf,
|
|
||||||
MAX_TRACE_PATHBUF_LEN,
|
|
||||||
first_page->mapping->host);
|
|
||||||
trace_android_fs_dataread_start(
|
|
||||||
first_page->mapping->host,
|
|
||||||
page_offset(first_page),
|
|
||||||
bio->bi_iter.bi_size,
|
|
||||||
current->pid,
|
|
||||||
path,
|
|
||||||
current->comm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
submit_bio(bio);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ext4_mpage_readpages(struct address_space *mapping,
|
int ext4_mpage_readpages(struct address_space *mapping,
|
||||||
struct list_head *pages, struct page *page,
|
struct list_head *pages, struct page *page,
|
||||||
unsigned nr_pages, bool is_readahead)
|
unsigned nr_pages, bool is_readahead)
|
||||||
@ -395,7 +356,7 @@ int ext4_mpage_readpages(struct address_space *mapping,
|
|||||||
if (bio && (last_block_in_bio != blocks[0] - 1 ||
|
if (bio && (last_block_in_bio != blocks[0] - 1 ||
|
||||||
!fscrypt_mergeable_bio(bio, inode, next_block))) {
|
!fscrypt_mergeable_bio(bio, inode, next_block))) {
|
||||||
submit_and_realloc:
|
submit_and_realloc:
|
||||||
ext4_submit_bio_read(bio);
|
submit_bio(bio);
|
||||||
bio = NULL;
|
bio = NULL;
|
||||||
}
|
}
|
||||||
if (bio == NULL) {
|
if (bio == NULL) {
|
||||||
@ -428,14 +389,14 @@ int ext4_mpage_readpages(struct address_space *mapping,
|
|||||||
if (((map.m_flags & EXT4_MAP_BOUNDARY) &&
|
if (((map.m_flags & EXT4_MAP_BOUNDARY) &&
|
||||||
(relative_block == map.m_len)) ||
|
(relative_block == map.m_len)) ||
|
||||||
(first_hole != blocks_per_page)) {
|
(first_hole != blocks_per_page)) {
|
||||||
ext4_submit_bio_read(bio);
|
submit_bio(bio);
|
||||||
bio = NULL;
|
bio = NULL;
|
||||||
} else
|
} else
|
||||||
last_block_in_bio = blocks[blocks_per_page - 1];
|
last_block_in_bio = blocks[blocks_per_page - 1];
|
||||||
goto next_page;
|
goto next_page;
|
||||||
confused:
|
confused:
|
||||||
if (bio) {
|
if (bio) {
|
||||||
ext4_submit_bio_read(bio);
|
submit_bio(bio);
|
||||||
bio = NULL;
|
bio = NULL;
|
||||||
}
|
}
|
||||||
if (!PageUptodate(page))
|
if (!PageUptodate(page))
|
||||||
@ -448,7 +409,7 @@ int ext4_mpage_readpages(struct address_space *mapping,
|
|||||||
}
|
}
|
||||||
BUG_ON(pages && !list_empty(pages));
|
BUG_ON(pages && !list_empty(pages));
|
||||||
if (bio)
|
if (bio)
|
||||||
ext4_submit_bio_read(bio);
|
submit_bio(bio);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include "segment.h"
|
#include "segment.h"
|
||||||
#include "iostat.h"
|
#include "iostat.h"
|
||||||
#include <trace/events/f2fs.h>
|
#include <trace/events/f2fs.h>
|
||||||
#include <trace/events/android_fs.h>
|
|
||||||
|
|
||||||
#define NUM_PREALLOC_POST_READ_CTXS 128
|
#define NUM_PREALLOC_POST_READ_CTXS 128
|
||||||
|
|
||||||
@ -292,14 +291,6 @@ static void f2fs_read_end_io(struct bio *bio)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (first_page != NULL &&
|
|
||||||
__read_io_type(first_page) == F2FS_RD_DATA) {
|
|
||||||
trace_android_fs_dataread_end(
|
|
||||||
page_file_mapping(first_page)->host,
|
|
||||||
page_file_offset(first_page),
|
|
||||||
bio->bi_iter.bi_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ctx) {
|
if (ctx) {
|
||||||
unsigned int enabled_steps = ctx->enabled_steps &
|
unsigned int enabled_steps = ctx->enabled_steps &
|
||||||
(STEP_DECRYPT | STEP_DECOMPRESS);
|
(STEP_DECRYPT | STEP_DECOMPRESS);
|
||||||
@ -569,32 +560,6 @@ submit_io:
|
|||||||
submit_bio(bio);
|
submit_bio(bio);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __f2fs_submit_read_bio(struct f2fs_sb_info *sbi,
|
|
||||||
struct bio *bio, enum page_type type)
|
|
||||||
{
|
|
||||||
if (trace_android_fs_dataread_start_enabled() && (type == DATA)) {
|
|
||||||
struct page *first_page = bio->bi_io_vec[0].bv_page;
|
|
||||||
|
|
||||||
if (first_page != NULL &&
|
|
||||||
__read_io_type(first_page) == F2FS_RD_DATA) {
|
|
||||||
char *path, pathbuf[MAX_TRACE_PATHBUF_LEN];
|
|
||||||
|
|
||||||
path = android_fstrace_get_pathname(pathbuf,
|
|
||||||
MAX_TRACE_PATHBUF_LEN,
|
|
||||||
page_file_mapping(first_page)->host);
|
|
||||||
|
|
||||||
trace_android_fs_dataread_start(
|
|
||||||
page_file_mapping(first_page)->host,
|
|
||||||
page_file_offset(first_page),
|
|
||||||
bio->bi_iter.bi_size,
|
|
||||||
current->pid,
|
|
||||||
path,
|
|
||||||
current->comm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
__submit_bio(sbi, bio, type);
|
|
||||||
}
|
|
||||||
|
|
||||||
void f2fs_submit_bio(struct f2fs_sb_info *sbi,
|
void f2fs_submit_bio(struct f2fs_sb_info *sbi,
|
||||||
struct bio *bio, enum page_type type)
|
struct bio *bio, enum page_type type)
|
||||||
{
|
{
|
||||||
@ -782,7 +747,7 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio)
|
|||||||
__read_io_type(page) : WB_DATA_TYPE(fio->page));
|
__read_io_type(page) : WB_DATA_TYPE(fio->page));
|
||||||
|
|
||||||
if (is_read_io(fio->op))
|
if (is_read_io(fio->op))
|
||||||
__f2fs_submit_read_bio(fio->sbi, bio, fio->type);
|
__submit_bio(fio->sbi, bio, fio->type);
|
||||||
else
|
else
|
||||||
__submit_bio(fio->sbi, bio, fio->type);
|
__submit_bio(fio->sbi, bio, fio->type);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1147,7 +1112,7 @@ static int f2fs_submit_page_read(struct inode *inode, struct page *page,
|
|||||||
ClearPageError(page);
|
ClearPageError(page);
|
||||||
inc_page_count(sbi, F2FS_RD_DATA);
|
inc_page_count(sbi, F2FS_RD_DATA);
|
||||||
f2fs_update_iostat(sbi, FS_DATA_READ_IO, F2FS_BLKSIZE);
|
f2fs_update_iostat(sbi, FS_DATA_READ_IO, F2FS_BLKSIZE);
|
||||||
__f2fs_submit_read_bio(sbi, bio, DATA);
|
__submit_bio(sbi, bio, DATA);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2231,7 +2196,7 @@ zero_out:
|
|||||||
*last_block_in_bio, block_nr) ||
|
*last_block_in_bio, block_nr) ||
|
||||||
!f2fs_crypt_mergeable_bio(bio, inode, page->index, NULL))) {
|
!f2fs_crypt_mergeable_bio(bio, inode, page->index, NULL))) {
|
||||||
submit_and_realloc:
|
submit_and_realloc:
|
||||||
__f2fs_submit_read_bio(F2FS_I_SB(inode), bio, DATA);
|
__submit_bio(F2FS_I_SB(inode), bio, DATA);
|
||||||
bio = NULL;
|
bio = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2263,7 +2228,7 @@ submit_and_realloc:
|
|||||||
goto out;
|
goto out;
|
||||||
confused:
|
confused:
|
||||||
if (bio) {
|
if (bio) {
|
||||||
__f2fs_submit_read_bio(F2FS_I_SB(inode), bio, DATA);
|
__submit_bio(F2FS_I_SB(inode), bio, DATA);
|
||||||
bio = NULL;
|
bio = NULL;
|
||||||
}
|
}
|
||||||
unlock_page(page);
|
unlock_page(page);
|
||||||
@ -2582,7 +2547,7 @@ next_page:
|
|||||||
}
|
}
|
||||||
BUG_ON(pages && !list_empty(pages));
|
BUG_ON(pages && !list_empty(pages));
|
||||||
if (bio)
|
if (bio)
|
||||||
__f2fs_submit_read_bio(F2FS_I_SB(inode), bio, DATA);
|
__submit_bio(F2FS_I_SB(inode), bio, DATA);
|
||||||
|
|
||||||
if (pages && is_readahead && !drop_ra)
|
if (pages && is_readahead && !drop_ra)
|
||||||
WRITE_ONCE(F2FS_I(inode)->ra_offset, -1);
|
WRITE_ONCE(F2FS_I(inode)->ra_offset, -1);
|
||||||
@ -3654,16 +3619,6 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
|
|||||||
block_t blkaddr = NULL_ADDR;
|
block_t blkaddr = NULL_ADDR;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
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);
|
trace_f2fs_write_begin(inode, pos, len, flags);
|
||||||
|
|
||||||
if (!f2fs_is_checkpoint_ready(sbi)) {
|
if (!f2fs_is_checkpoint_ready(sbi)) {
|
||||||
@ -3789,7 +3744,6 @@ static int f2fs_write_end(struct file *file,
|
|||||||
{
|
{
|
||||||
struct inode *inode = page->mapping->host;
|
struct inode *inode = page->mapping->host;
|
||||||
|
|
||||||
trace_android_fs_datawrite_end(inode, pos, len);
|
|
||||||
trace_f2fs_write_end(inode, pos, len, copied);
|
trace_f2fs_write_end(inode, pos, len, copied);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -3925,29 +3879,6 @@ static ssize_t f2fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
|
|||||||
|
|
||||||
trace_f2fs_direct_IO_enter(inode, offset, count, rw);
|
trace_f2fs_direct_IO_enter(inode, offset, count, rw);
|
||||||
|
|
||||||
if (trace_android_fs_dataread_start_enabled() &&
|
|
||||||
(rw == 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, path,
|
|
||||||
current->comm);
|
|
||||||
}
|
|
||||||
if (trace_android_fs_datawrite_start_enabled() &&
|
|
||||||
(rw == 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 (iocb->ki_flags & IOCB_NOWAIT) {
|
if (iocb->ki_flags & IOCB_NOWAIT) {
|
||||||
if (!f2fs_down_read_trylock(&fi->i_gc_rwsem[rw])) {
|
if (!f2fs_down_read_trylock(&fi->i_gc_rwsem[rw])) {
|
||||||
err = -EAGAIN;
|
err = -EAGAIN;
|
||||||
@ -3996,13 +3927,6 @@ static ssize_t f2fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (trace_android_fs_dataread_start_enabled() &&
|
|
||||||
(rw == READ))
|
|
||||||
trace_android_fs_dataread_end(inode, offset, count);
|
|
||||||
if (trace_android_fs_datawrite_start_enabled() &&
|
|
||||||
(rw == WRITE))
|
|
||||||
trace_android_fs_datawrite_end(inode, offset, count);
|
|
||||||
|
|
||||||
trace_f2fs_direct_IO_exit(inode, offset, count, rw, err);
|
trace_f2fs_direct_IO_exit(inode, offset, count, rw, err);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#include "gc.h"
|
#include "gc.h"
|
||||||
#include "iostat.h"
|
#include "iostat.h"
|
||||||
#include <trace/events/f2fs.h>
|
#include <trace/events/f2fs.h>
|
||||||
#include <trace/events/android_fs.h>
|
|
||||||
#include <uapi/linux/f2fs.h>
|
#include <uapi/linux/f2fs.h>
|
||||||
|
|
||||||
static vm_fault_t f2fs_filemap_fault(struct vm_fault *vmf)
|
static vm_fault_t f2fs_filemap_fault(struct vm_fault *vmf)
|
||||||
@ -270,15 +269,6 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
|
|||||||
|
|
||||||
trace_f2fs_sync_file_enter(inode);
|
trace_f2fs_sync_file_enter(inode);
|
||||||
|
|
||||||
if (trace_android_fs_fsync_start_enabled()) {
|
|
||||||
char *path, pathbuf[MAX_TRACE_PATHBUF_LEN];
|
|
||||||
|
|
||||||
path = android_fstrace_get_pathname(pathbuf,
|
|
||||||
MAX_TRACE_PATHBUF_LEN, inode);
|
|
||||||
trace_android_fs_fsync_start(inode,
|
|
||||||
current->pid, path, current->comm);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (S_ISDIR(inode->i_mode))
|
if (S_ISDIR(inode->i_mode))
|
||||||
goto go_write;
|
goto go_write;
|
||||||
|
|
||||||
@ -396,7 +386,6 @@ flush_out:
|
|||||||
f2fs_update_time(sbi, REQ_TIME);
|
f2fs_update_time(sbi, REQ_TIME);
|
||||||
out:
|
out:
|
||||||
trace_f2fs_sync_file_exit(inode, cp_reason, datasync, ret);
|
trace_f2fs_sync_file_exit(inode, cp_reason, datasync, ret);
|
||||||
trace_android_fs_fsync_end(inode, start, end - start);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
#include "f2fs.h"
|
#include "f2fs.h"
|
||||||
#include "node.h"
|
#include "node.h"
|
||||||
#include <trace/events/android_fs.h>
|
|
||||||
#include <trace/events/f2fs.h>
|
#include <trace/events/f2fs.h>
|
||||||
|
|
||||||
static bool support_inline_data(struct inode *inode)
|
static bool support_inline_data(struct inode *inode)
|
||||||
@ -105,29 +104,14 @@ int f2fs_read_inline_data(struct inode *inode, struct page *page)
|
|||||||
{
|
{
|
||||||
struct page *ipage;
|
struct page *ipage;
|
||||||
|
|
||||||
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 = f2fs_get_node_page(F2FS_I_SB(inode), inode->i_ino);
|
ipage = f2fs_get_node_page(F2FS_I_SB(inode), inode->i_ino);
|
||||||
if (IS_ERR(ipage)) {
|
if (IS_ERR(ipage)) {
|
||||||
trace_android_fs_dataread_end(inode, page_offset(page),
|
|
||||||
PAGE_SIZE);
|
|
||||||
unlock_page(page);
|
unlock_page(page);
|
||||||
return PTR_ERR(ipage);
|
return PTR_ERR(ipage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!f2fs_has_inline_data(inode)) {
|
if (!f2fs_has_inline_data(inode)) {
|
||||||
f2fs_put_page(ipage, 1);
|
f2fs_put_page(ipage, 1);
|
||||||
trace_android_fs_dataread_end(inode, page_offset(page),
|
|
||||||
PAGE_SIZE);
|
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,8 +123,6 @@ int f2fs_read_inline_data(struct inode *inode, struct page *page)
|
|||||||
if (!PageUptodate(page))
|
if (!PageUptodate(page))
|
||||||
SetPageUptodate(page);
|
SetPageUptodate(page);
|
||||||
f2fs_put_page(ipage, 1);
|
f2fs_put_page(ipage, 1);
|
||||||
trace_android_fs_dataread_end(inode, page_offset(page),
|
|
||||||
PAGE_SIZE);
|
|
||||||
unlock_page(page);
|
unlock_page(page);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
38
fs/mpage.c
38
fs/mpage.c
@ -32,16 +32,6 @@
|
|||||||
#include <linux/cleancache.h>
|
#include <linux/cleancache.h>
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
#define CREATE_TRACE_POINTS
|
|
||||||
#include <trace/events/android_fs.h>
|
|
||||||
|
|
||||||
EXPORT_TRACEPOINT_SYMBOL(android_fs_datawrite_start);
|
|
||||||
EXPORT_TRACEPOINT_SYMBOL(android_fs_datawrite_end);
|
|
||||||
EXPORT_TRACEPOINT_SYMBOL(android_fs_dataread_start);
|
|
||||||
EXPORT_TRACEPOINT_SYMBOL(android_fs_dataread_end);
|
|
||||||
EXPORT_TRACEPOINT_SYMBOL(android_fs_fsync_start);
|
|
||||||
EXPORT_TRACEPOINT_SYMBOL(android_fs_fsync_end);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* I/O completion handler for multipage BIOs.
|
* I/O completion handler for multipage BIOs.
|
||||||
*
|
*
|
||||||
@ -59,16 +49,6 @@ static void mpage_end_io(struct bio *bio)
|
|||||||
struct bio_vec *bv;
|
struct bio_vec *bv;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (trace_android_fs_dataread_end_enabled() &&
|
|
||||||
(bio_data_dir(bio) == READ)) {
|
|
||||||
struct page *first_page = bio->bi_io_vec[0].bv_page;
|
|
||||||
|
|
||||||
if (first_page != NULL)
|
|
||||||
trace_android_fs_dataread_end(first_page->mapping->host,
|
|
||||||
page_offset(first_page),
|
|
||||||
bio->bi_iter.bi_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
bio_for_each_segment_all(bv, bio, i) {
|
bio_for_each_segment_all(bv, bio, i) {
|
||||||
struct page *page = bv->bv_page;
|
struct page *page = bv->bv_page;
|
||||||
page_endio(page, bio_op(bio),
|
page_endio(page, bio_op(bio),
|
||||||
@ -80,24 +60,6 @@ static void mpage_end_io(struct bio *bio)
|
|||||||
|
|
||||||
static struct bio *mpage_bio_submit(int op, int op_flags, struct bio *bio)
|
static struct bio *mpage_bio_submit(int op, int op_flags, struct bio *bio)
|
||||||
{
|
{
|
||||||
if (trace_android_fs_dataread_start_enabled() && (op == REQ_OP_READ)) {
|
|
||||||
struct page *first_page = bio->bi_io_vec[0].bv_page;
|
|
||||||
|
|
||||||
if (first_page != NULL) {
|
|
||||||
char *path, pathbuf[MAX_TRACE_PATHBUF_LEN];
|
|
||||||
|
|
||||||
path = android_fstrace_get_pathname(pathbuf,
|
|
||||||
MAX_TRACE_PATHBUF_LEN,
|
|
||||||
first_page->mapping->host);
|
|
||||||
trace_android_fs_dataread_start(
|
|
||||||
first_page->mapping->host,
|
|
||||||
page_offset(first_page),
|
|
||||||
bio->bi_iter.bi_size,
|
|
||||||
current->pid,
|
|
||||||
path,
|
|
||||||
current->comm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bio->bi_end_io = mpage_end_io;
|
bio->bi_end_io = mpage_end_io;
|
||||||
bio_set_op_attrs(bio, op, op_flags);
|
bio_set_op_attrs(bio, op, op_flags);
|
||||||
guard_bio_eod(op, bio);
|
guard_bio_eod(op, bio);
|
||||||
|
@ -1,74 +0,0 @@
|
|||||||
#undef TRACE_SYSTEM
|
|
||||||
#define TRACE_SYSTEM android_fs
|
|
||||||
|
|
||||||
#if !defined(_TRACE_ANDROID_FS_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
||||||
#define _TRACE_ANDROID_FS_H
|
|
||||||
|
|
||||||
#include <linux/tracepoint.h>
|
|
||||||
#include <trace/events/android_fs_template.h>
|
|
||||||
|
|
||||||
DEFINE_EVENT(android_fs_data_start_template, android_fs_dataread_start,
|
|
||||||
TP_PROTO(struct inode *inode, loff_t offset, int bytes,
|
|
||||||
pid_t pid, char *pathname, char *command),
|
|
||||||
TP_ARGS(inode, offset, bytes, pid, pathname, command));
|
|
||||||
|
|
||||||
DEFINE_EVENT(android_fs_data_end_template, android_fs_dataread_end,
|
|
||||||
TP_PROTO(struct inode *inode, loff_t offset, int bytes),
|
|
||||||
TP_ARGS(inode, offset, bytes));
|
|
||||||
|
|
||||||
DEFINE_EVENT(android_fs_data_start_template, android_fs_datawrite_start,
|
|
||||||
TP_PROTO(struct inode *inode, loff_t offset, int bytes,
|
|
||||||
pid_t pid, char *pathname, char *command),
|
|
||||||
TP_ARGS(inode, offset, bytes, pid, pathname, command));
|
|
||||||
|
|
||||||
DEFINE_EVENT(android_fs_data_end_template, android_fs_datawrite_end,
|
|
||||||
TP_PROTO(struct inode *inode, loff_t offset, int bytes),
|
|
||||||
TP_ARGS(inode, offset, bytes));
|
|
||||||
|
|
||||||
DEFINE_EVENT(android_fs_fsync_start_template, android_fs_fsync_start,
|
|
||||||
TP_PROTO(struct inode *inode,
|
|
||||||
pid_t pid, char *pathname, char *command),
|
|
||||||
TP_ARGS(inode, pid, pathname, command));
|
|
||||||
|
|
||||||
DEFINE_EVENT(android_fs_data_end_template, android_fs_fsync_end,
|
|
||||||
TP_PROTO(struct inode *inode, loff_t offset, int bytes),
|
|
||||||
TP_ARGS(inode, offset, bytes));
|
|
||||||
|
|
||||||
#endif /* _TRACE_ANDROID_FS_H */
|
|
||||||
|
|
||||||
/* This part must be outside protection */
|
|
||||||
#include <trace/define_trace.h>
|
|
||||||
|
|
||||||
#ifndef ANDROID_FSTRACE_GET_PATHNAME
|
|
||||||
#define ANDROID_FSTRACE_GET_PATHNAME
|
|
||||||
|
|
||||||
/* Sizes an on-stack array, so careful if sizing this up ! */
|
|
||||||
#define MAX_TRACE_PATHBUF_LEN 256
|
|
||||||
|
|
||||||
static inline char *
|
|
||||||
android_fstrace_get_pathname(char *buf, int buflen, struct inode *inode)
|
|
||||||
{
|
|
||||||
char *path;
|
|
||||||
struct dentry *d;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* d_obtain_alias() will either iput() if it locates an existing
|
|
||||||
* dentry or transfer the reference to the new dentry created.
|
|
||||||
* So get an extra reference here.
|
|
||||||
*/
|
|
||||||
ihold(inode);
|
|
||||||
d = d_obtain_alias(inode);
|
|
||||||
if (likely(!IS_ERR(d))) {
|
|
||||||
path = dentry_path_raw(d, buf, buflen);
|
|
||||||
if (unlikely(IS_ERR(path))) {
|
|
||||||
strcpy(buf, "ERROR");
|
|
||||||
path = buf;
|
|
||||||
}
|
|
||||||
dput(d);
|
|
||||||
} else {
|
|
||||||
strcpy(buf, "ERROR");
|
|
||||||
path = buf;
|
|
||||||
}
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
#endif
|
|
@ -1,98 +0,0 @@
|
|||||||
#if !defined(_TRACE_ANDROID_FS_TEMPLATE_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
||||||
#define _TRACE_ANDROID_FS_TEMPLATE_H
|
|
||||||
|
|
||||||
#include <linux/tracepoint.h>
|
|
||||||
|
|
||||||
DECLARE_EVENT_CLASS(android_fs_data_start_template,
|
|
||||||
TP_PROTO(struct inode *inode, loff_t offset, int bytes,
|
|
||||||
pid_t pid, char *pathname, char *command),
|
|
||||||
TP_ARGS(inode, offset, bytes, pid, pathname, command),
|
|
||||||
TP_STRUCT__entry(
|
|
||||||
__string(pathbuf, pathname);
|
|
||||||
__field(loff_t, offset);
|
|
||||||
__field(int, bytes);
|
|
||||||
__field(loff_t, i_size);
|
|
||||||
__string(cmdline, command);
|
|
||||||
__field(pid_t, pid);
|
|
||||||
__field(ino_t, ino);
|
|
||||||
),
|
|
||||||
TP_fast_assign(
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Replace the spaces in filenames and cmdlines
|
|
||||||
* because this screws up the tooling that parses
|
|
||||||
* the traces.
|
|
||||||
*/
|
|
||||||
__assign_str(pathbuf, pathname);
|
|
||||||
(void)strreplace(__get_str(pathbuf), ' ', '_');
|
|
||||||
__entry->offset = offset;
|
|
||||||
__entry->bytes = bytes;
|
|
||||||
__entry->i_size = i_size_read(inode);
|
|
||||||
__assign_str(cmdline, command);
|
|
||||||
(void)strreplace(__get_str(cmdline), ' ', '_');
|
|
||||||
__entry->pid = pid;
|
|
||||||
__entry->ino = inode->i_ino;
|
|
||||||
}
|
|
||||||
),
|
|
||||||
TP_printk("entry_name %s, offset %llu, bytes %d, cmdline %s,"
|
|
||||||
" pid %d, i_size %llu, ino %lu",
|
|
||||||
__get_str(pathbuf), __entry->offset, __entry->bytes,
|
|
||||||
__get_str(cmdline), __entry->pid, __entry->i_size,
|
|
||||||
(unsigned long) __entry->ino)
|
|
||||||
);
|
|
||||||
|
|
||||||
DECLARE_EVENT_CLASS(android_fs_data_end_template,
|
|
||||||
TP_PROTO(struct inode *inode, loff_t offset, int bytes),
|
|
||||||
TP_ARGS(inode, offset, bytes),
|
|
||||||
TP_STRUCT__entry(
|
|
||||||
__field(ino_t, ino);
|
|
||||||
__field(loff_t, offset);
|
|
||||||
__field(int, bytes);
|
|
||||||
),
|
|
||||||
TP_fast_assign(
|
|
||||||
{
|
|
||||||
__entry->ino = inode->i_ino;
|
|
||||||
__entry->offset = offset;
|
|
||||||
__entry->bytes = bytes;
|
|
||||||
}
|
|
||||||
),
|
|
||||||
TP_printk("ino %lu, offset %llu, bytes %d",
|
|
||||||
(unsigned long) __entry->ino,
|
|
||||||
__entry->offset, __entry->bytes)
|
|
||||||
);
|
|
||||||
|
|
||||||
DECLARE_EVENT_CLASS(android_fs_fsync_start_template,
|
|
||||||
TP_PROTO(struct inode *inode,
|
|
||||||
pid_t pid, char *pathname, char *command),
|
|
||||||
TP_ARGS(inode, pid, pathname, command),
|
|
||||||
TP_STRUCT__entry(
|
|
||||||
__string(pathbuf, pathname);
|
|
||||||
__field(loff_t, i_size);
|
|
||||||
__string(cmdline, command);
|
|
||||||
__field(pid_t, pid);
|
|
||||||
__field(ino_t, ino);
|
|
||||||
),
|
|
||||||
TP_fast_assign(
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Replace the spaces in filenames and cmdlines
|
|
||||||
* because this screws up the tooling that parses
|
|
||||||
* the traces.
|
|
||||||
*/
|
|
||||||
__assign_str(pathbuf, pathname);
|
|
||||||
(void)strreplace(__get_str(pathbuf), ' ', '_');
|
|
||||||
__entry->i_size = i_size_read(inode);
|
|
||||||
__assign_str(cmdline, command);
|
|
||||||
(void)strreplace(__get_str(cmdline), ' ', '_');
|
|
||||||
__entry->pid = pid;
|
|
||||||
__entry->ino = inode->i_ino;
|
|
||||||
}
|
|
||||||
),
|
|
||||||
TP_printk("entry_name %s, cmdline %s,"
|
|
||||||
" pid %d, i_size %llu, ino %lu",
|
|
||||||
__get_str(pathbuf),
|
|
||||||
__get_str(cmdline), __entry->pid, __entry->i_size,
|
|
||||||
(unsigned long) __entry->ino)
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif /* _TRACE_ANDROID_FS_TEMPLATE_H */
|
|
Loading…
Reference in New Issue
Block a user